Cholesky Factorization Calculator


This JavaScript program performs a Cholesky Decomposition on a real, symmetric, positive-definite, matrix. It is a severely edited translation of the LAPACK routine DPOTRF.F.


E. Anderson,   Z. Bai,   C. Bischof,   S. Blackford,   J. Demmel,   J. Dongarra,   J. Du Croz,   A. Greenbaum,
S. Hammarling,   A. McKenney,   and D. Sorensen.
          "LAPACK Users' Guide, Third Edition"
          SIAM, Philadelphia

The original sub-routines were written in FORTRAN and have been translated to Javascript here. Although all care has been taken to ensure that the sub-routines were translated accurately, some errors may have crept into the translation. These errors are mine; the original FORTRAN routines have been thoroughly tested and work properly. Please report any errors to the webmaster.

A Cholesky Decomposition of a real, symmetric, positive-definite matrix, A, yields either

(i) a lower triangular matrix, L, such that A = L * LT, or

(ii) an upper triangular matrix, U, such that A = UT * U.

Not all symmetric matrices are positive-definite; in fact, applying a Cholesky Decomposition on a symmetric matrix is perhaps the quickest and easiest way to check its positive-definiteness. The matrix is initially treated as if it is positive definite. If the decomposition fails, then the matrix is, in fact, not positive definite.

This calculator performs the second option listed above: it computes the Upper Triangular Matrix, U.

(i) The first entry should be the dimension of the system, N.
(ii) The next N x N entries should be the coefficients of the A Matrix.
The coefficients should be entered in the following order:
a11, a12, a13, . . .
a21, a22, a23, . . .

Do not enter commas, periods, brackets, etc. Also note that numbers in scientific notation are NOT recognized.

For example, say we want to compute U for a 3 x 3 matrix. Data should be input to the box as follows:

  25     15     -5  
  15     18     0  
  -5     0     11  

Once all the data has been entered, click the Factorize button, and the Cholesky Factorization will be performed.

Note the Error Code. If it does not equal 0, the decomposition could not be completed.


For more information about this program, please see the associated blog post: Cholesky Decomposition Program


Return to Math Functions Page Home