All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.DoubleSquareMatrix

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

public class DoubleSquareMatrix
extends DoubleMatrix
The DoubleSquareMatrix class provides an object for encapsulating square matrices containing doubles.


Constructor Index

 o DoubleSquareMatrix()
Constructs a matrix.
 o DoubleSquareMatrix(double[][])
Constructs a matrix by wrapping an array.
 o DoubleSquareMatrix(DoubleVector[])
Constructs a matrix from an array of vectors (columns).
 o DoubleSquareMatrix(int)
Constructs an empty matrix.

Method Index

 o add(DoubleMatrix)
Returns the addition of this matrix and another.
 o add(DoubleSquareMatrix)
Returns the addition of this matrix and another.
 o choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
 o det()
Returns the determinant.
 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(DoubleMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleSquareMatrix)
Returns the multiplication of this matrix and another.
 o multiply(DoubleVector)
Returns the multiplication of a vector by this matrix.
 o scalarMultiply(double)
Returns the multiplication of this matrix by a scalar.
 o subtract(DoubleMatrix)
Returns the subtraction of this matrix and another.
 o subtract(DoubleSquareMatrix)
Returns the subtraction of this matrix by another.
 o trace()
Returns the trace.
 o transpose()
Returns the transpose of this matrix.

Constructors

 o DoubleSquareMatrix
 protected DoubleSquareMatrix()
Constructs a matrix.

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

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

Parameters:
array - an assigned value
Throws: MatrixDimensionException
If the array is not square.
 o DoubleSquareMatrix
 public DoubleSquareMatrix(DoubleVector array[])
Constructs a matrix from an array of vectors (columns).

Parameters:
array - an assigned value

Methods

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

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

 o det
 public double det()
Returns the determinant.

 o trace
 public double trace()
Returns the trace.

 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 DoubleMatrix
 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.
 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 DoubleMatrix
 o subtract
 public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
Returns the subtraction of this matrix by another.

Parameters:
m - a double square 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 square matrix
Overrides:
scalarMultiply in class DoubleMatrix
 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 DoubleMatrix
 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 incompatible.
Overrides:
multiply in class DoubleMatrix
 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 incompatible.
 o transpose
 public Matrix transpose()
Returns the transpose of this matrix.

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

Returns:
a double square matrix
 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.
 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.
 o mapElements
 public DoubleMatrix mapElements(Mapping f)
Applies a function on all the matrix elements.

Parameters:
f - a user-defined function
Returns:
a double square matrix
Overrides:
mapElements in class DoubleMatrix

All Packages  Class Hierarchy  This Package  Previous  Next  Index