|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.math.matrix.Matrix
org.rubato.math.matrix.ZnMatrix
public final class ZnMatrix
Matrixes over modular integers.
Constructor Summary | |
---|---|
ZnMatrix(int[][] c,
int modulus)
Creates a mxn integer mod modulus
matrix from the 2-dimensional array c of integers. |
|
ZnMatrix(int[] v,
int modulus)
Creates a nx1 integer modular modulus
matrix from the vector v ,
where n is the length of v . |
|
ZnMatrix(int rows,
int cols,
int modulus)
Creates an integer mod modulus
rows x cols matrix
with all coefficients set to 0. |
|
ZnMatrix(int rows,
int cols,
int modulus,
int value)
Creates an integer mod modulus
rows x cols matrix
with all coefficients set to value . |
|
ZnMatrix(ZMatrix m,
int modulus)
Creates an integer mod modulus
copy of the integer matrix m . |
|
ZnMatrix(ZnMatrix m)
Creates a copy of the modular integer matrix m . |
|
ZnMatrix(ZnMatrix m,
int modulus)
Creates an integer mod modulus
copy of the modular integer matrix m . |
Method Summary | |
---|---|
ZnMatrix |
adjoint()
|
ZnMatrix |
affineDifference()
|
int |
compareTo(Matrix object)
Compares this matrix to object . |
void |
computeRREF()
Compute the reducted row echelon form of this matrix. |
int |
determinant()
|
ZnMatrix |
difference(ZnMatrix m)
|
int |
dotProduct(ZnMatrix m)
|
boolean |
equals(java.lang.Object object)
|
int |
euclidean()
Returns the Euclidean norm of this matrix. |
int |
get(int row,
int col)
Returns the value at index row ,col . |
ZnMatrix |
getMinorMatrix(int row,
int col)
|
int |
getModulus()
Returns the modulus of the coefficient modular integer ring. |
ZnMatrix |
getSubMatrix(int fromRow,
int toRow,
int fromCol,
int toCol)
|
static ZnMatrix |
getUnitMatrix(int size,
int modulus)
Returns the unit integer mod modulus
matrix of the given size . |
ZnMatrix |
inverse()
|
boolean |
isConstant()
Returns true iff the coefficients of this matrix are equal to a constant value. |
boolean |
isOne(int row,
int col)
Returns true iff the coefficient at row ,col is one. |
boolean |
isRegular()
Returns true iff this matrix is regular. |
boolean |
isUnit()
Returns true iff this is a unit matrix. |
boolean |
isZero()
Returns true iff this is a zero matrix. |
boolean |
isZero(int row,
int col)
Returns true iff the coefficient at row ,col is zero. |
int |
minor(int row,
int col)
Returns the minor at row |
ZnMatrix |
power(int exponent)
|
int[] |
product(int[] vector)
|
ZnMatrix |
product(ZnMatrix m)
|
ZnMatrix |
quadraticForm()
|
int |
rank()
Returns the rank of this matrix. |
ZnMatrix |
scaled(int scalar)
|
void |
set(int row,
int col,
int value)
Sets index row ,col to value . |
void |
setColumnCount(int cols)
Resizes this matrix by changing the number of columns. |
void |
setRowCount(int rows)
Resizes this matrix by changing the number of rows. |
void |
setSubMatrix(int row,
int col,
ZnMatrix m)
|
void |
setToElementaryMatrix(int value)
Sets all values of this matrix to value . |
void |
setToOne(int row,
int col)
Sets the coefficient at row ,col to one. |
void |
setToUnitMatrix()
Makes this matrix unit square. |
void |
setToZero(int row,
int col)
Sets the coefficient at row ,col to zero. |
void |
setToZeroMatrix()
Sets all coefficients to zero. |
int |
sum()
Returns the 1-norm of this matrix. |
ZnMatrix |
sum(ZnMatrix m)
|
ZnMatrix |
taylor(int exponent)
|
java.lang.String |
toString()
Returns a string representation of this matrix. |
ZnMatrix |
transposed()
|
Methods inherited from class org.rubato.math.matrix.Matrix |
---|
getColumnCount, getRowCount, isSquare, isZeroColumn, isZeroRow, productPossible, productPossible, sameSize, sameSize |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZnMatrix(int rows, int cols, int modulus)
modulus
rows
x cols
matrix
with all coefficients set to 0.
public ZnMatrix(int rows, int cols, int modulus, int value)
modulus
rows
x cols
matrix
with all coefficients set to value
.
public ZnMatrix(ZnMatrix m)
m
.
public ZnMatrix(ZMatrix m, int modulus)
modulus
copy of the integer matrix m
.
public ZnMatrix(ZnMatrix m, int modulus)
modulus
copy of the modular integer matrix m
.
public ZnMatrix(int[] v, int modulus)
modulus
matrix from the vector v
,
where n is the length of v
.
public ZnMatrix(int[][] c, int modulus)
modulus
matrix from the 2-dimensional array c
of integers.
Method Detail |
---|
public int getModulus()
public static ZnMatrix getUnitMatrix(int size, int modulus)
modulus
matrix of the given size
.
public int get(int row, int col)
row
,col
.
public void set(int row, int col, int value)
row
,col
to value
.
public void setToZero(int row, int col)
Matrix
row
,col
to zero.
setToZero
in class Matrix
public void setToOne(int row, int col)
Matrix
row
,col
to one.
setToOne
in class Matrix
public void setRowCount(int rows)
Matrix
setRowCount
in class Matrix
public void setColumnCount(int cols)
Matrix
setColumnCount
in class Matrix
public void setToZeroMatrix()
Matrix
setToZeroMatrix
in class Matrix
public void setToUnitMatrix()
Matrix
setToUnitMatrix
in class Matrix
public void setToElementaryMatrix(int value)
value
.
public ZnMatrix getSubMatrix(int fromRow, int toRow, int fromCol, int toCol)
public ZnMatrix getMinorMatrix(int row, int col)
public ZnMatrix transposed()
public ZnMatrix inverse()
public ZnMatrix adjoint()
public ZnMatrix affineDifference()
public ZnMatrix quadraticForm()
public ZnMatrix scaled(int scalar)
public ZnMatrix power(int exponent)
public ZnMatrix taylor(int exponent)
public int rank()
Matrix
rank
in class Matrix
public boolean isConstant()
Matrix
isConstant
in class Matrix
public boolean isZero()
Matrix
isZero
in class Matrix
public boolean isUnit()
Matrix
isUnit
in class Matrix
public boolean isRegular()
Matrix
isRegular
in class Matrix
public boolean isZero(int row, int col)
Matrix
row
,col
is zero.
isZero
in class Matrix
public boolean isOne(int row, int col)
Matrix
row
,col
is one.
isOne
in class Matrix
public int dotProduct(ZnMatrix m)
public boolean equals(java.lang.Object object)
equals
in class Matrix
public int compareTo(Matrix object)
Matrix
object
.
If object
is a matrix, but not of the same
type, then the strings representation are compared.
compareTo
in interface java.lang.Comparable<Matrix>
compareTo
in class Matrix
public void setSubMatrix(int row, int col, ZnMatrix m)
public void computeRREF()
public ZnMatrix sum(ZnMatrix m)
public ZnMatrix difference(ZnMatrix m)
public ZnMatrix product(ZnMatrix m)
public int[] product(int[] vector)
public int determinant()
public int minor(int row, int col)
row,col
.
public int euclidean()
public int sum()
public java.lang.String toString()
Matrix
toString
in class Matrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |