util
Class CholeskyFactor

java.lang.Object
  extended by util.LowerTriangularMatrix
      extended by util.CholeskyFactor

public class CholeskyFactor
extends LowerTriangularMatrix

Implements a square lower-triangular matrix. Uses index arithmetic on a 1-D array. Why isn't there an implementation in colt?

Author:
dgorur

Field Summary
 
Fields inherited from class util.LowerTriangularMatrix
diagonal, diagonalIndices, elements, rowCount, rows, TOLERANCE
 
Constructor Summary
CholeskyFactor(cern.colt.matrix.linalg.CholeskyDecomposition A)
          Constructs a CholeskyFactor using the given CholeskyDecomposition.
CholeskyFactor(double[][] a)
          Constructs a lower triangular matrix by interpreting the given double[][] array as such.
CholeskyFactor(cern.colt.matrix.DoubleMatrix2D A)
          Constructs a lower-triangular matrix using the lower triangle of the given matrix.
CholeskyFactor(int numRows)
          Constructs a lower-triangular matrix having the given number of rows.
 
Method Summary
 CholeskyFactor appendRow(cern.colt.matrix.DoubleMatrix1D row)
          Appends the given row to this lower-triangular matrix.
 LowerTriangularMatrix assign(cern.colt.matrix.linalg.CholeskyDecomposition A)
          Assigns the given Cholesky factor to this CholeskyFactor.
 CholeskyFactor copy()
          Returns a copy of this Cholesky factor.
 java.lang.String toString()
           
 
Methods inherited from class util.LowerTriangularMatrix
assign, diagonal, full, identity, isSingular, leftDivide, leftDivide, rightDivide, rightDivide, vec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CholeskyFactor

public CholeskyFactor(cern.colt.matrix.linalg.CholeskyDecomposition A)
Constructs a CholeskyFactor using the given CholeskyDecomposition.

Parameters:
A - the given CholeskyDecomposition.

CholeskyFactor

public CholeskyFactor(double[][] a)
               throws java.lang.IllegalArgumentException,
                      Exceptions.SingularMatrixException
Constructs a lower triangular matrix by interpreting the given double[][] array as such. The array cannot be ragged.

Parameters:
a - the given array.
Throws:
java.lang.IllegalArgumentException - if the given array is ragged or not square.
Exceptions.SingularMatrixException - if the resulting CholeskyFactor is singular.

CholeskyFactor

public CholeskyFactor(cern.colt.matrix.DoubleMatrix2D A)
               throws Exceptions.SingularMatrixException
Constructs a lower-triangular matrix using the lower triangle of the given matrix.

Parameters:
A - the given matrix.
Throws:
Exceptions.SingularMatrixException - if the resulting CholeskyFactor is singular.

CholeskyFactor

public CholeskyFactor(int numRows)
Constructs a lower-triangular matrix having the given number of rows.

Parameters:
numRows - the given number of rows.
Method Detail

appendRow

public CholeskyFactor appendRow(cern.colt.matrix.DoubleMatrix1D row)
                         throws Exceptions.SingularMatrixException
Appends the given row to this lower-triangular matrix.

Parameters:
row - the given row.
Returns:
this CholeskyFactor.
Throws:
Exceptions.SingularMatrixException

assign

public LowerTriangularMatrix assign(cern.colt.matrix.linalg.CholeskyDecomposition A)
                             throws Exceptions.SingularMatrixException
Assigns the given Cholesky factor to this CholeskyFactor.

Parameters:
A - the given Cholesky factor.
Returns:
this CholeskyFactor.
Throws:
Exceptions.SingularMatrixException - if the resulting CholeskyFactor is singular.

copy

public CholeskyFactor copy()
Returns a copy of this Cholesky factor.

Returns:
a copy of this Cholesky factor.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object