|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.matrices.Matrix JSci.maths.matrices.AbstractIntegerMatrix JSci.maths.matrices.IntegerMatrix
public class IntegerMatrix
The IntegerMatrix class provides an object for encapsulating integer matrices.
Field Summary | |
---|---|
protected int[][] |
matrix
Array containing the elements of the matrix. |
Fields inherited from class JSci.maths.matrices.Matrix |
---|
numCols, numRows |
Constructor Summary | |
---|---|
IntegerMatrix(AbstractIntegerVector[] array)
Constructs a matrix from an array of vectors (columns). |
|
IntegerMatrix(int[][] array)
Constructs a matrix by wrapping an array. |
|
IntegerMatrix(int rows,
int cols)
Constructs an empty matrix. |
Method Summary | |
---|---|
AbstractIntegerMatrix |
add(AbstractIntegerMatrix m)
Returns the addition of this matrix and another. |
AbstractIntegerMatrix |
directSum(AbstractIntegerMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(AbstractIntegerMatrix m,
double tol)
Compares two ${nativeTyp} matrices for equality. |
double |
frobeniusNorm()
Returns the Frobenius or Hilbert-Schmidt (l2) norm. |
int |
getElement(int i,
int j)
Returns an element of the matrix. |
int |
infNorm()
Returns the l-norm. |
AbstractIntegerMatrix |
multiply(AbstractIntegerMatrix m)
Returns the multiplication of this matrix and another. |
AbstractIntegerVector |
multiply(AbstractIntegerVector v)
Returns the multiplication of a vector by this matrix. |
AbstractIntegerMatrix |
multiply(IntegerMatrix m)
|
AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
AbstractIntegerMatrix |
scalarMultiply(int x)
Returns the multiplication of this matrix by a scalar. |
int |
scalarProduct(AbstractIntegerMatrix m)
Returns the scalar product of this matrix and another. |
int |
scalarProduct(IntegerMatrix m)
|
void |
setElement(int i,
int j,
int x)
Sets the value of an element of the matrix. |
AbstractIntegerMatrix |
subtract(AbstractIntegerMatrix m)
Returns the subtraction of this matrix by another. |
AbstractIntegerMatrix |
tensor(AbstractIntegerMatrix m)
Returns the tensor product of this matrix and another. |
AbstractComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix. |
AbstractDoubleMatrix |
toDoubleMatrix()
Converts this matrix to a double matrix. |
java.lang.String |
toString()
Returns a string representing this matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
Methods inherited from class JSci.maths.matrices.AbstractIntegerMatrix |
---|
add, equals, equals, getSet, hashCode, multiply, scalarDivide, scalarMultiply, subtract |
Methods inherited from class JSci.maths.matrices.Matrix |
---|
columns, getInvalidElementMsg, rows |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final int[][] matrix
Constructor Detail |
---|
public IntegerMatrix(int[][] array)
array
- an assigned valuepublic IntegerMatrix(int rows, int cols)
public IntegerMatrix(AbstractIntegerVector[] array)
array
- an assigned valueMethod Detail |
---|
public boolean equals(AbstractIntegerMatrix m, double tol)
equals
in class AbstractIntegerMatrix
m
- a int matrixpublic java.lang.String toString()
toString
in class AbstractIntegerMatrix
public AbstractDoubleMatrix toDoubleMatrix()
toDoubleMatrix
in class AbstractIntegerMatrix
public AbstractComplexMatrix toComplexMatrix()
toComplexMatrix
in class AbstractIntegerMatrix
public int getElement(int i, int j)
getElement
in class AbstractIntegerMatrix
i
- row index of the elementj
- column index of the element
MatrixDimensionException
- If attempting to access an invalid element.public void setElement(int i, int j, int x)
setElement
in class AbstractIntegerMatrix
i
- row index of the elementj
- column index of the elementx
- a number
MatrixDimensionException
- If attempting to access an invalid element.public int infNorm()
infNorm
in class AbstractIntegerMatrix
public double frobeniusNorm()
frobeniusNorm
in class AbstractIntegerMatrix
public AbelianGroup.Member negate()
negate
in interface AbelianGroup.Member
negate
in class AbstractIntegerMatrix
public AbstractIntegerMatrix add(AbstractIntegerMatrix m)
add
in class AbstractIntegerMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractIntegerMatrix subtract(AbstractIntegerMatrix m)
subtract
in class AbstractIntegerMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractIntegerMatrix scalarMultiply(int x)
scalarMultiply
in class AbstractIntegerMatrix
x
- a int.
public int scalarProduct(AbstractIntegerMatrix m)
scalarProduct
in class AbstractIntegerMatrix
m
- a int matrix.
MatrixDimensionException
- If the matrices are different sizes.public int scalarProduct(IntegerMatrix m)
public AbstractIntegerVector multiply(AbstractIntegerVector v)
multiply
in class AbstractIntegerMatrix
v
- a int vector.
DimensionException
- If the matrix and vector are incompatible.public AbstractIntegerMatrix multiply(AbstractIntegerMatrix m)
multiply
in class AbstractIntegerMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are incompatible.public AbstractIntegerMatrix multiply(IntegerMatrix m)
public AbstractIntegerMatrix directSum(AbstractIntegerMatrix m)
directSum
in class AbstractIntegerMatrix
public AbstractIntegerMatrix tensor(AbstractIntegerMatrix m)
tensor
in class AbstractIntegerMatrix
public Matrix transpose()
transpose
in class AbstractIntegerMatrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |