FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.mpc_discsp.Matrix Class Reference

A matrix over a finite field. More...

Inheritance diagram for frodo2.algorithms.mpc_discsp.Matrix:

Public Member Functions

 Matrix (BigInteger[][] A, BigInteger mod)
 Constructor.
 Matrix (int m, int n, BigInteger mod)
 Constructor.
 Matrix (BigInteger[] v, BigInteger costModulo)
 Constructs a row vector.
String toString ()
Matrix inverse ()
BigInteger[][] getArray ()
BigInteger[][] getArrayCopy ()
Matrix solve (Matrix B)
 Solves A*X = B, assuming this matrix is square and invertible.
int getRowDimension ()
int getColumnDimension ()
Matrix getMatrix (final int[] r, final int j0, final int j1)
 Get a submatrix.
Matrix times (final Matrix B)
 Multiplication.
void set (int i, int j, BigInteger s)
 Sets a coefficient.

Static Public Member Functions

static Matrix identity (final int m, final int n, BigInteger mod)
 Generates an identity matrix.

Protected Attributes

BigInteger[][] A
 The coefficients.
final int m
 The number of rows.
final int n
 The number of columns.
final BigInteger mod
 The prime modulus used for finite-field arithmetic.

Detailed Description

A matrix over a finite field.

Author
Thomas Leaute
See also
"http://math.nist.gov/javanumerics/jama/"

Constructor & Destructor Documentation

◆ Matrix() [1/3]

frodo2.algorithms.mpc_discsp.Matrix.Matrix ( BigInteger A[][],
BigInteger mod )

Constructor.

Parameters
AThe coefficients
modThe prime modulus

References A, m, mod, and n.

Referenced by getMatrix(), identity(), inverse(), frodo2.algorithms.mpc_discsp.LUdecomposition.LUdecomposition(), frodo2.algorithms.mpc_discsp.LUdecomposition.solve(), solve(), and times().

◆ Matrix() [2/3]

frodo2.algorithms.mpc_discsp.Matrix.Matrix ( int m,
int n,
BigInteger mod )

Constructor.

Parameters
mThe number of rows
nThe number of columns
modThe prime modulus

References A, m, mod, and n.

◆ Matrix() [3/3]

frodo2.algorithms.mpc_discsp.Matrix.Matrix ( BigInteger[] v,
BigInteger costModulo )

Constructs a row vector.

Parameters
vthe elements
costModulothe prime modulo

Member Function Documentation

◆ getArray()

BigInteger[][] frodo2.algorithms.mpc_discsp.Matrix.getArray ( )

◆ getArrayCopy()

BigInteger[][] frodo2.algorithms.mpc_discsp.Matrix.getArrayCopy ( )
Returns
a deep copy of the coefficients

References A, m, and n.

Referenced by frodo2.algorithms.mpc_discsp.LUdecomposition.LUdecomposition().

◆ getColumnDimension()

int frodo2.algorithms.mpc_discsp.Matrix.getColumnDimension ( )
Returns
the number of columns

References n.

Referenced by frodo2.algorithms.mpc_discsp.LUdecomposition.solve().

◆ getMatrix()

Matrix frodo2.algorithms.mpc_discsp.Matrix.getMatrix ( final int[] r,
final int j0,
final int j1 )

Get a submatrix.

Parameters
rArray of row indices.
j0Initial column index
j1Final column index
Returns
A(r(:),j0:j1)

References A, getArray(), Matrix(), and mod.

Referenced by frodo2.algorithms.mpc_discsp.LUdecomposition.solve().

Here is the call graph for this function:

◆ getRowDimension()

int frodo2.algorithms.mpc_discsp.Matrix.getRowDimension ( )
Returns
the number of rows

References m.

Referenced by frodo2.algorithms.mpc_discsp.LUdecomposition.solve().

◆ identity()

Matrix frodo2.algorithms.mpc_discsp.Matrix.identity ( final int m,
final int n,
BigInteger mod )
static

Generates an identity matrix.

Parameters
mThe number of rows
nThe number of columns
modThe prime modulus
Returns
identity matrix

References A, m, Matrix(), mod, and n.

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init(), and inverse().

Here is the call graph for this function:

◆ inverse()

Matrix frodo2.algorithms.mpc_discsp.Matrix.inverse ( )
Returns
the inverse of this matrix, assuming it exists

References identity(), m, Matrix(), mod, and solve().

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init().

Here is the call graph for this function:

◆ set()

void frodo2.algorithms.mpc_discsp.Matrix.set ( int i,
int j,
BigInteger s )

Sets a coefficient.

Parameters
irow number
jcolumn number
svalue

References A.

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init().

◆ solve()

Matrix frodo2.algorithms.mpc_discsp.Matrix.solve ( Matrix B)

Solves A*X = B, assuming this matrix is square and invertible.

Parameters
Bright-hand-side matrix
Returns
X

Reimplemented in frodo2.algorithms.mpc_discsp.LUdecomposition.

References Matrix(), mod, and frodo2.algorithms.mpc_discsp.LUdecomposition.solve().

Referenced by inverse().

Here is the call graph for this function:

◆ times()

Matrix frodo2.algorithms.mpc_discsp.Matrix.times ( final Matrix B)

Multiplication.

Parameters
Bthe other matrix
Returns
A*B

References A, getArray(), m, Matrix(), mod, and n.

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.init(), and frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn().

Here is the call graph for this function:

◆ toString()

String frodo2.algorithms.mpc_discsp.Matrix.toString ( )
See also
java.lang.Object#toString()

Member Data Documentation

◆ A

◆ m

◆ mod

final BigInteger frodo2.algorithms.mpc_discsp.Matrix.mod
protected

◆ n


The documentation for this class was generated from the following file: