|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
ObjectMatrix
DenseMatrixZ
Matrices over Z using BigIntegers, implemented as
m × n arrays in a straightforward
way. In addition to the basic methods, the LLL algorithm is
available at doLLL().
| Field Summary | |
protected BigInteger[][] |
a
Holds the entries. |
| Constructor Summary | |
DenseMatrixZ(int n)
Constructs an n × n identity matrix. |
|
DenseMatrixZ(int m,
int n)
Constructs an m × n zero matrix. |
|
| Method Summary | |
Matrix |
add(Matrix b0)
Adds this and another DenseMatrixZ,
returning a DenseMatrixZ. |
Object |
clone()
|
int |
doLLL()
Does LLL reduction on the columns, destructively, using Cohen, Algorithm 2.7.2 (see reference in NumThy). |
SparseElt |
get(int i,
int j)
Returns a SparseElt whose value is the i,j value
of the matrix. |
int |
getNumCols()
Returns the number n of columns. |
int |
getNumRows()
Returns the number m of rows. |
Matrix |
inverse()
Unsupported. |
boolean |
isIdentity()
Whether this is an n × n identity matrix. |
boolean |
isProductZero(Matrix b0)
Silly implementation that stores the entire product. |
boolean |
isZero()
Whether every entry in this matrix is zero. |
static void |
main(String[] args)
Tests doLLL(). |
Matrix |
mult(Matrix b0)
Non-destructive if b0 is a CSparse or
DenseMatrixZ, destructive to this if
b0 is an ElemMatrix. |
void |
set(int i,
int j,
BigInteger val)
Easier to use in this class than set(SparseElt, int). |
void |
set(SparseElt rowIndexAndVal,
int colIndex)
Set method. |
Matrix |
transpose()
Non-destructive. |
| Methods inherited from class Matrix |
toString |
| Methods inherited from class Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final BigInteger[][] a
| Constructor Detail |
public DenseMatrixZ(int m,
int n)
public DenseMatrixZ(int n)
| Method Detail |
public Matrix add(Matrix b0)
this and another DenseMatrixZ,
returning a DenseMatrixZ. Does not support other
classes of b0. Non-destructive.
add in class MatrixIllegalArgumentException - If the dimensions don't
match.
public SparseElt get(int i,
int j)
MatrixSparseElt whose value is the i,j value
of the matrix. May return null for a zero entry. The index of
the SparseElt is unspecified--there is no guarantee it is
either i or j.
get in class Matrixpublic int getNumCols()
Matrix
getNumCols in class Matrixpublic int getNumRows()
Matrix
getNumRows in class Matrixpublic Matrix inverse()
inverse in class Matrixpublic boolean isIdentity()
Matrix
isIdentity in class Matrixpublic boolean isZero()
Matrix
isZero in class Matrixpublic Matrix mult(Matrix b0)
b0 is a CSparse or
DenseMatrixZ, destructive to this if
b0 is an ElemMatrix.
mult in class MatrixIllegalArgumentException - If the inner dimensions
don't match.
ClassCastException - If not all entries of
b0 are over Z (i.e., of class SparseEltZ).public boolean isProductZero(Matrix b0)
b0 is of class CSparse or
DenseMatrixZ.
isProductZero in class Matrix
public void set(SparseElt rowIndexAndVal,
int colIndex)
set in class MatrixClassCastException - If the first argument isn't a
SparseEltZ.
public final void set(int i,
int j,
BigInteger val)
set(SparseElt, int).
public Matrix transpose()
Matrix
transpose in class Matrixpublic Object clone()
public int doLLL()
NumThy).
kerdim = the dim of the kernel. The
columns j ≥ kerdim are a
Q-basis (and I think in fact a Z-basis) of the
lattice generated by the columns of the original matrix.public static void main(String[] args)
doLLL(). Input: m n entry0 entry1 entry2, and so
on. The entries are placed in a matrix in row-major order,
repeating if necessary.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||