expm Interface

public interface expm

Matrix exponential: function interface version : experimental

Computes the exponential of a matrix using a rational Pade approximation. (Specification)

Description

This interface provides methods for computing the exponential of a matrix represented as a standard Fortran rank-2 array. Supported data types include real and complex.

By default, the order of the Pade approximation is set to 10. It can be changed via the order argument that must be non-negative.

If the input matrix is non-square or the order of the Pade approximation is negative, the function returns an error state.

Example

 real(dp) :: A(3, 3), E(3, 3)

 A = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

 ! Default Pade approximation of the matrix exponential.
 E = expm(A)

 ! Pade approximation with specified order.
 E = expm(A, order=12)

Functions

private module function stdlib_linalg_c_expm_fun(A, order) result(E)

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: A(:,:)

Input matrix a(:, :).

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

Return Value complex(kind=sp), allocatable, (:,:)

Exponential of the input matrix E = exp(A).

private module function stdlib_linalg_d_expm_fun(A, order) result(E)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)

Input matrix a(:, :).

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

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

Exponential of the input matrix E = exp(A).

private module function stdlib_linalg_s_expm_fun(A, order) result(E)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: A(:,:)

Input matrix a(:, :).

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

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

Exponential of the input matrix E = exp(A).

private module function stdlib_linalg_z_expm_fun(A, order) result(E)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: A(:,:)

Input matrix a(:, :).

integer(kind=ilp), intent(in), optional :: order

[optional] Order of the Pade approximation (default order=10)

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

Exponential of the input matrix E = exp(A).