matmul Interface

public interface matmul

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

Syntax

   y = matmul(A, x)

Note

Matrix-vector products for Hankel matrices can be efficiently computed by transforming the matrix into a Toeplitz one and embedding the Toeplitz matrix into a Circulant matrix of size [m+n x m+n] and using the Fast Fourier Transform provided by fftpack.


Functions

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

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

Arguments

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

Input matrix.

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

Input vector.

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

Output vector.

private pure module function spmvs(A, x) result(y)

Compute the matrix-matrix product for a Hankel matrix A. Both X and Y are rank-2 arrays with the same kind as A.

Arguments

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

Input matrix.

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

Input matrix.

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

Output matrix.