Processing math: 100%

cholesky Module

Cholesky decomposition and resolution

Description

The Cholesky decomposition is a method for solving systems of linear equations, particularly when the coefficient matrix is symmetric and positive definite. The method involves decomposing the matrix into a product of a lower triangular matrix and its transpose.

Here's a detailed description of the Cholesky method for solving the system Ax=b.

Decompose A

Given a symmetric positive definite matrix A, we can decompose it to find L in A=LLT, where L is a lower triangular matrix.

Forward Substitution

Solve the system Ly=b for y. This can be done using forward substitution since L is a lower triangular matrix. y1=b1L11y2=b2L21y1L22y3=b3L31y1L32y2L33

Backward Substitution

Once y is found, solve the system LTx=y for x using backward substitution since LT is an upper triangular matrix. xn=ynLnnxn1=yn1Ln1,nxnLn1,n1xn2=yn2Ln2,n1xn1Ln2,nxnLn2,n2


Uses

  • module~~cholesky~~UsesGraph module~cholesky cholesky module~data_arch data_arch module~cholesky->module~data_arch iso_fortran_env iso_fortran_env module~data_arch->iso_fortran_env

Used by

  • module~~cholesky~~UsedByGraph module~cholesky cholesky module~least_squares least_squares module~least_squares->module~cholesky program~test_utils test_utils program~test_utils->module~cholesky module~tchebychev tchebychev module~tchebychev->module~least_squares program~test_least test_least program~test_least->module~least_squares program~test_tchebychev test_tchebychev program~test_tchebychev->module~tchebychev

Subroutines

public subroutine choldc(a, n, np, p, info)

Given a positive definite symmetric matrix a(1:n,1:n), with physical dimensions np, this routine constructs its Cholesky decomposition, A=L L^T. On input, only the upper triangle of a need to be given; it is not modified. The Cholesky factor L is returned in the lower triangle of a, except for its diagonal elements which are returned in p(1:n).

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(inout), dimension(np, np) :: a

system matrix

integer(kind=I4), intent(in) :: n

system size

integer(kind=I4), intent(in) :: np

matrix size

real(kind=R8), intent(out), dimension(np) :: p

diagonal elements

integer(kind=I4), intent(out) :: info

information ouput

public subroutine cholsl(a, n, np, p, b, x, info)

Solves the set of linear equations A x = b, where A is a positive- definite symmetric matrix with physical dimensions np. A and P are are input as the output from choldc. Only the lower triangle of A is accessed. B(1:n) is inout as the right-hand side vector. The solution vector is returned in X(1:n). A, n, np, and P are not modified and can be left in place for successive calls with different right-hand sides B. B is not modified unless you identify B and X in the calling sequence, which is allowed.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(np, np) :: a

system matrix

integer(kind=I4), intent(in) :: n

system size

integer(kind=I4), intent(in) :: np

matrix size

real(kind=R8), intent(in), dimension(np) :: p

diagonal elements

real(kind=R8), intent(inout), dimension(np) :: b

rhs

real(kind=R8), intent(inout), dimension(np) :: x

solution vector

integer(kind=I4), intent(inout) :: info

information ouput