linear_combination Interface

public interface linear_combination

Given a set of extended abstract_vectors and coefficients, return the corresponding linear combinations.

Description

This interface provides methods for computing linear combinations of a set of extended abstract_vectors. Depending on its input, it either computes

i.e. a single vector, or

i.e. a set of vectors of the same type as .

Example

    type(my_real_vector), dimension(10) :: X
    real(dp), dimension(m, n)           :: B
    type(my_real_vector)                :: Y

    ! ... Whatever your code is doing ...

    call linear_combination(Y, X, B)

    ! ... Rest of your code ...

Module Procedures

private subroutine linear_combination_vector_rsp(y, X, v)

Given X and v, this function return where y is an abstract_vector, X an array of abstract_vector and v a Fortran array containing the coefficients of the linear combination.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_rsp), intent(out), allocatable :: y

Ouput vector.

class(abstract_vector_rsp), intent(in) :: X(:)

Krylov basis.

real(kind=sp), intent(in) :: v(:)

Coordinates of y in the Krylov basis X.

private subroutine linear_combination_matrix_rsp(Y, X, B)

Given X and B, this function computes where X and Y are arrays of abstract_vector, and B is a 2D Fortran array.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_rsp), intent(out), allocatable :: Y(:)

Output matrix.

class(abstract_vector_rsp), intent(in) :: X(:)

Krylov basis.

real(kind=sp), intent(in) :: B(:,:)

Coefficients of the linear combinations.

private subroutine linear_combination_vector_rdp(y, X, v)

Given X and v, this function return where y is an abstract_vector, X an array of abstract_vector and v a Fortran array containing the coefficients of the linear combination.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_rdp), intent(out), allocatable :: y

Ouput vector.

class(abstract_vector_rdp), intent(in) :: X(:)

Krylov basis.

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

Coordinates of y in the Krylov basis X.

private subroutine linear_combination_matrix_rdp(Y, X, B)

Given X and B, this function computes where X and Y are arrays of abstract_vector, and B is a 2D Fortran array.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_rdp), intent(out), allocatable :: Y(:)

Output matrix.

class(abstract_vector_rdp), intent(in) :: X(:)

Krylov basis.

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

Coefficients of the linear combinations.

private subroutine linear_combination_vector_csp(y, X, v)

Given X and v, this function return where y is an abstract_vector, X an array of abstract_vector and v a Fortran array containing the coefficients of the linear combination.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_csp), intent(out), allocatable :: y

Ouput vector.

class(abstract_vector_csp), intent(in) :: X(:)

Krylov basis.

complex(kind=sp), intent(in) :: v(:)

Coordinates of y in the Krylov basis X.

private subroutine linear_combination_matrix_csp(Y, X, B)

Given X and B, this function computes where X and Y are arrays of abstract_vector, and B is a 2D Fortran array.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_csp), intent(out), allocatable :: Y(:)

Output matrix.

class(abstract_vector_csp), intent(in) :: X(:)

Krylov basis.

complex(kind=sp), intent(in) :: B(:,:)

Coefficients of the linear combinations.

private subroutine linear_combination_vector_cdp(y, X, v)

Given X and v, this function return where y is an abstract_vector, X an array of abstract_vector and v a Fortran array containing the coefficients of the linear combination.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_cdp), intent(out), allocatable :: y

Ouput vector.

class(abstract_vector_cdp), intent(in) :: X(:)

Krylov basis.

complex(kind=dp), intent(in) :: v(:)

Coordinates of y in the Krylov basis X.

private subroutine linear_combination_matrix_cdp(Y, X, B)

Given X and B, this function computes where X and Y are arrays of abstract_vector, and B is a 2D Fortran array.

Arguments

Type IntentOptional Attributes Name
class(abstract_vector_cdp), intent(out), allocatable :: Y(:)

Output matrix.

class(abstract_vector_cdp), intent(in) :: X(:)

Krylov basis.

complex(kind=dp), intent(in) :: B(:,:)

Coefficients of the linear combinations.