All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.DoubleDiagonalMatrix

java.lang.Object
   |
   +----JSci.maths.Matrix
           |
           +----JSci.maths.DoubleMatrix
                   |
                   +----JSci.maths.DoubleSquareMatrix
                           |
                           +----JSci.maths.DoubleTridiagonalMatrix
                                   |
                                   +----JSci.maths.DoubleDiagonalMatrix

public final class DoubleDiagonalMatrix
extends DoubleTridiagonalMatrix
The DoubleDiagonalMatrix class encapsulates diagonal matrices containing doubles. Uses compressed diagonal storage.


Variable Index

 o DIAGONAL
Storage format identifier.
 o storageFormat

Constructor Index

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

Method Index

 o add(DoubleDiagonalMatrix)
Returns the addition of this matrix and another.
 o add(DoubleMatrix)
Returns the addition of this matrix and another.
 o add(DoubleSquareMatrix)
Returns the addition of this matrix and another.
 o add(DoubleTridiagonalMatrix)
Returns the addition of this matrix and another.
 o choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
 o columns()
Returns the number of columns.
 o det()
Returns the determinant.
 o equals(Object)
Compares two double 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 infNorm()
Returns the l(infinity)-norm.
 o inverse()
Returns the inverse of this matrix.
 o isSymmetric()
Returns true if this matrix is symmetric.
 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(DoubleDiagonalMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleSquareMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleTridiagonalMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleVector)
Returns the multiplication of a vector by this matrix.
 o rows()
Returns the number of rows.
 o scalarMultiply(double)
Returns the multiplication of this matrix by a scalar.
 o setElement(int, int, double)
Sets the value of an element of the matrix.
 o subtract(DoubleDiagonalMatrix)
Returns the subtraction of this matrix by another.
 o subtract(DoubleMatrix)
Returns the subtraction of this matrix and another.
 o subtract(DoubleSquareMatrix)
Returns the subtraction of this matrix and another.
 o subtract(DoubleTridiagonalMatrix)
Returns the subtraction of this matrix and another.
 o toComplexMatrix()
Converts this matrix to a complex matrix.
 o toIntegerMatrix()
Converts this matrix to an integer matrix.
 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 DoubleDiagonalMatrix
 protected DoubleDiagonalMatrix()
Constructs a matrix.

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

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

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

Parameters:
array - an assigned value

Methods

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

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

Parameters:
m - a double diagonal matrix
Overrides:
equals in class DoubleTridiagonalMatrix
 o toIntegerMatrix
 public IntegerMatrix toIntegerMatrix()
Converts this matrix to an integer matrix.

Returns:
an integer diagonal matrix
Overrides:
toIntegerMatrix in class DoubleTridiagonalMatrix
 o toComplexMatrix
 public ComplexMatrix toComplexMatrix()
Converts this matrix to a complex matrix.

Returns:
a complex diagonal matrix
Overrides:
toComplexMatrix in class DoubleTridiagonalMatrix
 o getElement
 public double 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 DoubleTridiagonalMatrix
 o setElement
 public void setElement(int i,
                        int j,
                        double x)
Sets the value of an element of the matrix.

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

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

Overrides:
isUnitary in class DoubleSquareMatrix
 o det
 public double det()
Returns the determinant.

Overrides:
det in class DoubleSquareMatrix
 o trace
 public double trace()
Returns the trace.

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

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

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

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

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

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

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

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

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

Parameters:
m - a double matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
Overrides:
subtract in class DoubleTridiagonalMatrix
 o subtract
 public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
Returns the subtraction of this matrix and another.

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

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

Parameters:
m - a double diagonal matrix
Throws: MatrixDimensionException
If the matrices are different sizes.
 o scalarMultiply
 public DoubleMatrix scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.

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

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

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

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

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

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

Returns:
a double diagonal matrix
Overrides:
inverse in class DoubleSquareMatrix
 o transpose
 public Matrix transpose()
Returns the transpose of this matrix.

Returns:
a double diagonal matrix
Overrides:
transpose in class DoubleTridiagonalMatrix
 o luDecompose
 public DoubleSquareMatrix[] 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 DoubleTridiagonalMatrix
 o choleskyDecompose
 public DoubleSquareMatrix[] choleskyDecompose()
Returns the Cholesky decomposition of this matrix. Matrix must be symmetric and positive definite.

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

Parameters:
f - a user-defined function
Returns:
a double diagonal matrix
Overrides:
mapElements in class DoubleTridiagonalMatrix

All Packages  Class Hierarchy  This Package  Previous  Next  Index