solve Interface

public interface solve

This interface overloads the solve interface from stdlib_linalg for solving a system where is a Strang matrix. It also enables to solve a linear system with multiple right-hand sides.

Syntax

   x = solve(A, b)

Arguments

  • A : Matrix of Strang type. It is an intent(in) argument.

  • b : Rank-1 or rank-2 array defining the right-hand side(s). It is an intent(in) argument.

  • x : Solution of the linear system. It has the same type and shape as b.


Functions

private module function solve_multi_rhs(A, b, refine) result(x)

Arguments

Type IntentOptional Attributes Name
type(Strang), intent(in) :: A

Coefficient matrix.

real(kind=dp), intent(in) :: b(:,:)

Right-hand side vectors.

logical(kind=lk), intent(in), optional :: refine

Whether iterative refinement is used or not.

Return Value real(kind=dp), allocatable, (:,:)

Solution vectors.

private module function solve_single_rhs(A, b, refine) result(x)

Arguments

Type IntentOptional Attributes Name
type(Strang), intent(in) :: A

Coefficient matrix.

real(kind=dp), intent(in), target :: b(:)

Right-hand side vector.

logical(kind=lk), intent(in), optional :: refine

Whether iterative refinement is used or not.

Return Value real(kind=dp), allocatable, target, (:)

Solution vector.