Description Usage Arguments Details Value Author(s) References See Also Examples
R wrapper of the Expokit Fortran subroutines __EXPV and __PHIV for sparse matrix exponentiation. In general, these routines compute the solution at time point t of the ODE
w'(t) = x w(t) + u
with initial condition w(0) = v.
1 2 3 |
a |
|
ia |
|
ja |
|
n |
dimension of the (square) matrix. |
v |
|
t |
time. Default |
storage |
|
u |
|
anorm |
A norm of the matrix. Default is the sup-norm. |
Markov |
|
m |
|
tol |
|
itrace |
|
mxstep |
|
The Rexpv
function is the low level wrapper of the Fortran
subroutines in the Expokit package. It is not intended to be used
directly but rather via the expv
methods. In the
call the correct storage format in terms of the vectors a
,
ia
and ja
has to be specified via the storage
argument. For CCS, ia
contains 1-based row numbers of
non-zero elements and ja
contains 1-based pointers to the
initial element for each column. For CRS, ja
contains
1-based column numbers of non-zero elements and ia
are
1-based pointers to the initial element for each row. For COO,
ia
and ja
contain the 1-based column and row
numbers, respectively, for the non-zero elements.
The solution, w, of the ODE as a numeric
or
complex
vector of length n.
Niels Richard Hansen Niels.R.Hansen@math.ku.dk
Sidje, R. B. (1998) Expokit. Software Package for Computing Matrix Exponentials. ACM Trans. Math. Softw. 24(1), 130-156.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ### A CCS 4 by 4 real matrix. The last element in 'ja' is the number of
### non-zero elements + 1.
a <- c(-1, 1, -2, -3, 1, 2, -1)
ia <- c(1, 3, 2, 4, 1, 2, 3)
ja <- c(1, 3, 5, 6, 8)
v <- c(1, 1, 1, 1)
wCCS <- expoRkit:::Rexpv(a, ia, ja, 4, v = v)
### COO storage instead.
ja <- c(1, 1, 2, 2, 3, 4, 4)
wCOO <- expoRkit:::Rexpv(a, ia, ja, 4, v = v, storage = 'COO')
### CRS storage instead.
a <- c(-1, 1, -2, 2, 1, -1, -3)
ja <- c(1, 3, 2, 4, 1, 4, 2)
ia <- c(1, 3, 5, 7, 8)
wCRS <- expoRkit:::Rexpv(a, ia, ja, 4, v = v, storage = 'CRS')
cbind(wCCS, wCOO, wCRS)
stopifnot(all.equal(wCCS, wCOO),
all.equal(wCCS, wCRS),
all.equal(wCRS, wCOO))
## Complex version
a <- c(-1, 1i, -2, -3i, 1, 2i, -1)
ia <- c(1, 3, 2, 4, 1, 2, 3)
ja <- c(1, 3, 5, 6, 8)
v <- c(1, 1, 1, 1)
wCCS <- expoRkit:::Rexpv(a, ia, ja, 4, v = v)
### COO storage instead.
ja <- c(1, 1, 2, 2, 3, 4, 4)
wCOO <- expoRkit:::Rexpv(a, ia, ja, 4, v = v, storage = 'COO')
### CRS storage instead.
a <- c(-1, 1, -2, 2i, 1i, -1, -3i)
ja <- c(1, 3, 2, 4, 1, 4, 2)
ia <- c(1, 3, 5, 7, 8)
wCRS <- expoRkit:::Rexpv(a, ia, ja, 4, v = v, storage = 'CRS')
cbind(wCCS, wCOO, wCRS)
stopifnot(all.equal(wCCS, wCOO),
all.equal(wCCS, wCRS),
all.equal(wCRS, wCOO))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.