NAG Library Function Document
nag_matop_real_gen_matrix_actexp (f01gac)
1 Purpose
nag_matop_real_gen_matrix_actexp (f01gac) computes the action of the matrix exponential , on the matrix , where is a real by matrix, is a real by matrix and is a real scalar.
2 Specification
#include <nag.h> |
#include <nagf01.h> |
void |
nag_matop_real_gen_matrix_actexp (Integer n,
Integer m,
double a[],
Integer pda,
double b[],
Integer pdb,
double t,
NagError *fail) |
|
3 Description
is computed using the algorithm described in
Al–Mohy and Higham (2011) which uses a truncated Taylor series to compute the product
without explicitly forming
.
4 References
Al–Mohy A H and Higham N J (2011) Computing the action of the matrix exponential, with an application to exponential integrators SIAM J. Sci. Statist. Comput. 33(2) 488-511
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA
5 Arguments
- 1:
n – IntegerInput
On entry: , the order of the matrix .
Constraint:
.
- 2:
m – IntegerInput
On entry: , the number of columns of the matrix .
Constraint:
.
- 3:
a[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
a
must be at least
.
The th element of the matrix is stored in .
On entry: the by matrix .
On exit: is overwritten during the computation.
- 4:
pda – IntegerInput
-
On entry: the stride separating matrix row elements in the array
a.
Constraint:
.
- 5:
b[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
b
must be at least
.
The th element of the matrix is stored in .
On entry: the by matrix .
On exit: the by matrix .
- 6:
pdb – IntegerInput
-
On entry: the stride separating matrix row elements in the array
b.
Constraint:
.
- 7:
t – doubleInput
On entry: the scalar .
- 8:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Allocation of memory failed.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
- NW_SOME_PRECISION_LOSS
-
has been computed using an IEEE double precision Taylor series, although the arithmetic precision is higher than IEEE double precision.
7 Accuracy
For a symmetric matrix
(for which
) the computed matrix
is guaranteed to be close to the exact matrix, that is, the method is forward stable. No such guarantee can be given for non-symmetric matrices. See Section 4 of
Al–Mohy and Higham (2011) for details and further discussion.
8 Parallelism and Performance
nag_matop_real_gen_matrix_actexp (f01gac) is not threaded by NAG in any implementation.
nag_matop_real_gen_matrix_actexp (f01gac) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
The matrix
could be computed by explicitly forming
using
nag_real_gen_matrix_exp (f01ecc) and multiplying
by the result. However, experiments show that it is usually both more accurate and quicker to use nag_matop_real_gen_matrix_actexp (f01gac).
The cost of the algorithm is . The precise cost depends on since a combination of balancing, shifting and scaling is used prior to the Taylor series evaluation.
Approximately of real allocatable memory is required by nag_matop_real_gen_matrix_actexp (f01gac).
nag_matop_complex_gen_matrix_actexp (f01hac) can be used to compute
for complex
,
, and
.
nag_matop_real_gen_matrix_actexp_rcomm (f01gbc) provides an implementation of the algorithm with a reverse communication interface, which returns control to the user when matrix multiplications are required. This should be used if
is large and sparse.
10 Example
This example computes
, where
and
10.1 Program Text
Program Text (f01gace.c)
10.2 Program Data
Program Data (f01gace.d)
10.3 Program Results
Program Results (f01gace.r)