Top Description Fields Constructors Methods
org.bouncycastle.pqc.legacy.math.linearalgebra

public abstract Class Matrix

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.pqc.legacy.math.linearalgebra.GF2Matrix, org.bouncycastle.pqc.legacy.math.linearalgebra.GF2mMatrix

This abstract class defines matrices. It holds the number of rows and the number of columns of the matrix and defines some basic methods.

Field Summary

Modifier and TypeField and Description
public static final char
MATRIX_TYPE_RANDOM_LT

random lower triangular matrix

public static final char
MATRIX_TYPE_RANDOM_REGULAR

random regular matrix

public static final char
MATRIX_TYPE_RANDOM_UT

random upper triangular matrix

public static final char
MATRIX_TYPE_UNIT

unit matrix

public static final char
MATRIX_TYPE_ZERO

zero matrix

protected int
numColumns

number of columns

protected int
numRows

number of rows

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Matrix

Returns:

the inverse of this matrix (newly created).
computeInverse
()

Compute the inverse of this matrix.

public abstract byte[]

Returns:

the encoded matrix, i.e., this matrix in byte array form.
getEncoded
()

public int

Returns:

the number of columns in the binary matrix
getNumColumns
()

public int

Returns:

the number of rows in the matrix
getNumRows
()

public abstract boolean

Returns:

true if this is the zero matrix
isZero
()

Check if this is the zero matrix (i.e., all entries are zero).

public abstract Vector

Returns:

vector * this (newly created)
leftMultiply
(Vector
a vector
vector
)

Compute the product of a vector and this matrix.

public abstract Matrix

Returns:

this * a (newly created)
rightMultiply
(Matrix
the other matrix
a
)

Compute the product of this matrix and another matrix.

public abstract Matrix

Returns:

this * p (newly created)
rightMultiply
(Permutation
the permutation
p
)

Compute the product of this matrix and a permutation.

public abstract Vector

Returns:

this * vector (newly created)
rightMultiply
(Vector
a vector
vector
)

Compute the product of this matrix and a vector.

public abstract String

Returns:

a human readable form of the matrix.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

MATRIX_TYPE_RANDOM_LTback to summary
public static final char MATRIX_TYPE_RANDOM_LT

random lower triangular matrix

MATRIX_TYPE_RANDOM_REGULARback to summary
public static final char MATRIX_TYPE_RANDOM_REGULAR

random regular matrix

MATRIX_TYPE_RANDOM_UTback to summary
public static final char MATRIX_TYPE_RANDOM_UT

random upper triangular matrix

MATRIX_TYPE_UNITback to summary
public static final char MATRIX_TYPE_UNIT

unit matrix

MATRIX_TYPE_ZEROback to summary
public static final char MATRIX_TYPE_ZERO

zero matrix

numColumnsback to summary
protected int numColumns

number of columns

numRowsback to summary
protected int numRows

number of rows

Constructor Detail

Matrixback to summary
public Matrix()

Method Detail

computeInverseback to summary
public abstract Matrix computeInverse()

Compute the inverse of this matrix.

Returns:Matrix

the inverse of this matrix (newly created).

getEncodedback to summary
public abstract byte[] getEncoded()
Returns:byte[]

the encoded matrix, i.e., this matrix in byte array form.

getNumColumnsback to summary
public int getNumColumns()
Returns:int

the number of columns in the binary matrix

getNumRowsback to summary
public int getNumRows()
Returns:int

the number of rows in the matrix

isZeroback to summary
public abstract boolean isZero()

Check if this is the zero matrix (i.e., all entries are zero).

Returns:boolean

true if this is the zero matrix

leftMultiplyback to summary
public abstract Vector leftMultiply(Vector vector)

Compute the product of a vector and this matrix. If the length of the vector is greater than the number of rows of this matrix, the matrix is multiplied by each m-bit part of the vector.

Parameters
vector:Vector

a vector

Returns:Vector

vector * this (newly created)

rightMultiplyback to summary
public abstract Matrix rightMultiply(Matrix a)

Compute the product of this matrix and another matrix.

Parameters
a:Matrix

the other matrix

Returns:Matrix

this * a (newly created)

rightMultiplyback to summary
public abstract Matrix rightMultiply(Permutation p)

Compute the product of this matrix and a permutation.

Parameters
p:Permutation

the permutation

Returns:Matrix

this * p (newly created)

rightMultiplyback to summary
public abstract Vector rightMultiply(Vector vector)

Compute the product of this matrix and a vector.

Parameters
vector:Vector

a vector

Returns:Vector

this * vector (newly created)

toStringback to summary
public abstract String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a human readable form of the matrix.