Class CodeValidator

java.lang.Object
hlcd.linearCode.CodeValidator

public class CodeValidator extends Object
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

    Constructors
    Constructor
    Description
    The only constructor that accepts the code found as well as the validator parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    areAllCombinationsUnique​(LongArray combinationsArray, boolean printInvalidEntries)
    The engine that ensures all the codewords in the code are unique.
    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.
    boolean
    isHLCDPropertySatisfied​(LongArray combinationsArray, boolean printInvalidEntries)
    The engine that ensures all the codewords satisfies the Hermitian LCD property.
    boolean
    Starts the validator and uses the properties passed in the constructor.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CodeValidator

      public CodeValidator(Code code, CodeValidatorParameters cvp)
      The only constructor that accepts the code found as well as the validator parameters.
      Parameters:
      code - the code found
      cvp - 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 LCD
      checkZeroVectors - check if there exists a zero vector in the linear combinations other than the default all-zero vector
      checkReplicateLinearCombinations - 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 combinations
      checkValidMinimumDistance - Should the minimum distance for each codeword in the code checked
      checkUniqueness - Should a check performed for ensuring each codeword in the code is unique and no duplicates exist
      checkHLCDProperty - 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 as false
      printInvalidEntries - should print invalid failed tests on console
      stopWhenFalseEncountered - should the validator stop as soon as a test fails
      Returns:
      true if the code is valid, false otherwise
      See Also:
      CodeValidatorParameters
    • isValidCode

      public boolean isValidCode()
      Starts the validator and uses the properties passed in the constructor.
      Returns:
      true if the code is valid, false otherwise
      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 code
      printInvalidEntries - 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

      public boolean areAllCombinationsUnique(LongArray combinationsArray, boolean printInvalidEntries)
      The engine that ensures all the codewords in the code are unique.
      Parameters:
      combinationsArray - the linear combinations (or codewords) of the code
      printInvalidEntries - should the indices of the invalid codewords (i.e., codewords that are not unique be printed)
      Returns:
      true if all the codewords in code are unique, false otherwise
    • isHLCDPropertySatisfied

      public boolean isHLCDPropertySatisfied(LongArray combinationsArray, boolean printInvalidEntries)
      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 code
      printInvalidEntries - should the indices of the invalid codewords (i.e., codewords that don't satisfy the Hermitian LCD property
      Returns:
      true if all the code is Hermitian LCD, false otherwise