|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSci.maths.Matrix
JSci.maths.ComplexMatrix
public class ComplexMatrix
The ComplexMatrix class provides an object for encapsulating matrices containing complex numbers.
Field Summary | |
---|---|
protected static int |
ARRAY_2D
Storage format identifier. |
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.Matrix |
---|
CLASS_SPECIFIC, numCols, numRows, storageFormat |
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. |
protected |
ComplexMatrix(int rows,
int cols,
int storeID)
Constructs a matrix. |
Method Summary | |
---|---|
AbelianGroup.Member |
add(AbelianGroup.Member m)
Returns the addition of this matrix and another. |
ComplexMatrix |
add(ComplexMatrix m)
Returns the addition of this matrix and another. |
ComplexMatrix |
conjugate()
Returns the complex conjugate of this matrix. |
ComplexMatrix |
directSum(ComplexMatrix m)
Returns the direct sum of this matrix and another. |
boolean |
equals(java.lang.Object m)
Compares two complex matrices for equality. |
protected void |
finalize()
Finalize. |
double |
frobeniusNorm()
Returns the Frobenius (l2) norm. |
Complex |
getElement(int i,
int j)
Returns an element of the matrix. |
int |
hashCode()
Returns a hashcode for this matrix. |
ComplexMatrix |
hermitianAdjoint()
Returns the hermitian adjoint of this matrix. |
DoubleMatrix |
imag()
Returns the imaginary part of this complex matrix. |
double |
infNorm()
Returns the l ![]() |
ComplexMatrix |
mapElements(ComplexMapping f)
Applies a function on all the matrix elements. |
ComplexMatrix |
multiply(ComplexMatrix m)
Returns the multiplication of this matrix and another. |
ComplexVector |
multiply(ComplexVector v)
Returns the multiplication of a vector by this matrix. |
Ring.Member |
multiply(Ring.Member m)
Returns the multiplication of this matrix and another. |
AbelianGroup.Member |
negate()
Returns the negative of this matrix. |
DoubleMatrix |
real()
Returns the real part of this complex matrix. |
ComplexMatrix |
scalarDivide(Complex z)
Returns the division of this matrix by a scalar. |
ComplexMatrix |
scalarDivide(double x)
Returns the division of this matrix by a scalar. |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this matrix by a scalar. |
ComplexMatrix |
scalarMultiply(Complex z)
Returns the multiplication of this matrix by a scalar. |
ComplexMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar. |
Module.Member |
scalarMultiply(Ring.Member 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. |
AbelianGroup.Member |
subtract(AbelianGroup.Member m)
Returns the subtraction of this matrix by another. |
ComplexMatrix |
subtract(ComplexMatrix m)
Returns the subtraction of this matrix by another. |
ComplexMatrix |
tensorProduct(ComplexMatrix 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.Matrix |
---|
columns, getInvalidElementMsg, rows |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int ARRAY_2D
protected double[][] matrixRe
protected double[][] matrixIm
Constructor Detail |
---|
protected ComplexMatrix(int rows, int cols, int storeID)
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 |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Any that occur.public boolean equals(java.lang.Object m)
equals
in class java.lang.Object
m
- a complex matrixpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public DoubleMatrix real()
public DoubleMatrix imag()
public Complex getElement(int i, int j)
i
- row index of the elementj
- column index of the element
MatrixDimensionException
- If attempting to access an invalid element.public void setElement(int i, int j, Complex z)
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)
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()
public double frobeniusNorm()
public AbelianGroup.Member negate()
public AbelianGroup.Member add(AbelianGroup.Member m)
m
- a group memberpublic ComplexMatrix add(ComplexMatrix m)
m
- a complex matrix
MatrixDimensionException
- If the matrices are different sizes.public AbelianGroup.Member subtract(AbelianGroup.Member m)
m
- a group memberpublic ComplexMatrix subtract(ComplexMatrix m)
m
- a complex matrix
MatrixDimensionException
- If the matrices are different sizes.public Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic ComplexMatrix scalarMultiply(Complex z)
z
- a complex number
public ComplexMatrix scalarMultiply(double x)
x
- a double
public VectorSpace.Member scalarDivide(Field.Member x)
x
- a field memberpublic ComplexMatrix scalarDivide(Complex z)
z
- a complex number
public ComplexMatrix scalarDivide(double x)
x
- a double
public ComplexVector multiply(ComplexVector v)
v
- a complex vector
DimensionException
- If the matrix and vector are incompatible.public Ring.Member multiply(Ring.Member m)
m
- a ring memberpublic ComplexMatrix multiply(ComplexMatrix m)
m
- a complex matrix
MatrixDimensionException
- If the matrices are incompatible.public ComplexMatrix directSum(ComplexMatrix m)
public ComplexMatrix tensorProduct(ComplexMatrix m)
public ComplexMatrix hermitianAdjoint()
public ComplexMatrix conjugate()
public Matrix transpose()
transpose
in class Matrix
public ComplexMatrix mapElements(ComplexMapping f)
f
- a user-defined function
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |