util
Class LowerTriangularMatrix

java.lang.Object
  extended by util.LowerTriangularMatrix
Direct Known Subclasses:
CholeskyFactor

public class LowerTriangularMatrix
extends java.lang.Object

Author:
dgorur

Field Summary
protected  cern.colt.matrix.DoubleMatrix1D diagonal
           
protected  int[] diagonalIndices
           
protected  cern.colt.matrix.DoubleMatrix1D elements
           
protected  int rowCount
           
protected  cern.colt.matrix.DoubleMatrix1D[] rows
           
static double TOLERANCE
           
 
Constructor Summary
LowerTriangularMatrix()
           
 
Method Summary
 LowerTriangularMatrix assign(cern.colt.matrix.DoubleMatrix2D A)
          Assigns the lower triangle of the given matrix to this CholeskyFactor.
 cern.colt.matrix.DoubleMatrix1D diagonal()
          Returns the diagonal elements of this CholeskyFactor.
 cern.colt.matrix.DoubleMatrix2D full()
          Returns the full version of this lower-triangular matrix by assigning zeros to the upper triangle.
static CholeskyFactor identity(int rowCount)
          Constructs a CholeskyFactor having the given number of rows.
 boolean isSingular()
          Indicates matrix singularity.
 cern.colt.matrix.DoubleMatrix1D leftDivide(cern.colt.matrix.DoubleMatrix1D b, cern.colt.matrix.DoubleMatrix1D x)
          Solves L x = b.
 cern.colt.matrix.DoubleMatrix2D leftDivide(cern.colt.matrix.DoubleMatrix2D B, cern.colt.matrix.DoubleMatrix2D X)
          Solves L' X = B.
 cern.colt.matrix.DoubleMatrix1D rightDivide(cern.colt.matrix.DoubleMatrix1D b, cern.colt.matrix.DoubleMatrix1D x)
          Solves x L' = b.
 cern.colt.matrix.DoubleMatrix2D rightDivide(cern.colt.matrix.DoubleMatrix2D B, cern.colt.matrix.DoubleMatrix2D X)
          Solves X L' = B.
 cern.colt.matrix.DoubleMatrix1D vec()
          Returns all the elements of this lower-triangular matrix, concatenated row-wise, in a single vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOLERANCE

public static final double TOLERANCE
See Also:
Constant Field Values

rowCount

protected int rowCount

diagonalIndices

protected int[] diagonalIndices

diagonal

protected cern.colt.matrix.DoubleMatrix1D diagonal

elements

protected cern.colt.matrix.DoubleMatrix1D elements

rows

protected cern.colt.matrix.DoubleMatrix1D[] rows
Constructor Detail

LowerTriangularMatrix

public LowerTriangularMatrix()
Method Detail

identity

public static CholeskyFactor identity(int rowCount)
Constructs a CholeskyFactor having the given number of rows.

Parameters:
rowCount - the given number of rows.
Returns:
a CholeskyFactor having the given number of rows.

assign

public LowerTriangularMatrix assign(cern.colt.matrix.DoubleMatrix2D A)
                             throws Exceptions.SingularMatrixException
Assigns the lower triangle of the given matrix to this CholeskyFactor.

Parameters:
A - the given matrix.
Returns:
this CholeskyFactor for convenience.
Throws:
Exceptions.SingularMatrixException

diagonal

public cern.colt.matrix.DoubleMatrix1D diagonal()
Returns the diagonal elements of this CholeskyFactor.

Returns:
the diagonal elements.

full

public cern.colt.matrix.DoubleMatrix2D full()
Returns the full version of this lower-triangular matrix by assigning zeros to the upper triangle.

Returns:
the full version of this CholeskyFactor.

leftDivide

public cern.colt.matrix.DoubleMatrix1D leftDivide(cern.colt.matrix.DoubleMatrix1D b,
                                                  cern.colt.matrix.DoubleMatrix1D x)
Solves L x = b.

Parameters:
b - RHS, vector.
x - vector to hold the result
Returns:
the result vector for convenience.

leftDivide

public cern.colt.matrix.DoubleMatrix2D leftDivide(cern.colt.matrix.DoubleMatrix2D B,
                                                  cern.colt.matrix.DoubleMatrix2D X)
Solves L' X = B.

Parameters:
B - RHS, matrix.
X - matrix to hold the result.
Returns:
the result matrix for convenience.

rightDivide

public cern.colt.matrix.DoubleMatrix1D rightDivide(cern.colt.matrix.DoubleMatrix1D b,
                                                   cern.colt.matrix.DoubleMatrix1D x)
Solves x L' = b.

Parameters:
b - RHS, vector.
x - vector to hold the result.
Returns:
result vector for convenience.

rightDivide

public cern.colt.matrix.DoubleMatrix2D rightDivide(cern.colt.matrix.DoubleMatrix2D B,
                                                   cern.colt.matrix.DoubleMatrix2D X)
Solves X L' = B.

Parameters:
B - RHS, matrix.
X - matrix to hold the result.
Returns:
the result matrix, for convenience.

vec

public cern.colt.matrix.DoubleMatrix1D vec()
Returns all the elements of this lower-triangular matrix, concatenated row-wise, in a single vector.

Returns:
a vector holding all the elements of this CholeskyFactor.

isSingular

public boolean isSingular()
Indicates matrix singularity.

Returns:
true if matrix is singular.