Package hlcd.linearCode
Class CodeValidator
java.lang.Object
hlcd.linearCode.CodeValidator
The code validator that will ensure the code that was obtained is valid by
checking that the generator matrix, orthogonal linear combinations,
minimum distance etc. all satisfy the requirements. This is just to make
sure the program implementation doesn't contain bugs.
- Since:
- 1.8
- Version:
- 1.0 (January 23rd, 2022)
- Author:
- Maysara Al Jumaily
- See Also:
CodeValidatorParameters
-
Constructor Summary
ConstructorsConstructorDescriptionCodeValidator(Code code, CodeValidatorParameters cvp)The only constructor that accepts the code found as well as the validator parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanareAllCombinationsUnique(LongArray combinationsArray, boolean printInvalidEntries)The engine that ensures all the codewords in the code are unique.longgetTotalInvalidMinimumDistanceVectors(LongArray combinationsArray, boolean printInvalidEntries)The engine that goes through the linear combination array and ensures that the minimum distance for each vector in the combinations satisfies the minimum distance requirement.booleanisHLCDPropertySatisfied(LongArray combinationsArray, boolean printInvalidEntries)The engine that ensures all the codewords satisfies the Hermitian LCD property.booleanStarts the validator and uses the properties passed in the constructor.booleanisValidCode(boolean checkDeterminant, boolean checkZeroVectors, boolean checkReplicateLinearCombinations, boolean checkValidMinimumDistance, boolean checkUniqueness, boolean checkHLCDProperty, boolean printInvalidEntries, boolean stopWhenFalseEncountered)Checks if the code satisfies the requirements by checking the appropriate options passed.
-
Constructor Details
-
CodeValidator
The only constructor that accepts the code found as well as the validator parameters.- Parameters:
code- the code foundcvp- the validator parameters
-
-
Method Details
-
isValidCode
public boolean isValidCode(boolean checkDeterminant, boolean checkZeroVectors, boolean checkReplicateLinearCombinations, boolean checkValidMinimumDistance, boolean checkUniqueness, boolean checkHLCDProperty, boolean printInvalidEntries, boolean stopWhenFalseEncountered)Checks if the code satisfies the requirements by checking the appropriate options passed. Instead of using the validator parameters passed in the constructor, they can be passed through this method.- Parameters:
checkDeterminant- should the determinant be checked. This is only for checking if the code is quaternary Hermitian LCDcheckZeroVectors- check if there exists a zero vector in the linear combinations other than the default all-zero vectorcheckReplicateLinearCombinations- should the linear combinations be replicated by using the codewords found in the generator matrix \(G\). The replicated codewords must match what the code contains in terms of linear combinationscheckValidMinimumDistance- Should the minimum distance for each codeword in the code checkedcheckUniqueness- Should a check performed for ensuring each codeword in the code is unique and no duplicates existcheckHLCDProperty- Should the validator loop through all the possible vectors in the space and ensure the Hermitian LCD property is satisfied. This will take immense amount of time, it should be kept asfalseprintInvalidEntries- should print invalid failed tests on consolestopWhenFalseEncountered- should the validator stop as soon as a test fails- Returns:
trueif the code is valid,falseotherwise- See Also:
CodeValidatorParameters
-
isValidCode
public boolean isValidCode()Starts the validator and uses the properties passed in the constructor.- Returns:
trueif the code is valid,falseotherwise- See Also:
CodeValidatorParameters
-
getTotalInvalidMinimumDistanceVectors
public long getTotalInvalidMinimumDistanceVectors(LongArray combinationsArray, boolean printInvalidEntries)The engine that goes through the linear combination array and ensures that the minimum distance for each vector in the combinations satisfies the minimum distance requirement. Note that the all-zero vector is assumed to satisfy the minimum distance constraint.- Parameters:
combinationsArray- the linear combinations (or codewords) of the codeprintInvalidEntries- should the indices of the invalid codewords (i.e., codewords that don't satisfy the minimum distance requirement be printed- Returns:
- the number of codewords that don't satisfy the minimum distance \(d\) of the code
-
areAllCombinationsUnique
The engine that ensures all the codewords in the code are unique.- Parameters:
combinationsArray- the linear combinations (or codewords) of the codeprintInvalidEntries- should the indices of the invalid codewords (i.e., codewords that are not unique be printed)- Returns:
trueif all the codewords in code are unique,falseotherwise
-
isHLCDPropertySatisfied
The engine that ensures all the codewords satisfies the Hermitian LCD property. This is used only for quaternary codes. It will examine all the vectors in the space, see which are orthogonal to all the codewords in the code and ensures these vectors are not a part of the codewords in \(\mathsf{C}\).- Parameters:
combinationsArray- the linear combinations (or codewords) of the codeprintInvalidEntries- should the indices of the invalid codewords (i.e., codewords that don't satisfy the Hermitian LCD property- Returns:
trueif all the code is Hermitian LCD,falseotherwise
-