|
|||||||||
| 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.AbstractDoubleMatrix
org.jscience.mathematics.algebraic.matrices.AbstractDoubleSquareMatrix
org.jscience.mathematics.algebraic.matrices.DoubleSparseSquareMatrix
public class DoubleSparseSquareMatrix
The DoubleSparseSquareMatrix class provides an object for encapsulating sparse square matrices. Uses compressed row storage.
| Field Summary |
|---|
| Fields inherited from class org.jscience.mathematics.algebraic.matrices.AbstractDoubleSquareMatrix |
|---|
LU, LUpivot |
| Constructor Summary | |
|---|---|
DoubleSparseSquareMatrix(double[][] array)
Constructs a matrix from an array. |
|
DoubleSparseSquareMatrix(DoubleSparseSquareMatrix mat)
Copy constructor. |
|
DoubleSparseSquareMatrix(int size)
Constructs an empty matrix. |
|
| Method Summary | |
|---|---|
AbstractDoubleSquareMatrix |
add(AbstractDoubleSquareMatrix m)
Returns the addition of this matrix and another. |
DoubleSparseSquareMatrix |
add(DoubleSparseSquareMatrix m)
Returns the addition of this matrix and another. |
DoubleSquareMatrix |
add(DoubleSquareMatrix m)
DOCUMENT ME! |
AbstractDoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix. |
java.lang.Object |
clone()
Clone matrix into a new matrix. |
double |
det()
Returns the determinant. |
boolean |
equals(AbstractDoubleSquareMatrix m,
double tol)
Compares two double sparse square matrices for equality. |
boolean |
equals(DoubleSparseSquareMatrix m)
DOCUMENT ME! |
boolean |
equals(DoubleSparseSquareMatrix m,
double tol)
DOCUMENT ME! |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
double |
getPrimitiveElement(int i,
int j)
Returns an element of the matrix. |
double |
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. |
AbstractDoubleSquareMatrix |
multiply(AbstractDoubleSquareMatrix m)
Returns the multiplication of this matrix and another. |
AbstractDoubleVector |
multiply(AbstractDoubleVector v)
Returns the multiplication of a vector by this matrix. |
DoubleSparseSquareMatrix |
multiply(DoubleSparseSquareMatrix m)
Returns the multiplication of this matrix and another. |
DoubleSquareMatrix |
multiply(DoubleSquareMatrix m)
DOCUMENT ME! |
AbstractDoubleMatrix |
scalarDivide(double x)
DOCUMENT ME! |
AbstractDoubleMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar. |
double |
scalarProduct(AbstractDoubleSquareMatrix m)
Returns the scalar product of this matrix and another. |
double |
scalarProduct(DoubleSquareMatrix m)
DOCUMENT ME! |
void |
setAllElements(double x)
Sets the value of all elements of the matrix. |
void |
setElement(int i,
int j,
double x)
Sets the value of an element of the matrix. |
AbstractDoubleSquareMatrix |
subtract(AbstractDoubleSquareMatrix m)
Returns the subtraction of this matrix and another. |
DoubleSparseSquareMatrix |
subtract(DoubleSparseSquareMatrix m)
Returns the addition of this matrix and another. |
DoubleSquareMatrix |
subtract(DoubleSquareMatrix m)
DOCUMENT ME! |
AbstractComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix. |
AbstractIntegerMatrix |
toIntegerMatrix()
Converts this matrix to an integer matrix. |
double[][] |
toPrimitiveArray()
Projects the matrix to an array. |
java.lang.String |
toString()
Returns a string representing this matrix. |
double |
trace()
Returns the trace. |
Matrix |
transpose()
Returns the transpose of this matrix. |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractDoubleSquareMatrix |
|---|
add, directSum, inverse, isSymmetric, isUnitary, negate, operatorNorm, polarDecompose, qrDecompose, scalarProduct, singularValueDecompose, subtract, tensorProduct |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractDoubleMatrix |
|---|
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 DoubleSparseSquareMatrix(int size)
size - the number of rows/columnspublic DoubleSparseSquareMatrix(double[][] array)
array - an assigned value
IllegalDimensionException - If the array is not square.public DoubleSparseSquareMatrix(DoubleSparseSquareMatrix mat)
mat - an assigned value| Method Detail |
|---|
public boolean equals(AbstractDoubleSquareMatrix m,
double tol)
m - a double matrixtol - DOCUMENT ME!
public boolean equals(DoubleSparseSquareMatrix m)
m - DOCUMENT ME!
public boolean equals(DoubleSparseSquareMatrix m,
double tol)
m - DOCUMENT ME!tol - DOCUMENT ME!
public java.lang.String toString()
toString in class AbstractDoubleMatrixpublic AbstractIntegerMatrix toIntegerMatrix()
toIntegerMatrix in class AbstractDoubleSquareMatrixpublic AbstractComplexMatrix toComplexMatrix()
toComplexMatrix in class AbstractDoubleSquareMatrix
public double getPrimitiveElement(int i,
int j)
getPrimitiveElement in class AbstractDoubleMatrixi - 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,
double x)
setElement in class AbstractDoubleMatrixi - row index of the elementj - column index of the elementx - a number
IllegalDimensionException - If attempting to access an invalid
element.public void setAllElements(double x)
setAllElements in class AbstractDoubleMatrixx - a double elementpublic double det()
det in class AbstractDoubleSquareMatrixjava.lang.ArithmeticException - DOCUMENT ME!public double trace()
trace in class AbstractDoubleSquareMatrixjava.lang.ArithmeticException - DOCUMENT ME!public double infNorm()
-norm.
infNorm in class AbstractDoubleMatrixjava.lang.ArithmeticException - DOCUMENT ME!public double frobeniusNorm()
frobeniusNorm in class AbstractDoubleMatrixjava.lang.ArithmeticException - DOCUMENT ME!public AbstractDoubleSquareMatrix add(AbstractDoubleSquareMatrix m)
add in class AbstractDoubleSquareMatrixm - a double matrix
IllegalDimensionException - If the matrices are different sizes.public DoubleSquareMatrix add(DoubleSquareMatrix m)
m - DOCUMENT ME!
public DoubleSparseSquareMatrix add(DoubleSparseSquareMatrix m)
m - a double sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractDoubleSquareMatrix subtract(AbstractDoubleSquareMatrix m)
subtract in class AbstractDoubleSquareMatrixm - a double matrix
IllegalDimensionException - If the matrices are different sizes.public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
m - DOCUMENT ME!
public DoubleSparseSquareMatrix subtract(DoubleSparseSquareMatrix m)
m - a double sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractDoubleMatrix scalarMultiply(double x)
scalarMultiply in class AbstractDoubleSquareMatrixx - a double
public AbstractDoubleMatrix scalarDivide(double x)
scalarDivide in class AbstractDoubleSquareMatrixx - DOCUMENT ME!
public double scalarProduct(AbstractDoubleSquareMatrix m)
scalarProduct in class AbstractDoubleSquareMatrixm - a double matrix.
IllegalDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleSquareMatrix m)
m - DOCUMENT ME!
public AbstractDoubleVector multiply(AbstractDoubleVector v)
multiply in class AbstractDoubleMatrixv - a double vector
IllegalDimensionException - If the matrix and vector are
incompatible.public AbstractDoubleSquareMatrix multiply(AbstractDoubleSquareMatrix m)
multiply in class AbstractDoubleSquareMatrixm - a double matrix
IllegalDimensionException - If the matrices are incompatible.public DoubleSquareMatrix multiply(DoubleSquareMatrix m)
m - DOCUMENT ME!
public DoubleSparseSquareMatrix multiply(DoubleSparseSquareMatrix m)
m - a double sparse matrix
IllegalDimensionException - If the matrices are incompatible.public Matrix transpose()
transpose in interface Matrixtranspose in class AbstractDoubleSquareMatrixpublic AbstractDoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class AbstractDoubleSquareMatrixpivot - an empty array of length numRows()+1 to hold
the pivot information (null if not interested)
public AbstractDoubleSquareMatrix[] choleskyDecompose()
choleskyDecompose in class AbstractDoubleSquareMatrixpublic AbstractDoubleMatrix mapElements(PrimitiveMapping f)
mapElements in class AbstractDoubleMatrixf - a user-defined function
public java.lang.Object clone()
clone in class java.lang.Objectpublic double[][] toPrimitiveArray()
toPrimitiveArray in class AbstractDoubleMatrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||