org.jscience.mathematics.algebraic.matrices
Class AbstractComplexSquareMatrix

java.lang.Object
  extended by org.jscience.mathematics.algebraic.AbstractHypermatrix
      extended by org.jscience.mathematics.algebraic.AbstractMatrix
          extended by org.jscience.mathematics.algebraic.matrices.AbstractComplexMatrix
              extended by org.jscience.mathematics.algebraic.matrices.AbstractComplexSquareMatrix
All Implemented Interfaces:
java.io.Serializable, Algebra.Member, BanachSpace.Member, CStarAlgebra.Member, Ring.Member, AbelianGroup.Member, Hypermatrix, Matrix, Module.Member, VectorSpace.Member, SquareMatrix, Member
Direct Known Subclasses:
ComplexDiagonalMatrix, ComplexSparseSquareMatrix, 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
           
 
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 isSymmetric()
          Returns true if this matrix is symmetric.
 boolean isUnitary()
          Returns true if this matrix is unitary.
 AbstractComplexSquareMatrix[] luDecompose(int[] pivot)
          Returns the LU decomposition of this matrix.
 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 tensorProduct(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 org.jscience.mathematics.algebraic.matrices.AbstractComplexMatrix
abs, add, directSum, equals, equals, equals, frobeniusNorm, getColumn, getElement, getImagElement, getMatrixAsColumns, getMatrixAsRows, getPrimitiveElement, getRealElement, getRow, getSet, getSubMatrix, hashCode, horizontalAxisSymmetry, infNorm, mapElements, mass, multiply, multiply, multiply, read, reverse, scalarDivide, scalarMultiply, setAllElements, setColumn, setElement, setElement, setRow, setSubMatrix, subtract, tensorProduct, toPrimitiveArray, toString, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jscience.mathematics.algebraic.fields.Ring.Member
multiply
 
Methods inherited from interface org.jscience.mathematics.algebraic.modules.VectorSpace.Member
scalarDivide
 
Methods inherited from interface org.jscience.mathematics.algebraic.modules.Module.Member
scalarMultiply
 
Methods inherited from interface org.jscience.mathematics.algebraic.Matrix
getColumn, getElement, getRow, numColumns, numRows, toArray
 
Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix
getDimensions, getElement, numDimensions, numElements, numElements, toArray, toArray
 

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

isSymmetric

public boolean isSymmetric()
Returns true if this matrix is symmetric.

Specified by:
isSymmetric in interface SquareMatrix
Returns:
DOCUMENT ME!

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
Returns:
DOCUMENT ME!

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
Returns:
DOCUMENT ME!

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:
IllegalDimensionException - 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:
IllegalDimensionException - 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:
IllegalDimensionException - 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:
IllegalDimensionException - 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:
IllegalDimensionException - 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:
IllegalDimensionException - 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:
IllegalDimensionException - If the matrices are incompatible.

directSum

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


tensorProduct

public AbstractComplexSquareMatrix tensorProduct(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
Returns:
DOCUMENT ME!

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.

Specified by:
transpose in interface 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.