Previous Page Next Page Contents

numeric::factorCholesky -- Cholesky factorization of a matrix

Introduction

numeric::factorCholesky(A, ..) returns a Cholesky factorization A=LL^H of a positive definite Hermitean matrix A.

numeric::factorCholesky(A, Symmetric, ..) returns a Cholesky factorization A=LL^T of a symmetric matrix A.

Call(s)

numeric::factorCholesky(A <, Symmetric> <, Symbolic> <, NoCheck>)

Parameters

A - a square matrix of domain type DOM_ARRAY or of category Cat::Matrix

Options

Symmetric - makes numeric::factorCholesky compute a symmetric factorization A=LL^T rather than a Hermitean factorization A=LL^H
Symbolic - prevents numeric::factorCholesky from using floating point arithmetic
NoCheck - prevents numeric::factorCholesky from checking that the matrix is Hermitean and positive definite

Returns

The lower triangular Cholesky factor L is returned as a matrix of domain type DOM_ARRAY. Its components are real or complex floats, unless the option Symbolic is used. Without the option NoCheck an error is returned, if the matrix is not Hermitean or not positive definite.

Side Effects

Without the option Symbolic the function is sensitive to the environment variable DIGITS, which determines the numerical working precision.

Related Functions

linalg::factorCholesky, numeric::factorLU, numeric::factorQR

Details

Option: Symmetric

Option: Symbolic

Option: NoCheck

Example 1

We consider the matrix

>> A := array(1..2, 1..2, [[1, I] , [-I, PI]]):

We compute a numerical factorization

>> numeric::factorCholesky(A)
                         +-                     -+
                         |    1.0,        0      |
                         |                       |
                         |  - 1.0 I, 1.46341814  |
                         +-                     -+

and a symbolic factorization:

>> L := numeric::factorCholesky(A, Symbolic, NoCheck)
                          +-                  -+
                          |   1,       0       |
                          |                    |
                          |               1/2  |
                          |  - I, (PI - 1)     |
                          +-                  -+

For further processing the Cholesky factor (of domain type DOM_ARRAY) is converted to an element of the matrix domain Dom::Matrix():

>> L := Dom::Matrix()(L):

Now the overloaded arithmetical operators +, *, ^ etc. can be used for further computations:

>> L*linalg::transpose(map(L, conjugate))
                               +-         -+
                               |   1,   I  |
                               |           |
                               |  - I, PI  |
                               +-         -+
>> delete A, L:

Example 2

The following matrix is not positive definite:

>> A := array(1..2, 1..2, [[-2, sqrt(2)], [sqrt(2), 1]]):
>> numeric::factorCholesky(A)
      Error: matrix is not positive definite within working precision\
       [numeric::factorCholesky]

However, a symmetric factorization with a complex Cholesky factor does exist:

>> numeric::factorCholesky(A, Symmetric)
                     +-                            -+
                     |  1.414213562 I,      0       |
                     |                              |
                     |     - 1.0 I,    1.414213562  |
                     +-                            -+
>> delete A:

Example 3

The option NoCheck should be used, when the matrix contains symbolic objects:

>> assume(x > 0): assume(z > 0):
>> A := array(1..2, 1..2, [[x, conjugate(y)], [y, z]]):
>> numeric::factorCholesky(A, Symbolic, NoCheck)
                      +-                          -+
                      |   1/2                      |
                      |  x   ,          0          |
                      |                            |
                      |        /           2 \1/2  |
                      |   y    |     abs(y)  |     |
                      |  ----, | z - ------- |     |
                      |   1/2  \        x    /     |
                      |  x                         |
                      +-                          -+

Note that with NoCheck it is assumed that the matrix is Hermitean and positive definite! All upper triangular entries ignored. The following result implicitly assumes u=conjugate(y):

>> A := array(1..2, 1..2, [[x, u], [y, z]]):
>> numeric::factorCholesky(A, Symbolic, NoCheck)
                      +-                          -+
                      |   1/2                      |
                      |  x   ,          0          |
                      |                            |
                      |        /           2 \1/2  |
                      |   y    |     abs(y)  |     |
                      |  ----, | z - ------- |     |
                      |   1/2  \        x    /     |
                      |  x                         |
                      +-                          -+
>> delete A:

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000