|
|||||||||
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.AbstractComplexMatrix JSci.maths.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. |
Fields inherited from class JSci.maths.matrices.Matrix |
---|
numCols, numRows |
Constructor Summary | |
---|---|
ComplexMatrix(Complex[][] array)
Constructs a matrix from an array. |
|
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)
|
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. |
Complex |
getElement(int i,
int j)
Returns an element of the matrix. |
double |
getImagElement(int i,
int j)
Returns the imag part of an element of the matrix. |
double |
getRealElement(int i,
int j)
Returns the real part of an element of the matrix. |
int |
hashCode()
Returns a hashcode for this matrix. |
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 |
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 |
tensor(AbstractComplexMatrix m)
Returns the tensor product of this matrix and another. |
java.lang.String |
toString()
Returns a string representing this matrix. |
Matrix |
transpose()
Returns the transpose of this matrix. |
Methods inherited from class JSci.maths.matrices.AbstractComplexMatrix |
---|
add, equals, equals, getSet, multiply, scalarDivide, scalarMultiply, scalarProduct, subtract |
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 double[][] matrixRe
protected double[][] matrixIm
Constructor Detail |
---|
public ComplexMatrix(int rows, int cols)
rows
- the number of rowscols
- the number of columnspublic 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 valueMethod Detail |
---|
public boolean equals(AbstractComplexMatrix m, double tol)
equals
in class AbstractComplexMatrix
m
- a complex matrixpublic java.lang.String toString()
toString
in class AbstractComplexMatrix
public int hashCode()
hashCode
in class AbstractComplexMatrix
public AbstractDoubleMatrix real()
real
in class AbstractComplexMatrix
public AbstractDoubleMatrix imag()
imag
in class AbstractComplexMatrix
public Complex getElement(int i, int j)
getElement
in class AbstractComplexMatrix
i
- row index of the elementj
- column index of the element
MatrixDimensionException
- If attempting to access an invalid element.public double getRealElement(int i, int j)
AbstractComplexMatrix
getRealElement
in class AbstractComplexMatrix
i
- row index of the elementj
- column index of the elementpublic double getImagElement(int i, int j)
AbstractComplexMatrix
getImagElement
in class AbstractComplexMatrix
i
- row index of the elementj
- column index of the elementpublic void setElement(int i, int j, Complex z)
setElement
in class AbstractComplexMatrix
i
- row index of the elementj
- column index of the elementz
- a complex number
MatrixDimensionException
- If attempting to access an invalid element.public void setElement(int i, int j, double x, double y)
setElement
in class AbstractComplexMatrix
i
- row index of the elementj
- column index of the elementx
- the real part of a complex numbery
- the imaginary part of a complex number
MatrixDimensionException
- If attempting to access an invalid element.public double infNorm()
infNorm
in class AbstractComplexMatrix
public double frobeniusNorm()
frobeniusNorm
in class AbstractComplexMatrix
public AbelianGroup.Member negate()
negate
in interface AbelianGroup.Member
negate
in class AbstractComplexMatrix
public AbstractComplexMatrix add(AbstractComplexMatrix m)
add
in class AbstractComplexMatrix
m
- a complex matrix
MatrixDimensionException
- If the matrices are different sizes.public ComplexMatrix add(ComplexMatrix m)
public AbstractComplexMatrix subtract(AbstractComplexMatrix m)
subtract
in class AbstractComplexMatrix
m
- a complex matrix
MatrixDimensionException
- If the matrices are different sizes.public ComplexMatrix subtract(ComplexMatrix m)
public AbstractComplexMatrix scalarMultiply(Complex z)
scalarMultiply
in class AbstractComplexMatrix
z
- a complex number
public AbstractComplexMatrix scalarMultiply(double x)
scalarMultiply
in class AbstractComplexMatrix
x
- a double
public AbstractComplexMatrix scalarDivide(Complex z)
scalarDivide
in class AbstractComplexMatrix
z
- a complex number
public AbstractComplexMatrix scalarDivide(double x)
scalarDivide
in class AbstractComplexMatrix
x
- a double
public AbstractComplexVector multiply(AbstractComplexVector v)
multiply
in class AbstractComplexMatrix
v
- a complex vector
DimensionException
- If the matrix and vector are incompatible.public AbstractComplexMatrix multiply(AbstractComplexMatrix m)
multiply
in class AbstractComplexMatrix
m
- a complex matrix
MatrixDimensionException
- If the matrices are incompatible.public AbstractComplexMatrix multiply(ComplexMatrix m)
public AbstractComplexMatrix directSum(AbstractComplexMatrix m)
directSum
in class AbstractComplexMatrix
public AbstractComplexMatrix tensor(AbstractComplexMatrix m)
tensor
in class AbstractComplexMatrix
public AbstractComplexMatrix hermitianAdjoint()
hermitianAdjoint
in class AbstractComplexMatrix
public AbstractComplexMatrix conjugate()
conjugate
in class AbstractComplexMatrix
public Matrix transpose()
transpose
in class AbstractComplexMatrix
public AbstractComplexMatrix mapElements(ComplexMapping f)
mapElements
in class AbstractComplexMatrix
f
- a user-defined function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |