forward Function

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))


Called by

proc~~forward~~CalledByGraph proc~forward forward proc~applypreconditioner ApplyPreconditioner proc~applypreconditioner->proc~forward

Source Code

    function forward(L, b) result(y)
        real(dp), dimension(:, :), intent(in) :: L
        real(dp), dimension(:), intent(in) :: b
        real(dp), dimension(size(L, 1)) :: y
        integer :: i, N

        N = size(L, 1)

        y(1) = b(1) / L(1, 1)

        do i = 2, N
            y(i) = (b(i) - dot_product(L(i, 1:i - 1), y(1:i - 1))) / L(i, i)
        end do

    end function forward