| Modifier and Type | Field and Description |
|---|---|
| private int | length
the length of each array representing a row of this matrix, computed as (numColumns + 31) / 32 |
| private int[][] | matrix
For the matrix representation the array of type int[][] is used, thus one element of the array keeps 32 elements of the matrix (from one row and 32 columns) |
| Access | Constructor and Description |
|---|---|
| public | |
| public | GF2Matrix(int
the number of columns numColumns, int[][] the element array matrix)Create the matrix with the contents of the given array. |
| public | |
| public | GF2Matrix(int
the matrix size n, char the matrix type typeOfMatrix, SecureRandom the source of randomness sr)Create an nxn matrix of the given type. |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addToRow(int[]
the addend fromRow, int[] the row to add to toRow, int the array index to start from startIndex)Partially add one row to another. |
| private void | assignRandomLowerTriangularMatrix(int
number of rows (and columns) n, SecureRandom source of randomness sr)Create a nxn random lower triangular matrix. |
| private void | assignRandomRegularMatrix(int
number of rows (and columns) n, SecureRandom source of randomness sr)Create an nxn random regular matrix. |
| private void | assignRandomUpperTriangularMatrix(int
number of rows (and columns) n, SecureRandom source of randomness sr)Create a nxn random upper triangular matrix. |
| private void | |
| private void | |
| public Matrix | Returns: the inverse of this matrix (newly created).Implements abstract org. |
| public Matrix | |
| public static GF2Matrix[] | Returns: the created random regular matrix and its inversenumber of rows (and columns) n, SecureRandom source of randomness sr)Create a nxn random regular matrix and its inverse. |
| public boolean | Returns: the result of the comparisonanother object other)Overrides java. |
| public GF2Matrix | Returns: (this | Id)Compute the full form matrix (this | Id) from this matrix in left compact form, where Id is the k x k identity matrix and k is the number of rows of this matrix. |
| public GF2Matrix | Returns: (Id | this)Compute the full form matrix (Id | this) from this matrix in right compact form, where Id is the k x k identity matrix and k is the number of rows of this matrix. |
| public byte[] | Returns: the encoded matrixImplements abstract org. |
| public double | Returns: the Hamming weight of this matrix (as a ratio).Returns the percentage of the number of "ones" in this matrix. |
| public int[][] | |
| public GF2Matrix | Returns: the (numRows x numRows) submatrixGet the quadratic submatrix of this matrix consisting of the leftmost numRows columns. |
| public int | |
| public GF2Matrix | Returns: the (numRows x (numColumns-numRows)) submatrixGet the submatrix of this matrix consisting of the rightmost numColumns-numRows columns. |
| public int[] | Returns: the row of this matrix with the given indexthe index index)Return the row of this matrix with the given index. |
| public int | Returns: the hash code of this matrixOverrides java. |
| public boolean | Returns: true if this is the zero matrixImplements abstract org. |
| public Matrix | Returns: GF2Matrix P*thisthe permutation p)Compute the product of a permutation matrix (which is generated from an n-permutation) and this matrix. |
| public Vector | Returns: Vector product a*matrixa vector over GF(2) vec)Implements abstract org. |
| public Vector | Returns: (this | Id)*vectorthe vector over GF(2) vec)Compute the product of the matrix (this | Id) and a column vector, where Id is a (numRows x numRows) unit matrix. |
| public Matrix | Returns: matrix product this*matrixAa matrix A over GF(2) mat)Implements abstract org. |
| public Matrix | Returns: GF2Matrix this*Pthe permutation p)Implements abstract org. |
| public Vector | Returns: this*vectorthe vector over GF(2) vec)Implements abstract org. |
| public Vector | Returns: (Id | this)*vectorthe vector over GF(2) vec)Compute the product of the matrix (Id | this) and a column vector, where Id is a (numRows x numRows) unit matrix. |
| private static void | swapRows(int[][]
the matrix matrix, int the index of the first row first, int the index of the second row second)Swap two rows of the given matrix. |
| public String | Returns: a human readable form of the matrixImplements abstract org. |
| length | back to summary |
|---|---|
| private int length the length of each array representing a row of this matrix, computed as (numColumns + 31) / 32 | |
| matrix | back to summary |
|---|---|
| private int[][] matrix For the matrix representation the array of type int[][] is used, thus one element of the array keeps 32 elements of the matrix (from one row and 32 columns) | |
| GF2Matrix | back to summary |
|---|---|
| public GF2Matrix(byte[] enc) Create the matrix from encoded form.
| |
| GF2Matrix | back to summary |
|---|---|
| public GF2Matrix(int numColumns, int[][] matrix) Create the matrix with the contents of the given array. The matrix is not copied. Unused coefficients are masked out.
| |
| GF2Matrix | back to summary |
|---|---|
| public GF2Matrix(int n, char typeOfMatrix) Create an nxn matrix of the given type.
| |
| GF2Matrix | back to summary |
|---|---|
| public GF2Matrix(int n, char typeOfMatrix, SecureRandom sr) Create an nxn matrix of the given type.
| |
| GF2Matrix | back to summary |
|---|---|
| public GF2Matrix(GF2Matrix a) Copy constructor. | |
| GF2Matrix | back to summary |
|---|---|
| private GF2Matrix(int m, int n) create the mxn zero matrix | |
| addToRow | back to summary |
|---|---|
| private static void addToRow(int[] fromRow, int[] toRow, int startIndex) Partially add one row to another.
| |
| assignRandomLowerTriangularMatrix | back to summary |
|---|---|
| private void assignRandomLowerTriangularMatrix(int n, SecureRandom sr) Create a nxn random lower triangular matrix.
| |
| assignRandomRegularMatrix | back to summary |
|---|---|
| private void assignRandomRegularMatrix(int n, SecureRandom sr) Create an nxn random regular matrix.
| |
| assignRandomUpperTriangularMatrix | back to summary |
|---|---|
| private void assignRandomUpperTriangularMatrix(int n, SecureRandom sr) Create a nxn random upper triangular matrix.
| |
| assignUnitMatrix | back to summary |
|---|---|
| private void assignUnitMatrix(int n) Create the mxn unit matrix.
| |
| assignZeroMatrix | back to summary |
|---|---|
| private void assignZeroMatrix(int m, int n) Create the mxn zero matrix.
| |
| computeInverse | back to summary |
|---|---|
| public Matrix computeInverse() Implements abstract org. Compute the inverse of this matrix.
| |
| computeTranspose | back to summary |
|---|---|
| public Matrix computeTranspose() Compute the transpose of this matrix.
| |
| createRandomRegularMatrixAndItsInverse | back to summary |
|---|---|
| public static GF2Matrix[] createRandomRegularMatrixAndItsInverse(int n, SecureRandom sr) Create a nxn random regular matrix and its inverse.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Compare this matrix with another object.
| |
| extendLeftCompactForm | back to summary |
|---|---|
| public GF2Matrix extendLeftCompactForm() Compute the full form matrix (this | Id) from this matrix in left compact form, where Id is the k x k identity matrix and k is the number of rows of this matrix.
| |
| extendRightCompactForm | back to summary |
|---|---|
| public GF2Matrix extendRightCompactForm() Compute the full form matrix (Id | this) from this matrix in right compact form, where Id is the k x k identity matrix and k is the number of rows of this matrix.
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Implements abstract org. Returns encoded matrix, i.e., this matrix in byte array form
| |
| getHammingWeight | back to summary |
|---|---|
| public double getHammingWeight() Returns the percentage of the number of "ones" in this matrix.
| |
| getIntArray | back to summary |
|---|---|
public int[][] getIntArray()
| |
| getLeftSubMatrix | back to summary |
|---|---|
| public GF2Matrix getLeftSubMatrix() Get the quadratic submatrix of this matrix consisting of the leftmost numRows columns.
| |
| getLength | back to summary |
|---|---|
public int getLength()
| |
| getRightSubMatrix | back to summary |
|---|---|
| public GF2Matrix getRightSubMatrix() Get the submatrix of this matrix consisting of the rightmost numColumns-numRows columns.
| |
| getRow | back to summary |
|---|---|
| public int[] getRow(int index) Return the row of this matrix with the given index.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isZero | back to summary |
|---|---|
| public boolean isZero() Implements abstract org. Check if this is the zero matrix (i.e., all entries are zero).
| |
| leftMultiply | back to summary |
|---|---|
| public Matrix leftMultiply(Permutation p) Compute the product of a permutation matrix (which is generated from an n-permutation) and this matrix.
| |
| leftMultiply | back to summary |
|---|---|
| public Vector leftMultiply(Vector vec) Implements abstract org. compute product a row vector and this matrix | |
| leftMultiplyLeftCompactForm | back to summary |
|---|---|
| public Vector leftMultiplyLeftCompactForm(Vector vec) Compute the product of the matrix (this | Id) and a column vector, where Id is a (numRows x numRows) unit matrix. | |
| rightMultiply | back to summary |
|---|---|
| public Matrix rightMultiply(Matrix mat) Implements abstract org. Compute the product of this matrix and a matrix A over GF(2). | |
| rightMultiply | back to summary |
|---|---|
| public Matrix rightMultiply(Permutation p) Implements abstract org. Compute the product of this matrix and a permutation matrix which is generated from an n-permutation.
| |
| rightMultiply | back to summary |
|---|---|
| public Vector rightMultiply(Vector vec) Implements abstract org. Compute the product of this matrix and the given column vector. | |
| rightMultiplyRightCompactForm | back to summary |
|---|---|
| public Vector rightMultiplyRightCompactForm(Vector vec) Compute the product of the matrix (Id | this) and a column vector, where Id is a (numRows x numRows) unit matrix. | |
| swapRows | back to summary |
|---|---|
| private static void swapRows(int[][] matrix, int first, int second) Swap two rows of the given matrix.
| |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract org. Doc from java. Returns a string representation of the object.
| |