|
|||||||||
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.AbstractIntegerSquareMatrix JSci.maths.matrices.IntegerDiagonalMatrix
public class IntegerDiagonalMatrix
The IntegerDiagonalMatrix class provides an object for encapsulating integer diagonal matrices.
Field Summary | |
---|---|
protected int[] |
diag
Diagonal data. |
Fields inherited from class JSci.maths.matrices.AbstractIntegerSquareMatrix |
---|
luCache |
Fields inherited from class JSci.maths.matrices.Matrix |
---|
numCols, numRows |
Constructor Summary | |
---|---|
IntegerDiagonalMatrix(int size)
Constructs an empty matrix. |
|
IntegerDiagonalMatrix(int[] array)
Constructs a matrix by wrapping an array containing the diagonal elements. |
|
IntegerDiagonalMatrix(int[][] array)
Constructs a matrix from an array. |
Method Summary | |
---|---|
AbstractIntegerSquareMatrix |
add(AbstractIntegerSquareMatrix m)
Returns the addition of this matrix and another. |
IntegerDiagonalMatrix |
add(IntegerDiagonalMatrix m)
Returns the addition of this matrix and another. |
IntegerSquareMatrix |
add(IntegerSquareMatrix m)
|
IntegerTridiagonalMatrix |
add(IntegerTridiagonalMatrix m)
Returns the addition of this matrix and another. |
AbstractDoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix. |
int |
det()
Returns the determinant. |
boolean |
equals(AbstractIntegerMatrix m,
double tol)
Compares two ${nativeTyp} matrices for equality. |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
int |
getElement(int i,
int j)
Returns an element of the matrix. |
static IntegerDiagonalMatrix |
identity(int size)
Creates an identity matrix. |
int |
infNorm()
Returns the l-norm. |
AbstractDoubleSquareMatrix |
inverse()
Returns the inverse of this matrix. |
boolean |
isSymmetric()
Returns true if this matrix is symmetric. |
AbstractDoubleSquareMatrix[] |
luDecompose()
Returns the LU decomposition of this matrix. |
AbstractDoubleSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix. |
AbstractIntegerSquareMatrix |
multiply(AbstractIntegerSquareMatrix m)
Returns the multiplication of this matrix and another. |
AbstractIntegerVector |
multiply(AbstractIntegerVector v)
Returns the multiplication of a vector by this matrix. |
IntegerDiagonalMatrix |
multiply(IntegerDiagonalMatrix m)
|
IntegerSquareMatrix |
multiply(IntegerSquareMatrix m)
|
IntegerTridiagonalMatrix |
multiply(IntegerTridiagonalMatrix m)
|
double |
operatorNorm()
Returns the operator norm. |
AbstractDoubleSquareMatrix[] |
qrDecompose()
Returns the QR decomposition of this matrix. |
AbstractIntegerMatrix |
scalarMultiply(int x)
Returns the multiplication of this matrix by a scalar. |
int |
scalarProduct(AbstractIntegerSquareMatrix m)
Returns the scalar product of this matrix and another. |
int |
scalarProduct(IntegerDiagonalMatrix m)
|
int |
scalarProduct(IntegerSquareMatrix m)
|
int |
scalarProduct(IntegerTridiagonalMatrix m)
|
void |
setElement(int i,
int j,
int x)
Sets the value of an element of the matrix. |
AbstractDoubleSquareMatrix[] |
singularValueDecompose()
Returns the singular value decomposition of this matrix. |
AbstractIntegerSquareMatrix |
subtract(AbstractIntegerSquareMatrix m)
Returns the subtraction of this matrix by another. |
IntegerDiagonalMatrix |
subtract(IntegerDiagonalMatrix m)
Returns the subtraction of this matrix and another. |
IntegerSquareMatrix |
subtract(IntegerSquareMatrix m)
|
IntegerTridiagonalMatrix |
subtract(IntegerTridiagonalMatrix m)
Returns the subtraction 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. |
int |
trace()
Returns the trace. |
Matrix |
transpose()
Returns the transpose of this matrix. |
Methods inherited from class JSci.maths.matrices.AbstractIntegerSquareMatrix |
---|
add, directSum, isUnitary, luDecompose_cache, negate, scalarProduct, subtract, tensor |
Methods inherited from class JSci.maths.matrices.AbstractIntegerMatrix |
---|
add, directSum, equals, equals, getSet, hashCode, multiply, multiply, scalarDivide, scalarMultiply, subtract, tensor |
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[] diag
Constructor Detail |
---|
public IntegerDiagonalMatrix(int size)
size
- the number of rows/columnspublic IntegerDiagonalMatrix(int[][] array)
array
- an assigned value
MatrixDimensionException
- If the array is not square.public IntegerDiagonalMatrix(int[] array)
array
- an assigned valueMethod Detail |
---|
public static IntegerDiagonalMatrix identity(int size)
size
- the number of rows/columnspublic 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 AbstractIntegerSquareMatrix
public AbstractComplexMatrix toComplexMatrix()
toComplexMatrix
in class AbstractIntegerSquareMatrix
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 boolean isSymmetric()
isSymmetric
in class AbstractIntegerSquareMatrix
public int det()
det
in class AbstractIntegerSquareMatrix
public int trace()
trace
in class AbstractIntegerSquareMatrix
public int infNorm()
infNorm
in class AbstractIntegerMatrix
public double frobeniusNorm()
frobeniusNorm
in class AbstractIntegerMatrix
public double operatorNorm() throws MaximumIterationsExceededException
MaximumIterationsExceededException
- If it takes more than 50 iterations to determine an eigenvalue.public AbstractIntegerSquareMatrix add(AbstractIntegerSquareMatrix m)
add
in class AbstractIntegerSquareMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are different sizes.public IntegerSquareMatrix add(IntegerSquareMatrix m)
public IntegerTridiagonalMatrix add(IntegerTridiagonalMatrix m)
m
- a int tridiagonal matrix
MatrixDimensionException
- If the matrices are different sizes.public IntegerDiagonalMatrix add(IntegerDiagonalMatrix m)
m
- a int diagonal matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractIntegerSquareMatrix subtract(AbstractIntegerSquareMatrix m)
subtract
in class AbstractIntegerSquareMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are different sizes.public IntegerSquareMatrix subtract(IntegerSquareMatrix m)
public IntegerTridiagonalMatrix subtract(IntegerTridiagonalMatrix m)
m
- a int tridiagonal matrix
MatrixDimensionException
- If the matrices are different sizes.public IntegerDiagonalMatrix subtract(IntegerDiagonalMatrix m)
m
- a int diagonal matrix
MatrixDimensionException
- If the matrices are different sizes.public AbstractIntegerMatrix scalarMultiply(int x)
scalarMultiply
in class AbstractIntegerSquareMatrix
x
- a int.
public int scalarProduct(AbstractIntegerSquareMatrix m)
scalarProduct
in class AbstractIntegerSquareMatrix
m
- a int matrix.
MatrixDimensionException
- If the matrices are different sizes.public int scalarProduct(IntegerSquareMatrix m)
public int scalarProduct(IntegerTridiagonalMatrix m)
public int scalarProduct(IntegerDiagonalMatrix m)
public AbstractIntegerVector multiply(AbstractIntegerVector v)
multiply
in class AbstractIntegerMatrix
v
- a int vector.
DimensionException
- If the matrix and vector are incompatible.public AbstractIntegerSquareMatrix multiply(AbstractIntegerSquareMatrix m)
multiply
in class AbstractIntegerSquareMatrix
m
- a int matrix
MatrixDimensionException
- If the matrices are incompatible.public IntegerSquareMatrix multiply(IntegerSquareMatrix m)
public IntegerTridiagonalMatrix multiply(IntegerTridiagonalMatrix m)
public IntegerDiagonalMatrix multiply(IntegerDiagonalMatrix m)
public Matrix transpose()
transpose
in class AbstractIntegerSquareMatrix
public AbstractDoubleSquareMatrix inverse()
inverse
in class AbstractIntegerSquareMatrix
public AbstractDoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose
in class AbstractIntegerSquareMatrix
pivot
- an empty array of length rows()+1
to hold the pivot information (null if not interested).
The last array element will contain the parity.
public AbstractDoubleSquareMatrix[] luDecompose()
luDecompose
in class AbstractIntegerSquareMatrix
public AbstractDoubleSquareMatrix[] choleskyDecompose()
choleskyDecompose
in class AbstractIntegerSquareMatrix
public AbstractDoubleSquareMatrix[] qrDecompose()
qrDecompose
in class AbstractIntegerSquareMatrix
public AbstractDoubleSquareMatrix[] singularValueDecompose()
singularValueDecompose
in class AbstractIntegerSquareMatrix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |