NAFPack_matrix_decomposition Module

Module for matrix decomposition methods

This module provides subroutines for various matrix decomposition methods including LU, LDU, Cholesky, and QR decompositions.


Uses

  • module~~nafpack_matrix_decomposition~~UsesGraph module~nafpack_matrix_decomposition NAFPack_matrix_decomposition module~nafpack_constant NAFPack_constant module~nafpack_matrix_decomposition->module~nafpack_constant module~nafpack_matricielle NAFPack_matricielle module~nafpack_matrix_decomposition->module~nafpack_matricielle iso_fortran_env iso_fortran_env module~nafpack_constant->iso_fortran_env module~nafpack_matricielle->module~nafpack_constant

Used by

  • module~~nafpack_matrix_decomposition~~UsedByGraph module~nafpack_matrix_decomposition NAFPack_matrix_decomposition module~nafpack_direct_method NAFPack_Direct_method module~nafpack_direct_method->module~nafpack_matrix_decomposition module~nafpack_matrix_properties NAFPack_matrix_properties module~nafpack_direct_method->module~nafpack_matrix_properties module~nafpack_eigen NAFPack_Eigen module~nafpack_eigen->module~nafpack_matrix_decomposition module~nafpack_iterative_methods NAFPack_Iterative_methods module~nafpack_iterative_methods->module~nafpack_matrix_decomposition module~nafpack_iterative_params NAFPack_Iterative_Params module~nafpack_iterative_methods->module~nafpack_iterative_params module~nafpack_preconditioners NAFPack_Preconditioners module~nafpack_iterative_methods->module~nafpack_preconditioners module~nafpack_iterative_methods->module~nafpack_matrix_properties module~nafpack_iterative_params->module~nafpack_matrix_decomposition module~nafpack_iterative_params->module~nafpack_preconditioners module~nafpack_preconditioners->module~nafpack_matrix_decomposition module~nafpack_linalg NAFPack_linalg module~nafpack_linalg->module~nafpack_direct_method module~nafpack_linalg->module~nafpack_iterative_methods module~nafpack_matrix_properties->module~nafpack_eigen

Functions

public function forward(L, b) result(y)

forward algorithm, solves the system where L is a lower triangular matrix and b is a vector

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: L
real(kind=dp), intent(in), DIMENSION(:) :: b

Return Value real(kind=dp), DIMENSION(SIZE(L, 1))

public function backward(U, y) result(x)

backward algorithm, solves the system where U is an upper triangular matrix and y is a vector

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: U
real(kind=dp), intent(in), DIMENSION(:) :: y

Return Value real(kind=dp), DIMENSION(SIZE(U, 1))


Subroutines

public subroutine LU_decomposition(A, L, U)

LU decomposition of a matrix A This subroutine performs LU decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1),SIZE(A, 1)) :: L
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1),SIZE(A, 1)) :: U

public subroutine LDU_decomposition(A, L, D, U)

LDU decomposition of a matrix A This subroutine performs LDU decomposition of a given matrix A, where L is a lower triangular matrix, D is a diagonal matrix, and U is an upper triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1),SIZE(A, 1)) :: L
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1),SIZE(A, 1)) :: D
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1),SIZE(A, 1)) :: U

public subroutine ILU_decomposition(A, L, U)

Incomplete LU decomposition of a matrix A This subroutine performs incomplete LU decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: L
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: U

public subroutine Cholesky_decomposition(A, L)

Cholesky decomposition of a matrix A This subroutine performs Cholesky decomposition of a given symmetric positive definite matrix A, where L is a lower triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(: ,:) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: L

public subroutine LDL_Cholesky_decomposition(A, L, D)

Alternative Cholesky decomposition of a matrix A This subroutine performs alternative Cholesky decomposition of a given symmetric positive definite matrix A, where L is a lower triangular matrix and D is a diagonal matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: L
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: D

public subroutine Incomplete_Cholesky_decomposition(A, L)

Incomplete Cholesky decomposition of a matrix A This subroutine performs incomplete Cholesky decomposition of a given matrix A, where L is a lower triangular matrix and U is an upper triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1), SIZE(A, 1)) :: L

public subroutine QR_decomposition(A, method, Q, R)

QR decomposition of a matrix A using various methods This subroutine performs QR decomposition of a given matrix A using the specified method (Householder, Givens, Classical Gram-Schmidt, or Modified Gram-Schmidt). The output matrices Q is an orthogonal matrix and R is an upper triangular matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
character(len=*), intent(in), optional :: method
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: Q
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: R

public subroutine QR_Householder_decomposition(A, Q, R)

QR decomposition using Householder method

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: Q
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: R

public subroutine QR_Givens_decomposition(A, Q, R)

QR decomposition using Givens rotations

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: Q
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: R

public subroutine QR_Gram_Schmidt_Classical_decomposition(A, Q, R)

QR decomposition using Classical Gram-Schmidt method

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: Q
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: R

public subroutine QR_Gram_Schmidt_Modified_decomposition(A, Q, R)

QR decomposition using Modified Gram-Schmidt method

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in), DIMENSION(:, :) :: A
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: Q
real(kind=dp), intent(out), DIMENSION(SIZE(A, 1) ,SIZE(A, 2)) :: R