|
|||||||||
| 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.ComplexMatrix
public class ComplexMatrix
The ComplexMatrix class provides an object for encapsulating matrices containing complex numbers.
| Field Summary | |
|---|---|
protected double[][] |
matrixIm
Arrays containing the elements of the matrix. |
protected double[][] |
matrixRe
Arrays containing the elements of the matrix. |
| Constructor Summary | |
|---|---|
ComplexMatrix(Complex[][] array)
Constructs a matrix from an array. |
|
ComplexMatrix(ComplexMatrix mat)
Copy constructor. |
|
ComplexMatrix(ComplexVector[] array)
Constructs a matrix from an array of vectors (columns). |
|
ComplexMatrix(double[][] arrayRe,
double[][] arrayIm)
Constructs a matrix by wrapping two arrays. |
|
ComplexMatrix(int rows,
int cols)
Constructs an empty matrix. |
|
| Method Summary | |
|---|---|
AbstractComplexMatrix |
add(AbstractComplexMatrix m)
Returns the addition of this matrix and another. |
ComplexMatrix |
add(ComplexMatrix m)
|
java.lang.Object |
clone()
Clone matrix into a new matrix. |
AbstractComplexMatrix |
conjugate()
Returns the complex conjugate of this matrix. |
AbstractComplexMatrix |
directSum(AbstractComplexMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(AbstractComplexMatrix m,
double tol)
Compares two complex matrices for equality. |
double |
frobeniusNorm()
Returns the Frobenius or Hilbert-Schmidt (l2) norm. |
AbstractComplexVector |
getColumn(int j)
Returns the ith column. |
double |
getImagElement(int i,
int j)
Returns the imag part of an element of the matrix. |
Complex |
getPrimitiveElement(int i,
int j)
Returns an element of the matrix. |
double |
getRealElement(int i,
int j)
Returns the real part of an element of the matrix. |
AbstractComplexVector |
getRow(int i)
Returns the ith row. |
AbstractComplexMatrix |
hermitianAdjoint()
Returns the hermitian adjoint of this matrix. |
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)
|
AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
AbstractDoubleMatrix |
real()
Returns the real part of this complex matrix. |
AbstractComplexMatrix |
scalarDivide(Complex z)
Returns the division of this matrix by a scalar. |
AbstractComplexMatrix |
scalarDivide(double x)
Returns the division of this matrix by a scalar. |
AbstractComplexMatrix |
scalarMultiply(Complex z)
Returns the multiplication of this matrix by a scalar. |
AbstractComplexMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar. |
void |
setAllElements(Complex m)
Sets the value of all elements of the matrix. |
void |
setElement(int i,
int j,
Complex z)
Sets the value of an element of the matrix. |
void |
setElement(int i,
int j,
double x,
double y)
Sets the value of an element of the matrix. |
AbstractComplexMatrix |
subtract(AbstractComplexMatrix m)
Returns the subtraction of this matrix by another. |
ComplexMatrix |
subtract(ComplexMatrix m)
|
AbstractComplexMatrix |
tensorProduct(AbstractComplexMatrix m)
Returns the tensor product 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, equals, equals, getElement, getMatrixAsColumns, getMatrixAsRows, getSet, getSubMatrix, hashCode, horizontalAxisSymmetry, mass, multiply, read, reverse, scalarDivide, scalarMultiply, scalarProduct, setColumn, setRow, setSubMatrix, subtract, 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 |
| Field Detail |
|---|
protected double[][] matrixRe
protected double[][] matrixIm
| Constructor Detail |
|---|
public ComplexMatrix(int rows,
int cols)
rows - the number of rowscols - the number of columns
public ComplexMatrix(double[][] arrayRe,
double[][] arrayIm)
arrayRe - an array of real valuesarrayIm - an array of imaginary valuespublic ComplexMatrix(Complex[][] array)
array - an assigned valuepublic ComplexMatrix(ComplexVector[] array)
array - an assigned valuepublic ComplexMatrix(ComplexMatrix mat)
mat - an assigned value| Method Detail |
|---|
public boolean equals(AbstractComplexMatrix m,
double tol)
equals in class AbstractComplexMatrixm - a complex matrixpublic 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)
AbstractComplexMatrix
getRealElement in class AbstractComplexMatrixi - row index of the elementj - column index of the element
public double getImagElement(int i,
int j)
AbstractComplexMatrix
getImagElement in class AbstractComplexMatrixi - row index of the elementj - column index of the elementpublic AbstractComplexVector getRow(int i)
getRow in interface MatrixgetRow in class AbstractComplexMatrixi - DOCUMENT ME!
public AbstractComplexVector getColumn(int j)
getColumn in interface MatrixgetColumn in class AbstractComplexMatrixj - DOCUMENT ME!
public void setElement(int i,
int j,
Complex z)
setElement in class AbstractComplexMatrixi - row index of the elementj - column index of the elementz - a complex number
IllegalDimensionException - If attempting to access an invalid element.
public void setElement(int i,
int j,
double x,
double y)
setElement in class AbstractComplexMatrixi - row index of the elementj - column index of the elementx - the real part of a complex numbery - the imaginary part of a complex 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 AbstractComplexMatrixpublic double frobeniusNorm()
frobeniusNorm in class AbstractComplexMatrixpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Membernegate in class AbstractComplexMatrixpublic AbstractComplexMatrix add(AbstractComplexMatrix m)
add in class AbstractComplexMatrixm - a complex matrix
IllegalDimensionException - If the matrices are different sizes.public ComplexMatrix add(ComplexMatrix m)
public AbstractComplexMatrix subtract(AbstractComplexMatrix m)
subtract in class AbstractComplexMatrixm - a complex matrix
IllegalDimensionException - If the matrices are different sizes.public ComplexMatrix subtract(ComplexMatrix m)
public AbstractComplexMatrix scalarMultiply(Complex z)
scalarMultiply in class AbstractComplexMatrixz - a complex number
public AbstractComplexMatrix scalarMultiply(double x)
scalarMultiply in class AbstractComplexMatrixx - a double
public AbstractComplexMatrix scalarDivide(Complex z)
scalarDivide in class AbstractComplexMatrixz - a complex number
public AbstractComplexMatrix scalarDivide(double x)
scalarDivide in class AbstractComplexMatrixx - a double
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)
public AbstractComplexMatrix directSum(AbstractComplexMatrix m)
directSum in class AbstractComplexMatrixpublic AbstractComplexMatrix tensorProduct(AbstractComplexMatrix m)
tensorProduct in class AbstractComplexMatrixpublic AbstractComplexMatrix hermitianAdjoint()
hermitianAdjoint in class AbstractComplexMatrixpublic AbstractComplexMatrix conjugate()
conjugate in class AbstractComplexMatrixpublic 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 | ||||||||