forward algorithm, solves the system where L is a lower triangular matrix and b is a vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | dimension(:, :) | :: | L | ||
| real(kind=dp), | intent(in), | dimension(:) | :: | b |
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