|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.algebraic.AbstractHypermatrix
org.jscience.mathematics.algebraic.AbstractMatrix
org.jscience.mathematics.algebraic.matrices.AbstractIntegerMatrix
org.jscience.mathematics.algebraic.matrices.AbstractIntegerSquareMatrix
org.jscience.mathematics.algebraic.matrices.IntegerSparseSquareMatrix
public class IntegerSparseSquareMatrix
The IntegerSparseSquareMatrix class provides an object for encapsulating sparse square matrices. Uses compressed row storage.
| Field Summary |
|---|
| Fields inherited from class org.jscience.mathematics.algebraic.matrices.AbstractIntegerSquareMatrix |
|---|
LU, LUpivot |
| Constructor Summary | |
|---|---|
IntegerSparseSquareMatrix(int size)
Constructs an empty matrix. |
|
IntegerSparseSquareMatrix(int[][] array)
Constructs a matrix from an array. |
|
IntegerSparseSquareMatrix(IntegerSparseSquareMatrix mat)
Copy constructor. |
|
| Method Summary | |
|---|---|
AbstractIntegerSquareMatrix |
add(AbstractIntegerSquareMatrix m)
Returns the addition of this matrix and another. |
IntegerSparseSquareMatrix |
add(IntegerSparseSquareMatrix m)
Returns the addition of this matrix and another. |
IntegerSquareMatrix |
add(IntegerSquareMatrix m)
DOCUMENT ME! |
AbstractDoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix. |
java.lang.Object |
clone()
Clone matrix into a new matrix. |
int |
det()
Returns the determinant. |
boolean |
equals(AbstractIntegerSquareMatrix m,
double tol)
Compares two double sparse square matrices for equality. |
boolean |
equals(IntegerSparseSquareMatrix m)
DOCUMENT ME! |
boolean |
equals(IntegerSparseSquareMatrix m,
double tol)
DOCUMENT ME! |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
int |
getPrimitiveElement(int i,
int j)
Returns an element of the matrix. |
int |
infNorm()
Returns the l -norm. |
AbstractDoubleSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix. |
AbstractDoubleMatrix |
mapElements(PrimitiveMapping f)
Applies a function on all the matrix elements. |
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. |
IntegerSparseSquareMatrix |
multiply(IntegerSparseSquareMatrix m)
Returns the multiplication of this matrix and another. |
IntegerSquareMatrix |
multiply(IntegerSquareMatrix m)
DOCUMENT ME! |
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(IntegerSquareMatrix m)
DOCUMENT ME! |
void |
setAllElements(int x)
Sets the value of all elements of the matrix. |
void |
setElement(int i,
int j,
int x)
Sets the value of an element of the matrix. |
AbstractIntegerSquareMatrix |
subtract(AbstractIntegerSquareMatrix m)
Returns the subtraction of this matrix and another. |
IntegerSparseSquareMatrix |
subtract(IntegerSparseSquareMatrix m)
Returns the addition of this matrix and another. |
IntegerSquareMatrix |
subtract(IntegerSquareMatrix m)
DOCUMENT ME! |
AbstractComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix. |
AbstractDoubleMatrix |
toDoubleMatrix()
Converts this matrix to an double matrix. |
int[][] |
toPrimitiveArray()
Projects the matrix to an array. |
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 org.jscience.mathematics.algebraic.matrices.AbstractIntegerSquareMatrix |
|---|
add, directSum, inverse, isSymmetric, isUnitary, negate, qrDecompose, scalarProduct, singularValueDecompose, subtract, tensorProduct |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractIntegerMatrix |
|---|
abs, add, directSum, equals, equals, equals, getColumn, getElement, getMatrixAsColumns, getMatrixAsRows, getRow, getSet, getSubMatrix, hashCode, horizontalAxisSymmetry, mass, max, mean, min, multiply, multiply, read, reverse, scalarDivide, scalarMultiply, setColumn, setRow, setSubMatrix, subtract, tensorProduct, verticalAxisSymmetry |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix |
|---|
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.algebraic.Matrix |
|---|
getColumn, getElement, getRow, numColumns, numRows, toArray |
| Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix |
|---|
getDimensions, getElement, numDimensions, numElements, numElements, toArray, toArray |
| Constructor Detail |
|---|
public IntegerSparseSquareMatrix(int size)
size - the number of rows/columnspublic IntegerSparseSquareMatrix(int[][] array)
array - an assigned value
IllegalDimensionException - If the array is not square.public IntegerSparseSquareMatrix(IntegerSparseSquareMatrix mat)
mat - an assigned value| Method Detail |
|---|
public boolean equals(AbstractIntegerSquareMatrix m,
double tol)
m - a integer matrixtol - DOCUMENT ME!
public boolean equals(IntegerSparseSquareMatrix m)
m - DOCUMENT ME!
public boolean equals(IntegerSparseSquareMatrix m,
double tol)
m - DOCUMENT ME!tol - DOCUMENT ME!
public java.lang.String toString()
toString in class AbstractIntegerMatrixpublic AbstractDoubleMatrix toDoubleMatrix()
toDoubleMatrix in class AbstractIntegerSquareMatrixpublic AbstractComplexMatrix toComplexMatrix()
toComplexMatrix in class AbstractIntegerSquareMatrix
public int getPrimitiveElement(int i,
int j)
getPrimitiveElement in class AbstractIntegerMatrixi - row index of the elementj - column index of the element
IllegalDimensionException - If attempting to access an invalid
element.
public void setElement(int i,
int j,
int x)
setElement in class AbstractIntegerMatrixi - row index of the elementj - column index of the elementx - a number
IllegalDimensionException - If attempting to access an invalid
element.public void setAllElements(int x)
setAllElements in class AbstractIntegerMatrixx - a int elementpublic int det()
det in class AbstractIntegerSquareMatrixjava.lang.ArithmeticException - DOCUMENT ME!public int trace()
trace in class AbstractIntegerSquareMatrixjava.lang.ArithmeticException - DOCUMENT ME!public int infNorm()
-norm.
infNorm in class AbstractIntegerMatrixjava.lang.ArithmeticException - DOCUMENT ME!public double frobeniusNorm()
frobeniusNorm in class AbstractIntegerMatrixjava.lang.ArithmeticException - DOCUMENT ME!public AbstractIntegerSquareMatrix add(AbstractIntegerSquareMatrix m)
add in class AbstractIntegerSquareMatrixm - a integer matrix
IllegalDimensionException - If the matrices are different sizes.public IntegerSquareMatrix add(IntegerSquareMatrix m)
m - DOCUMENT ME!
public IntegerSparseSquareMatrix add(IntegerSparseSquareMatrix m)
m - a integer sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractIntegerSquareMatrix subtract(AbstractIntegerSquareMatrix m)
subtract in class AbstractIntegerSquareMatrixm - a integer matrix
IllegalDimensionException - If the matrices are different sizes.public IntegerSquareMatrix subtract(IntegerSquareMatrix m)
m - DOCUMENT ME!
public IntegerSparseSquareMatrix subtract(IntegerSparseSquareMatrix m)
m - a integer sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractIntegerMatrix scalarMultiply(int x)
scalarMultiply in class AbstractIntegerSquareMatrixx - a integer
public int scalarProduct(AbstractIntegerSquareMatrix m)
scalarProduct in class AbstractIntegerSquareMatrixm - a integer matrix.
IllegalDimensionException - If the matrices are different sizes.public int scalarProduct(IntegerSquareMatrix m)
m - DOCUMENT ME!
public AbstractIntegerVector multiply(AbstractIntegerVector v)
multiply in class AbstractIntegerMatrixv - a integer vector
IllegalDimensionException - If the matrix and vector are
incompatible.public AbstractIntegerSquareMatrix multiply(AbstractIntegerSquareMatrix m)
multiply in class AbstractIntegerSquareMatrixm - a integer matrix
IllegalDimensionException - If the matrices are incompatible.public IntegerSquareMatrix multiply(IntegerSquareMatrix m)
m - DOCUMENT ME!
public IntegerSparseSquareMatrix multiply(IntegerSparseSquareMatrix m)
m - a integer sparse matrix
IllegalDimensionException - If the matrices are incompatible.public Matrix transpose()
transpose in interface Matrixtranspose in class AbstractIntegerSquareMatrixpublic AbstractDoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class AbstractIntegerSquareMatrixpivot - an empty array of length numRows()+1 to hold
the pivot information (null if not interested)
public AbstractDoubleSquareMatrix[] choleskyDecompose()
choleskyDecompose in class AbstractIntegerSquareMatrixpublic AbstractDoubleMatrix mapElements(PrimitiveMapping f)
mapElements in class AbstractIntegerMatrixf - a user-defined function
public java.lang.Object clone()
clone in class java.lang.Objectpublic int[][] toPrimitiveArray()
toPrimitiveArray in class AbstractIntegerMatrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||