JSci.maths.matrices
Class AbstractComplexSquareMatrix

java.lang.Object
  extended byJSci.maths.matrices.Matrix
      extended byJSci.maths.matrices.AbstractComplexMatrix
          extended byJSci.maths.matrices.AbstractComplexSquareMatrix
All Implemented Interfaces:
AbelianGroup.Member, Algebra.Member, BanachSpace.Member, CStarAlgebra.Member, Member, Module.Member, Ring.Member, java.io.Serializable, SquareMatrix, VectorSpace.Member
Direct Known Subclasses:
ComplexDiagonalMatrix, ComplexSquareMatrix, ComplexTridiagonalMatrix

public abstract class AbstractComplexSquareMatrix
extends AbstractComplexMatrix
implements CStarAlgebra.Member, SquareMatrix

The AbstractComplexSquareMatrix class provides an object for encapsulating square matrices containing complex numbers.

See Also:
Serialized Form

Field Summary
protected  AbstractComplexSquareMatrix[] LU
           
protected  int[] LUpivot
           
 
Fields inherited from class JSci.maths.matrices.Matrix
numCols, numRows
 
Constructor Summary
protected AbstractComplexSquareMatrix(int size)
          Constructs a matrix.
 
Method Summary
 AbstractComplexMatrix add(AbstractComplexMatrix m)
          Returns the addition of this matrix and another.
 AbstractComplexSquareMatrix add(AbstractComplexSquareMatrix m)
          Returns the addition of this matrix and another.
 AbstractComplexMatrix conjugate()
          Returns the complex conjugate of this matrix.
 Complex det()
          Returns the determinant.
 AbstractComplexSquareMatrix directSum(AbstractComplexSquareMatrix m)
          Returns the direct sum of this matrix and another.
 AbstractComplexMatrix hermitianAdjoint()
          Returns the hermitian adjoint of this matrix.
 AbstractDoubleMatrix imag()
          Returns the imaginary part of this complex matrix.
 AbstractComplexSquareMatrix inverse()
          Returns the inverse of this matrix.
 CStarAlgebra.Member involution()
          Returns the involution of this matrix.
 boolean isHermitian()
          Returns true if this matrix is hermitian.
 boolean isUnitary()
          Returns true if this matrix is unitary.
 AbstractComplexSquareMatrix[] luDecompose(int[] pivot)
          Returns the LU decomposition of this matrix.
 AbstractComplexMatrix mapElements(ComplexMapping f)
          Applies a function on all the matrix elements.
 AbstractComplexSquareMatrix multiply(AbstractComplexSquareMatrix m)
          Returns the multiplication of this matrix and another.
 AbelianGroup.Member negate()
          Returns the negative of this matrix.
 double norm()
          Returns the C* norm.
 double operatorNorm()
          Returns the operator norm.
 AbstractComplexSquareMatrix[] polarDecompose()
          Returns the polar decomposition 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.
 Complex scalarProduct(AbstractComplexMatrix m)
          Returns the scalar product of this matrix and another.
 Complex scalarProduct(AbstractComplexSquareMatrix m)
          Returns the scalar product of this matrix and another.
 AbstractComplexMatrix subtract(AbstractComplexMatrix m)
          Returns the subtraction of this matrix and another.
 AbstractComplexSquareMatrix subtract(AbstractComplexSquareMatrix m)
          Returns the subtraction of this matrix by another.
 AbstractComplexSquareMatrix tensor(AbstractComplexSquareMatrix m)
          Returns the tensor product of this matrix and another.
 Complex trace()
          Returns the trace.
 Matrix transpose()
          Returns the transpose of this matrix.
 
Methods inherited from class JSci.maths.matrices.AbstractComplexMatrix
add, directSum, equals, equals, frobeniusNorm, getElement, getImagElement, getRealElement, hashCode, infNorm, multiply, multiply, multiply, scalarDivide, scalarMultiply, setElement, setElement, subtract, tensor, toString
 
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
 
Methods inherited from interface JSci.maths.algebras.VectorSpace.Member
scalarDivide
 
Methods inherited from interface JSci.maths.algebras.Module.Member
scalarMultiply
 
Methods inherited from interface JSci.maths.groups.AbelianGroup.Member
add, subtract
 
Methods inherited from interface JSci.maths.fields.Ring.Member
multiply
 

Field Detail

LU

protected transient AbstractComplexSquareMatrix[] LU

LUpivot

protected transient int[] LUpivot
Constructor Detail

AbstractComplexSquareMatrix

protected AbstractComplexSquareMatrix(int size)
Constructs a matrix.

Method Detail

real

public AbstractDoubleMatrix real()
Returns the real part of this complex matrix.

Overrides:
real in class AbstractComplexMatrix
Returns:
a double matrix

imag

public AbstractDoubleMatrix imag()
Returns the imaginary part of this complex matrix.

Overrides:
imag in class AbstractComplexMatrix
Returns:
a double matrix

isHermitian

public boolean isHermitian()
Returns true if this matrix is hermitian.


isUnitary

public boolean isUnitary()
Returns true if this matrix is unitary.


det

public Complex det()
Returns the determinant.


trace

public Complex trace()
Returns the trace.


norm

public double norm()
Returns the C* norm.

Specified by:
norm in interface BanachSpace.Member

operatorNorm

public double operatorNorm()
                    throws MaximumIterationsExceededException
Returns the operator norm.

Throws:
MaximumIterationsExceededException - If it takes more than 50 iterations to determine an eigenvalue.

negate

public AbelianGroup.Member negate()
Returns the negative of this matrix.

Specified by:
negate in interface AbelianGroup.Member
Overrides:
negate in class AbstractComplexMatrix

add

public final AbstractComplexMatrix add(AbstractComplexMatrix m)
Returns the addition of this matrix and another.

Overrides:
add in class AbstractComplexMatrix
Parameters:
m - a complex square matrix
Throws:
MatrixDimensionException - If the matrices are not square or different sizes.

add

public AbstractComplexSquareMatrix add(AbstractComplexSquareMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - a complex square matrix
Throws:
MatrixDimensionException - If the matrices are different sizes.

subtract

public final AbstractComplexMatrix subtract(AbstractComplexMatrix m)
Returns the subtraction of this matrix and another.

Overrides:
subtract in class AbstractComplexMatrix
Parameters:
m - a complex square matrix
Throws:
MatrixDimensionException - If the matrices are not square or different sizes.

subtract

public AbstractComplexSquareMatrix subtract(AbstractComplexSquareMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - a complex square matrix
Throws:
MatrixDimensionException - If the matrices are different sizes.

scalarMultiply

public AbstractComplexMatrix scalarMultiply(Complex z)
Returns the multiplication of this matrix by a scalar.

Overrides:
scalarMultiply in class AbstractComplexMatrix
Parameters:
z - a complex number
Returns:
a complex square matrix

scalarMultiply

public AbstractComplexMatrix scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.

Overrides:
scalarMultiply in class AbstractComplexMatrix
Parameters:
x - a double
Returns:
a complex square matrix

scalarDivide

public AbstractComplexMatrix scalarDivide(Complex z)
Returns the division of this matrix by a scalar.

Overrides:
scalarDivide in class AbstractComplexMatrix
Parameters:
z - a complex number
Returns:
a complex square matrix

scalarDivide

public AbstractComplexMatrix scalarDivide(double x)
Returns the division of this matrix by a scalar.

Overrides:
scalarDivide in class AbstractComplexMatrix
Parameters:
x - a double
Returns:
a complex square matrix

scalarProduct

public final Complex scalarProduct(AbstractComplexMatrix m)
Returns the scalar product of this matrix and another.

Overrides:
scalarProduct in class AbstractComplexMatrix
Parameters:
m - a Complex square matrix.
Throws:
MatrixDimensionException - If the matrices are not square or different sizes.

scalarProduct

public Complex scalarProduct(AbstractComplexSquareMatrix m)
Returns the scalar product of this matrix and another.

Parameters:
m - a complex square matrix.
Throws:
MatrixDimensionException - If the matrices are different sizes.

multiply

public AbstractComplexSquareMatrix multiply(AbstractComplexSquareMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - a complex square matrix
Returns:
an AbstractComplexMatrix or an AbstractComplexSquareMatrix as appropriate
Throws:
MatrixDimensionException - If the matrices are incompatible.

directSum

public AbstractComplexSquareMatrix directSum(AbstractComplexSquareMatrix m)
Returns the direct sum of this matrix and another.


tensor

public AbstractComplexSquareMatrix tensor(AbstractComplexSquareMatrix m)
Returns the tensor product of this matrix and another.


involution

public final CStarAlgebra.Member involution()
Returns the involution of this matrix.

Specified by:
involution in interface CStarAlgebra.Member

hermitianAdjoint

public AbstractComplexMatrix hermitianAdjoint()
Returns the hermitian adjoint of this matrix.

Overrides:
hermitianAdjoint in class AbstractComplexMatrix
Returns:
a complex square matrix

conjugate

public AbstractComplexMatrix conjugate()
Returns the complex conjugate of this matrix.

Overrides:
conjugate in class AbstractComplexMatrix
Returns:
a complex square matrix

transpose

public Matrix transpose()
Returns the transpose of this matrix.

Overrides:
transpose in class AbstractComplexMatrix
Returns:
a complex square matrix

inverse

public AbstractComplexSquareMatrix inverse()
Returns the inverse of this matrix.

Returns:
a complex square matrix

luDecompose

public AbstractComplexSquareMatrix[] luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.

Returns:
an array with [0] containing the L-matrix and [1] containing the U-matrix.

polarDecompose

public AbstractComplexSquareMatrix[] polarDecompose()
Returns the polar decomposition of this matrix.


mapElements

public AbstractComplexMatrix mapElements(ComplexMapping f)
Applies a function on all the matrix elements.

Overrides:
mapElements in class AbstractComplexMatrix
Parameters:
f - a user-defined function
Returns:
a complex square matrix