public class Cholesky extends Object implements Serializable, Cloneable
double
.
Class Cholesky
uses the CholeskyBanachiewicz algortithm to
factor the matrix A.
The Cholesky factorization of a matrix is , where R is a lower triangular matrix. Thus,
which leads to the following for the entries of the lower triangular marix R: andThe method update
is based on the LINPACK routine SCHUD
;
see Dongarra et al. (1979) and updates the Cholesky factorization
of the real symmetric positive definite matrix A after a rankone matrix is added.
Given this factorization, update
computes the factorization
such that
downdate
, based on the LINPACK routine SCHDD
;
see Dongarra et al. (1979), downdates the Cholesky factorization
of the real symmetric positive definite matrix A after a rankone matrix is subtracted.
downdate
computes the factorization such that
This is not always possible, since may not be positive definite.
downdate
determines an orthogonal matrix U as the product
of Givens rotations, such that
By multiplying this equation by its transpose and noting that , the desired result
is obtained.Let a be the solution of the linear system and let
The Givens rotations, , are chosen such that
The , are (N + 1) by (N + 1) matrices of the form
where is the identity matrix of order k; and for some .The Givens rotations are then used to form
The matrix
is lower triangular and because .Modifier and Type  Class and Description 

static class 
Cholesky.NotSPDException
The matrix is not symmetric, positive definite.

Constructor and Description 

Cholesky(double[][] a)
Create the Cholesky factorization of a symmetric positive definite
matrix of type
double . 
Modifier and Type  Method and Description 

void 
downdate(double[] x)
Downdates the factorization by subtracting a rank1 matrix.

double[][] 
getR()
Returns the R matrix that results from the Cholesky factorization.

double[][] 
inverse()
Returns the inverse of this matrix

double[] 
solve(double[] b)
Solve Ax = b where A is a positive definite matrix with elements of type
double . 
void 
update(double[] x)
Updates the factorization by adding a rank1 matrix.

public Cholesky(double[][] a) throws SingularMatrixException, Cholesky.NotSPDException
double
.a
 a double
square matrix to be factoredIllegalArgumentException
 Thrown when the row lengths of matrix a are not equal
(for example, the matrix edges are "jagged".)SingularMatrixException
 Thrown when the input matrix A is singular.Cholesky.NotSPDException
 Thrown when the input matrix is not symmetric, positive definite.public void downdate(double[] x) throws Cholesky.NotSPDException
x
 A double
array which specifies the rank1 matrix.
x
is not modified by this function.Cholesky.NotSPDException
 if is not symmetric
positivedefinite.public double[][] getR()
double
matrix which contains the lower
triangular R matrix that results from the Cholesky
factorization such that public double[][] inverse()
double
matrix containing the inversepublic double[] solve(double[] b)
double
.b
 a double
array containing the righthand side of the linear
systemdouble
array containing the solution to the system of
linear equationspublic void update(double[] x)
x
 A double
array which specifies the rank1 matrix.
x
is not modified by this function.Copyright © 19702015 Rogue Wave Software
Built October 13 2015.