All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.ComplexDiagonalMatrix

java.lang.Object
   |
   +----JSci.maths.Matrix
           |
           +----JSci.maths.ComplexMatrix
                   |
                   +----JSci.maths.ComplexSquareMatrix
                           |
                           +----JSci.maths.ComplexTridiagonalMatrix
                                   |
                                   +----JSci.maths.ComplexDiagonalMatrix

public final class ComplexDiagonalMatrix
extends ComplexTridiagonalMatrix
The ComplexDiagonalMatrix class provides an object for encapsulating diagonal matrices containing complex numbers. Uses compressed diagonal storage.


Variable Index

 o DIAGONAL
Storage format identifier.
 o storageFormat

Constructor Index

 o ComplexDiagonalMatrix()
Constructs a matrix.
 o ComplexDiagonalMatrix(Complex[])
Constructs a matrix by wrapping an array containing the diagonal elements.
 o ComplexDiagonalMatrix(Complex[][])
Constructs a matrix from an array.
 o ComplexDiagonalMatrix(int)
Constructs an empty matrix.

Method Index

 o add(ComplexDiagonalMatrix)
Returns the addition of this matrix and another.
 o add(ComplexMatrix)
Returns the addition of this matrix and another.
 o add(ComplexSquareMatrix)
Returns the addition of this matrix and another.
 o add(ComplexTridiagonalMatrix)
Returns the addition of this matrix and another.
 o columns()
Returns the number of columns.
 o conjugate()
Returns the complex conjugate of this matrix.
 o det()
Returns the determinant.
 o equals(Object)
Compares two complex diagonal matrices for equality.
 o frobeniusNorm()
Returns the Frobenius norm.
 o getElement(int, int)
Returns an element of the matrix.
 o identity(int)
Creates an identity matrix.
 o imag()
Returns the imaginary part of this complex matrix.
 o infNorm()
Returns the l(infinity)-norm.
 o inverse()
Returns the inverse of this matrix.
 o isHermitian()
Returns true if this matrix is hermitian.
 o isUnitary()
Returns true if this matrix is unitary.
 o luDecompose()
Returns the LU decomposition of this matrix.
 o mapElements(Mapping)
Applies a function on all the matrix elements.
 o multiply(ComplexDiagonalMatrix)
Returns the multiplication of this matrix and another.
 o multiply(ComplexMatrix)
Returns the multiplication of this matrix and another.
 o multiply(ComplexSquareMatrix)
Returns the multiplication of this matrix and another.
 o multiply(ComplexTridiagonalMatrix)
Returns the multiplication of this matrix and another.
 o multiply(ComplexVector)
Returns the multiplication of a vector by this matrix.
 o multiply(Matrix)
Returns the multiplication of this matrix and another.
 o real()
Returns the real part of this complex matrix.
 o rows()
Returns the number of rows.
 o scalarMultiply(Complex)
Returns the multiplication of this matrix by a scalar.
 o scalarMultiply(double)
Returns the multiplication of this matrix by a scalar.
 o setElement(int, int, Complex)
Sets the value of an element of the matrix.
 o subtract(ComplexDiagonalMatrix)
Returns the subtraction of this matrix by another.
 o subtract(ComplexMatrix)
Returns the subtraction of this matrix by another.
 o subtract(ComplexSquareMatrix)
Returns the subtraction of this matrix by another.
 o subtract(ComplexTridiagonalMatrix)
Returns the subtraction of this matrix by another.
 o subtract(Matrix)
Returns the subtraction of this matrix by another.
 o trace()
Returns the trace.
 o transpose()
Returns the transpose of this matrix.

Variables

 o DIAGONAL
 protected static final int DIAGONAL
Storage format identifier.

 o storageFormat
 protected static final int storageFormat

Constructors

 o ComplexDiagonalMatrix
 protected ComplexDiagonalMatrix()
Constructs a matrix.

 o ComplexDiagonalMatrix
 public ComplexDiagonalMatrix(int size)
Constructs an empty matrix.

Parameters:
size - the number of rows/columns
 o ComplexDiagonalMatrix
 public ComplexDiagonalMatrix(Complex array[][])
Constructs a matrix from an array.

Parameters:
array - an assigned value
Throws: MatrixDimensionException
If the array is not square.
 o ComplexDiagonalMatrix
 public ComplexDiagonalMatrix(Complex array[])
Constructs a matrix by wrapping an array containing the diagonal elements.

Parameters:
array - an assigned value

Methods

 o identity
 public static ComplexDiagonalMatrix identity(int size)
Creates an identity matrix.

Parameters:
size - the number of rows/columns
 o equals
 public boolean equals(Object m)
Compares two complex diagonal matrices for equality.

Parameters:
m - a complex diagonal matrix
Overrides:
equals in class ComplexTridiagonalMatrix
 o real
 public DoubleMatrix real()
Returns the real part of this complex matrix.

Returns:
a double diagonal matrix
Overrides:
real in class ComplexTridiagonalMatrix
 o imag
 public DoubleMatrix imag()
Returns the imaginary part of this complex matrix.

Returns:
a double diagonal matrix
Overrides:
imag in class ComplexTridiagonalMatrix
 o getElement
 public Complex getElement(int i,
                           int j)
Returns an element of the matrix.

Parameters:
i - row index of the element
j - column index of the element
Throws: MatrixDimensionException
If attempting to access an invalid element.
Overrides:
getElement in class ComplexTridiagonalMatrix
 o setElement
 public void setElement(int i,
                        int j,
                        Complex z)
Sets the value of an element of the matrix.

Parameters:
i - row index of the element
j - column index of the element
z - a complex number
Throws: MatrixDimensionException
If attempting to access an invalid element.
Overrides:
setElement in class ComplexTridiagonalMatrix
 o isHermitian
 public boolean isHermitian()
Returns true if this matrix is hermitian.

Overrides:
isHermitian in class ComplexSquareMatrix
 o isUnitary
 public boolean isUnitary()
Returns true if this matrix is unitary.

Overrides:
isUnitary in class ComplexSquareMatrix
 o det
 public Complex det()
Returns the determinant.

Overrides:
det in class ComplexSquareMatrix
 o trace
 public Complex trace()
Returns the trace.

Overrides:
trace in class ComplexTridiagonalMatrix
 o infNorm
 public double infNorm()
Returns the l(infinity)-norm.

Overrides:
infNorm in class ComplexTridiagonalMatrix
 o frobeniusNorm
 public double frobeniusNorm()
Returns the Frobenius norm.

Overrides:
frobeniusNorm in class ComplexTridiagonalMatrix
 o rows
 public int rows()
Returns the number of rows.

Overrides:
rows in class ComplexTridiagonalMatrix
 o columns
 public int columns()
Returns the number of columns.

Overrides:
columns in class ComplexTridiagonalMatrix
 o add
 public ComplexMatrix add(ComplexMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - a complex matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
add in class ComplexTridiagonalMatrix
 o add
 public ComplexSquareMatrix add(ComplexSquareMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - a complex square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
add in class ComplexTridiagonalMatrix
 o add
 public ComplexTridiagonalMatrix add(ComplexTridiagonalMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - a complex tridiagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
add in class ComplexTridiagonalMatrix
 o add
 public ComplexDiagonalMatrix add(ComplexDiagonalMatrix m)
Returns the addition of this matrix and another.

Parameters:
m - a complex diagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o subtract
 public Matrix subtract(Matrix m)
Returns the subtraction of this matrix by another.

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

Parameters:
m - a complex matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
subtract in class ComplexTridiagonalMatrix
 o subtract
 public ComplexSquareMatrix subtract(ComplexSquareMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - a complex square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
subtract in class ComplexTridiagonalMatrix
 o subtract
 public ComplexTridiagonalMatrix subtract(ComplexTridiagonalMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - a complex tridiagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
subtract in class ComplexTridiagonalMatrix
 o subtract
 public ComplexDiagonalMatrix subtract(ComplexDiagonalMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - a complex diagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o scalarMultiply
 public ComplexMatrix scalarMultiply(Complex z)
Returns the multiplication of this matrix by a scalar.

Parameters:
z - a complex number
Returns:
a complex diagonal matrix
Overrides:
scalarMultiply in class ComplexTridiagonalMatrix
 o scalarMultiply
 public ComplexMatrix scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.

Parameters:
x - a double
Returns:
a complex diagonal matrix
Overrides:
scalarMultiply in class ComplexTridiagonalMatrix
 o multiply
 public ComplexVector multiply(ComplexVector v)
Returns the multiplication of a vector by this matrix.

Parameters:
v - a complex vector
Throws: DimensionException
If the matrix and vector are incompatible.
Overrides:
multiply in class ComplexTridiagonalMatrix
 o multiply
 public Matrix multiply(Matrix m)
Returns the multiplication of this matrix and another.

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

Parameters:
m - a complex matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
multiply in class ComplexTridiagonalMatrix
 o multiply
 public ComplexSquareMatrix multiply(ComplexSquareMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - a complex square matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
multiply in class ComplexTridiagonalMatrix
 o multiply
 public ComplexSquareMatrix multiply(ComplexTridiagonalMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - a complex tridiagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
multiply in class ComplexTridiagonalMatrix
 o multiply
 public ComplexDiagonalMatrix multiply(ComplexDiagonalMatrix m)
Returns the multiplication of this matrix and another.

Parameters:
m - a complex diagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o inverse
 public ComplexSquareMatrix inverse()
Returns the inverse of this matrix.

Returns:
a complex diagonal matrix
Overrides:
inverse in class ComplexSquareMatrix
 o conjugate
 public ComplexMatrix conjugate()
Returns the complex conjugate of this matrix.

Returns:
a complex diagonal matrix
Overrides:
conjugate in class ComplexTridiagonalMatrix
 o transpose
 public Matrix transpose()
Returns the transpose of this matrix.

Returns:
a complex diagonal matrix
Overrides:
transpose in class ComplexTridiagonalMatrix
 o luDecompose
 public ComplexSquareMatrix[] luDecompose()
Returns the LU decomposition of this matrix.

Returns:
an array with [0] containing the L-matrix and [1] containing the U-matrix.
Overrides:
luDecompose in class ComplexTridiagonalMatrix
 o mapElements
 public ComplexMatrix mapElements(Mapping f)
Applies a function on all the matrix elements.

Parameters:
f - a user-defined function
Returns:
a complex diagonal matrix
Overrides:
mapElements in class ComplexTridiagonalMatrix

All Packages  Class Hierarchy  This Package  Previous  Next  Index