|
|||||||||
| 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.AbstractComplexMatrix
org.jscience.mathematics.algebraic.matrices.ComplexSparseMatrix
public class ComplexSparseMatrix
The ComplexSparseMatrix class provides an object for encapsulating sparse matrices. Uses compressed row storage.
| Constructor Summary | |
|---|---|
ComplexSparseMatrix(Complex[][] array)
Constructs a matrix from an array. |
|
ComplexSparseMatrix(ComplexSparseMatrix mat)
Copy constructor. |
|
ComplexSparseMatrix(int rowCount,
int colCount)
Constructs an empty matrix. |
|
| Method Summary | |
|---|---|
AbstractComplexMatrix |
add(AbstractComplexMatrix m)
Returns the addition of this matrix and another. |
ComplexMatrix |
add(ComplexMatrix m)
DOCUMENT ME! |
ComplexSparseMatrix |
add(ComplexSparseMatrix m)
Returns the addition of this matrix and another. |
java.lang.Object |
clone()
Clone matrix into a new matrix. |
boolean |
equals(AbstractComplexMatrix m,
double tol)
Compares two Complex sparse matrices for equality. |
boolean |
equals(ComplexSparseMatrix m)
DOCUMENT ME! |
boolean |
equals(ComplexSparseMatrix m,
double tol)
DOCUMENT ME! |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
double |
getImagElement(int i,
int j)
DOCUMENT ME! |
Complex |
getPrimitiveElement(int i,
int j)
Returns an element of the matrix. |
double |
getRealElement(int i,
int j)
DOCUMENT ME! |
AbstractDoubleMatrix |
imag()
Returns the imaginary part of this complex matrix. |
double |
infNorm()
Returns the l -norm. |
AbstractComplexMatrix |
mapElements(ComplexMapping f)
Applies a function on all the matrix elements. |
AbstractComplexMatrix |
multiply(AbstractComplexMatrix m)
Returns the multiplication of this matrix and another. |
AbstractComplexVector |
multiply(AbstractComplexVector v)
Returns the multiplication of a vector by this matrix. |
AbstractComplexMatrix |
multiply(ComplexMatrix m)
DOCUMENT ME! |
AbstractComplexMatrix |
multiply(ComplexSparseMatrix m)
Returns the multiplication of this matrix and another. |
AbstractDoubleMatrix |
real()
Returns the real part of this complex matrix. |
AbstractComplexMatrix |
scalarDivide(Complex x)
DOCUMENT ME! |
AbstractComplexMatrix |
scalarMultiply(Complex x)
Returns the multiplication of this matrix by a scalar. |
Complex |
scalarProduct(AbstractComplexMatrix m)
Returns the scalar product of this matrix and another. |
Complex |
scalarProduct(ComplexMatrix m)
DOCUMENT ME! |
void |
setAllElements(Complex m)
Sets the value of all elements of the matrix. |
void |
setElement(int i,
int j,
Complex x)
Sets the value of an element of the matrix. |
AbstractComplexMatrix |
subtract(AbstractComplexMatrix m)
Returns the subtraction of this matrix and another. |
ComplexMatrix |
subtract(ComplexMatrix m)
DOCUMENT ME! |
ComplexSparseMatrix |
subtract(ComplexSparseMatrix m)
Returns the addition of this matrix and another. |
Complex[][] |
toPrimitiveArray()
Projects the matrix to an array. |
java.lang.String |
toString()
Returns a string representing this matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractComplexMatrix |
|---|
abs, add, conjugate, directSum, equals, equals, getColumn, getElement, getMatrixAsColumns, getMatrixAsRows, getRow, getSet, getSubMatrix, hashCode, hermitianAdjoint, horizontalAxisSymmetry, mass, multiply, negate, read, reverse, scalarDivide, scalarDivide, scalarMultiply, scalarMultiply, setColumn, setElement, 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.Hypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Constructor Detail |
|---|
public ComplexSparseMatrix(int rowCount,
int colCount)
rowCount - the number of rowscolCount - the number of columnspublic ComplexSparseMatrix(Complex[][] array)
array - an assigned valuepublic ComplexSparseMatrix(ComplexSparseMatrix mat)
mat - an assigned value| Method Detail |
|---|
public boolean equals(AbstractComplexMatrix m,
double tol)
equals in class AbstractComplexMatrixm - a Complex matrixtol - DOCUMENT ME!
public boolean equals(ComplexSparseMatrix m)
m - DOCUMENT ME!
public boolean equals(ComplexSparseMatrix m,
double tol)
m - DOCUMENT ME!tol - DOCUMENT ME!
public java.lang.String toString()
toString in class AbstractComplexMatrixpublic AbstractDoubleMatrix real()
real in class AbstractComplexMatrixpublic AbstractDoubleMatrix imag()
imag in class AbstractComplexMatrix
public Complex getPrimitiveElement(int i,
int j)
getPrimitiveElement in class AbstractComplexMatrixi - row index of the elementj - column index of the element
IllegalDimensionException - If attempting to access an invalid
element.
public double getRealElement(int i,
int j)
getRealElement in class AbstractComplexMatrixi - DOCUMENT ME!j - DOCUMENT ME!
public double getImagElement(int i,
int j)
getImagElement in class AbstractComplexMatrixi - DOCUMENT ME!j - DOCUMENT ME!
public void setElement(int i,
int j,
Complex x)
setElement in class AbstractComplexMatrixi - row index of the elementj - column index of the elementx - a number
IllegalDimensionException - If attempting to access an invalid
element.public void setAllElements(Complex m)
setAllElements in class AbstractComplexMatrixm - a complex elementpublic double infNorm()
-norm.
infNorm in class AbstractComplexMatrixjava.lang.ArithmeticException - DOCUMENT ME!public double frobeniusNorm()
frobeniusNorm in class AbstractComplexMatrixjava.lang.ArithmeticException - DOCUMENT ME!public AbstractComplexMatrix add(AbstractComplexMatrix m)
add in class AbstractComplexMatrixm - a double matrix
IllegalDimensionException - If the matrices are different sizes.public ComplexMatrix add(ComplexMatrix m)
m - DOCUMENT ME!
public ComplexSparseMatrix add(ComplexSparseMatrix m)
m - a double sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractComplexMatrix subtract(AbstractComplexMatrix m)
subtract in class AbstractComplexMatrixm - a double matrix
IllegalDimensionException - If the matrices are different sizes.public ComplexMatrix subtract(ComplexMatrix m)
m - DOCUMENT ME!
public ComplexSparseMatrix subtract(ComplexSparseMatrix m)
m - a double sparse matrix
IllegalDimensionException - If the matrices are different sizes.public AbstractComplexMatrix scalarMultiply(Complex x)
scalarMultiply in class AbstractComplexMatrixx - a double
public AbstractComplexMatrix scalarDivide(Complex x)
scalarDivide in class AbstractComplexMatrixx - DOCUMENT ME!
public Complex scalarProduct(AbstractComplexMatrix m)
scalarProduct in class AbstractComplexMatrixm - a double matrix.
IllegalDimensionException - If the matrices are different sizes.public Complex scalarProduct(ComplexMatrix m)
m - DOCUMENT ME!
public AbstractComplexVector multiply(AbstractComplexVector v)
multiply in class AbstractComplexMatrixv - a Complex vector
IllegalDimensionException - If the matrix and vector are
incompatible.public AbstractComplexMatrix multiply(AbstractComplexMatrix m)
multiply in class AbstractComplexMatrixm - a Complex matrix
IllegalDimensionException - If the matrices are incompatible.public AbstractComplexMatrix multiply(ComplexMatrix m)
m - DOCUMENT ME!
public AbstractComplexMatrix multiply(ComplexSparseMatrix m)
m - a Complex sparse matrix
IllegalDimensionException - If the matrices are incompatible.public Matrix transpose()
transpose in interface Matrixtranspose in class AbstractComplexMatrixpublic AbstractComplexMatrix mapElements(ComplexMapping f)
mapElements in class AbstractComplexMatrixf - a user-defined function
public java.lang.Object clone()
clone in class java.lang.Objectpublic Complex[][] toPrimitiveArray()
toPrimitiveArray in class AbstractComplexMatrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||