weka.core.matrix

## Class CholeskyDecomposition

- java.lang.Object
- - weka.core.matrix.CholeskyDecomposition

- All Implemented Interfaces:
    java.io.Serializable, RevisionHandler

      public class CholeskyDecomposition
      extends java.lang.Object
      implements java.io.Serializable, RevisionHandler

  Cholesky Decomposition.

  For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L*L'.

  If the matrix is not symmetric or positive definite, the constructor returns a partial decomposition and sets an internal flag that may be queried by the isSPD() method.

  Adapted from the JAMA package.
  Version:
    $Revision: 5953 $
  Author:
    The Mathworks and NIST, Fracpete (fracpete at waikato dot ac dot nz)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CholeskyDecomposition(Matrix Arg)` Cholesky algorithm for symmetric and positive definite matrix.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Matrix` | `getL()` Return triangular factor.
    `java.lang.String` | `getRevision()` Returns the revision string.
    `boolean` | `isSPD()` Is the matrix symmetric and positive definite?
    `Matrix` | `solve(Matrix B)` Solve A*X = B

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CholeskyDecomposition

          public CholeskyDecomposition(Matrix Arg)

      Cholesky algorithm for symmetric and positive definite matrix.
      Parameters:
        `Arg` - Square, symmetric matrix.

  - ### Method Detail

    - #### isSPD

          public boolean isSPD()

      Is the matrix symmetric and positive definite?
      Returns:
        true if A is symmetric and positive definite.

    - #### getL

          public Matrix getL()

      Return triangular factor.
      Returns:
        L

    - #### solve

          public Matrix solve(Matrix B)

      Solve A*X = B
      Parameters:
        `B` - A Matrix with as many rows as A and any number of columns.
      Returns:
        X so that L*L'*X = B
      Throws:
        `java.lang.IllegalArgumentException` - Matrix row dimensions must agree.
        `java.lang.RuntimeException` - Matrix is not symmetric positive definite.

    - #### getRevision

          public java.lang.String getRevision()

      Returns the revision string.
      Specified by:
        `getRevision` in interface `RevisionHandler`
      Returns:
        the revision