solve_dense_lu Module Subroutine

module subroutine solve_dense_lu(self, A, b, x, status)

solve linear equation

Arguments

Type IntentOptional Attributes Name
class(type_solver_dense_lu), intent(inout) :: self
class(abst_matrix), intent(in) :: A
real(kind=real64), intent(inout) :: b(:)
real(kind=real64), intent(inout) :: x(:)
integer(kind=int32), intent(inout) :: status

LU decomposition


Calls

proc~~solve_dense_lu~~CallsGraph proc~solve_dense_lu solve_dense_lu dgetrf dgetrf proc~solve_dense_lu->dgetrf dgetrs dgetrs proc~solve_dense_lu->dgetrs error_message error_message proc~solve_dense_lu->error_message

Source Code

    module subroutine solve_dense_lu(self, A, b, x, status)
        implicit none
        class(type_solver_dense_lu), intent(inout) :: self
        class(abst_matrix), intent(in) :: A
        real(real64), intent(inout) :: b(:)
        real(real64), intent(inout) :: x(:)
        integer(int32), intent(inout) :: status
        !* LU decomposition
        select type (matrix => A)
        type is (type_dense)
            call dgetrf(self%N, self%N, matrix%val, self%N, self%IPIV, self%ERROR)
            if (self%ERROR /= 0) call error_message(942)

            !* solve linear equation
            call dgetrs('N', self%N, 1, matrix%val, self%N, self%IPIV, b, self%N, self%ERROR)
            if (self%ERROR /= 0) call error_message(943)

            x(:) = b(:)

            status = transfer(self%ERROR, status)
        end select
    end subroutine solve_dense_lu