matmul Interface

public interface matmul

This interface overloads the Fortran intrinsic matmul for a SymTridiagonal matrix, both for matrix-vector and matrix-matrix products. For a matrix-matrix product , only the matrix has to be a SymTridiagonal matrix. Both and need to be standard Fortran rank-2 arrays. All the underlying functions are defined as pure.

Syntax

   y = matmul(A, x)

Functions

private module function spmv(A, x) result(y)

Compute the matrix-vector product for a SymTridiagonal matrix . Both x and y are rank-1 arrays with the same kind as A.

Arguments

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

Input matrix.

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

Input vector.

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

Output vector.

private pure module function spmvs(A, X) result(Y)

Compute the matrix-matrix product for a SymTridiagonal matrix and a dense matrix (rank-2 array). is also a rank-2 array with the same dimensions as .

Arguments

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

Input matrix.

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

Input vectors.

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

Output vectors.