backward Function

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


Called by

proc~~backward~~CalledByGraph proc~backward backward proc~applypreconditioner ApplyPreconditioner proc~applypreconditioner->proc~backward

Source Code

    function backward(U, y) result(x)
        real(dp), dimension(:, :), intent(in) :: U
        real(dp), dimension(:), intent(in) :: y
        real(dp), dimension(size(U, 1)) :: x
        integer :: i, N

        N = size(U, 1)

        x(N) = y(N) / U(N, N)

        do i = N - 1, 1, -1
            x(i) = (y(i) - dot_product(U(i, i + 1:N), x(i + 1:N))) / U(i, i)
        end do

    end function backward