gedmd#

Functions

void sgedmd(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          f32*  restrict X,
    const INT            ldx,
          f32*  restrict Y,
    const INT            ldy,
    const INT            nrnk,
    const f32            tol,
          INT*           k,
          f32*  restrict reig,
          f32*  restrict imeig,
          f32*  restrict Z,
    const INT            ldz,
          f32*  restrict res,
          f32*  restrict B,
    const INT            ldb,
          f32*  restrict W,
    const INT            ldw,
          f32*  restrict S,
    const INT            lds,
          f32*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void sgedmd(const char *jobs, const char *jobz, const char *jobr, const char *jobf, const INT whtsvd, const INT m, const INT n, f32 *restrict X, const INT ldx, f32 *restrict Y, const INT ldy, const INT nrnk, const f32 tol, INT *k, f32 *restrict reig, f32 *restrict imeig, f32 *restrict Z, const INT ldz, f32 *restrict res, f32 *restrict B, const INT ldb, f32 *restrict W, const INT ldw, f32 *restrict S, const INT lds, f32 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

SGEDMD computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices.

For the input matrices X and Y such that Y = A*X with an unaccessible matrix A, SGEDMD computes a certain number of Ritz pairs of A using the standard Rayleigh-Ritz extraction from a subspace of range(X) that is determined using the leading left singular vectors of X. Optionally, SGEDMD returns the residuals of the computed Ritz pairs, the information needed for a refinement of the Ritz vectors, or the eigenvectors of the Exact DMD.

Parameters

in
jobs

Determines whether the initial data snapshots are scaled by a diagonal matrix. ‘S’ :: X and Y are multiplied with a diagonal matrix D so that X*D has unit nonzero columns. ‘C’ :: as ‘S’; additionally if X(:,i)=0 and Y(:,i)/=0 then Y(:,i) is set to zero and a warning raised. ‘Y’ :: X and Y are multiplied by a diagonal matrix D so that Y*D has unit nonzero columns. ‘N’ :: No data scaling.

in
jobz

Determines whether the eigenvectors (Koopman modes) will be computed. ‘V’ :: eigenvectors computed and returned in Z. ‘F’ :: eigenvectors returned in factored form X(:,1:K)*W. ‘N’ :: eigenvectors are not computed.

in
jobr

Determines whether to compute the residuals. ‘R’ :: residuals computed and stored in RES. ‘N’ :: residuals are not computed.

in
jobf

Specifies whether to store information needed for post-processing. ‘R’ :: matrix needed for the refinement of the Ritz vectors is stored in B. ‘E’ :: unscaled eigenvectors of the Exact DMD are stored in B. ‘N’ :: no eigenvector refinement data is computed.

in
whtsvd

Selects the SVD algorithm from LAPACK, in {1,2,3,4}. 1 :: sgesvd, 2 :: sgesdd, 3 :: sgesvdq, 4 :: sgejsv.

in
m

The state space dimension (rows of X, Y). m >= 0.

in
n

The number of data snapshot pairs. 0 <= n <= m.

inout
X

Single precision M-by-N array. On entry the data snapshot matrix X. On exit, the leading K columns contain a POD basis (leading K left singular vectors).

in
ldx

The leading dimension of X. ldx >= m.

inout
Y

Single precision M-by-N array. On entry the data snapshot matrix Y. On exit, if jobr==’R’ the leading K columns contain the residual vectors; if jobr==’N’, Y contains the original input data, scaled per jobs.

in
ldy

The leading dimension of Y. ldy >= m.

in
nrnk

Determines how to compute the numerical rank. -1 :: sigma(i) truncated if sigma(i) <= tol*sigma(1). -2 :: sigma(i) truncated if sigma(i) <= tol*sigma(i-1). 0 < nrnk <= n :: at most nrnk largest singular values.

in
tol

Tolerance for truncating small singular values, 0 <= tol < 1.

out
k

0 <= k <= n. The dimension of the POD basis and the number of computed Ritz pairs.

out
reig

N-by-1 array. reig[0:K] contain the real parts of the computed eigenvalues.

out
imeig

N-by-1 array. imeig[0:K] contain the imaginary parts of the computed eigenvalues. Complex conjugate pairs have consecutive indices, positive imaginary part first.

out
Z

M-by-N array. If jobz==’V’, contains the real Ritz vectors. If jobz==’F’, the descriptions hold for X(:,1:K)*W(1:K,1:K).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

N-by-1 array. res[0:K] contain the residuals for the K computed Ritz pairs.

out
B

M-by-N array. If jobf==’R’, B(1:M,1:K) contains A*U(:,1:K). If jobf==’E’, B(1:M,1:K) contains A*U(:,1:K)*W(1:K,1:K). If jobf==’N’, not referenced.

in
ldb

The leading dimension of B. ldb >= m.

out
W

N-by-N array. On exit W(1:K,1:K) contains the K computed eigenvectors of the Rayleigh quotient. Also used as workspace for the right singular vectors of X.

in
ldw

The leading dimension of W. ldw >= n.

out
S

N-by-N array. S(1:K,1:K) is used for the Rayleigh quotient, overwritten during the eigenvalue decomposition by sgeev.

in
lds

The leading dimension of S. lds >= n.

out
work

Workspace/output array. On exit work[0:N] contains the singular values of (scaled) X. If whtsvd==4, work[N] and work[N+1] contain a scaling factor. On workspace query, work[0] is the minimal and work[1] the optimal workspace length.

in
lwork

The length of work. If lwork = -1, a workspace query is assumed.

out
iwork

Integer workspace, required only if whtsvd in {2,3,4}.

in
liwork

The length of iwork. If liwork = -1, a workspace query is assumed.

out
info

= -i < 0 : the i-th argument had an illegal value. = 0 : successful return. = 1 : void input (m=0 or n=0), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency detected and (for jobs==’C’) a column of Y was zeroed; warning flag.

Functions

void dgedmd(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          f64*  restrict X,
    const INT            ldx,
          f64*  restrict Y,
    const INT            ldy,
    const INT            nrnk,
    const f64            tol,
          INT*           k,
          f64*  restrict reig,
          f64*  restrict imeig,
          f64*  restrict Z,
    const INT            ldz,
          f64*  restrict res,
          f64*  restrict B,
    const INT            ldb,
          f64*  restrict W,
    const INT            ldw,
          f64*  restrict S,
    const INT            lds,
          f64*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void dgedmd(const char *jobs, const char *jobz, const char *jobr, const char *jobf, const INT whtsvd, const INT m, const INT n, f64 *restrict X, const INT ldx, f64 *restrict Y, const INT ldy, const INT nrnk, const f64 tol, INT *k, f64 *restrict reig, f64 *restrict imeig, f64 *restrict Z, const INT ldz, f64 *restrict res, f64 *restrict B, const INT ldb, f64 *restrict W, const INT ldw, f64 *restrict S, const INT lds, f64 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

DGEDMD computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices.

For the input matrices X and Y such that Y = A*X with an unaccessible matrix A, DGEDMD computes a certain number of Ritz pairs of A using the standard Rayleigh-Ritz extraction from a subspace of range(X) that is determined using the leading left singular vectors of X. Optionally, DGEDMD returns the residuals of the computed Ritz pairs, the information needed for a refinement of the Ritz vectors, or the eigenvectors of the Exact DMD.

Parameters

in
jobs

Determines whether the initial data snapshots are scaled by a diagonal matrix. ‘S’ :: X and Y are multiplied with a diagonal matrix D so that X*D has unit nonzero columns. ‘C’ :: as ‘S’; additionally if X(:,i)=0 and Y(:,i)/=0 then Y(:,i) is set to zero and a warning raised. ‘Y’ :: X and Y are multiplied by a diagonal matrix D so that Y*D has unit nonzero columns. ‘N’ :: No data scaling.

in
jobz

Determines whether the eigenvectors (Koopman modes) will be computed. ‘V’ :: eigenvectors computed and returned in Z. ‘F’ :: eigenvectors returned in factored form X(:,1:K)*W. ‘N’ :: eigenvectors are not computed.

in
jobr

Determines whether to compute the residuals. ‘R’ :: residuals computed and stored in RES. ‘N’ :: residuals are not computed.

in
jobf

Specifies whether to store information needed for post-processing. ‘R’ :: matrix needed for the refinement of the Ritz vectors is stored in B. ‘E’ :: unscaled eigenvectors of the Exact DMD are stored in B. ‘N’ :: no eigenvector refinement data is computed.

in
whtsvd

Selects the SVD algorithm from LAPACK, in {1,2,3,4}. 1 :: dgesvd, 2 :: dgesdd, 3 :: dgesvdq, 4 :: dgejsv.

in
m

The state space dimension (rows of X, Y). m >= 0.

in
n

The number of data snapshot pairs. 0 <= n <= m.

inout
X

Double precision M-by-N array. On entry the data snapshot matrix X. On exit, the leading K columns contain a POD basis (leading K left singular vectors).

in
ldx

The leading dimension of X. ldx >= m.

inout
Y

Double precision M-by-N array. On entry the data snapshot matrix Y. On exit, if jobr==’R’ the leading K columns contain the residual vectors; if jobr==’N’, Y contains the original input data, scaled per jobs.

in
ldy

The leading dimension of Y. ldy >= m.

in
nrnk

Determines how to compute the numerical rank. -1 :: sigma(i) truncated if sigma(i) <= tol*sigma(1). -2 :: sigma(i) truncated if sigma(i) <= tol*sigma(i-1). 0 < nrnk <= n :: at most nrnk largest singular values.

in
tol

Tolerance for truncating small singular values, 0 <= tol < 1.

out
k

0 <= k <= n. The dimension of the POD basis and the number of computed Ritz pairs.

out
reig

N-by-1 array. reig[0:K] contain the real parts of the computed eigenvalues.

out
imeig

N-by-1 array. imeig[0:K] contain the imaginary parts of the computed eigenvalues. Complex conjugate pairs have consecutive indices, positive imaginary part first.

out
Z

M-by-N array. If jobz==’V’, contains the real Ritz vectors. If jobz==’F’, the descriptions hold for X(:,1:K)*W(1:K,1:K).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

N-by-1 array. res[0:K] contain the residuals for the K computed Ritz pairs.

out
B

M-by-N array. If jobf==’R’, B(1:M,1:K) contains A*U(:,1:K). If jobf==’E’, B(1:M,1:K) contains A*U(:,1:K)*W(1:K,1:K). If jobf==’N’, not referenced.

in
ldb

The leading dimension of B. ldb >= m.

out
W

N-by-N array. On exit W(1:K,1:K) contains the K computed eigenvectors of the Rayleigh quotient. Also used as workspace for the right singular vectors of X.

in
ldw

The leading dimension of W. ldw >= n.

out
S

N-by-N array. S(1:K,1:K) is used for the Rayleigh quotient, overwritten during the eigenvalue decomposition by dgeev.

in
lds

The leading dimension of S. lds >= n.

out
work

Workspace/output array. On exit work[0:N] contains the singular values of (scaled) X. If whtsvd==4, work[N] and work[N+1] contain a scaling factor. On workspace query, work[0] is the minimal and work[1] the optimal workspace length.

in
lwork

The length of work. If lwork = -1, a workspace query is assumed.

out
iwork

Integer workspace, required only if whtsvd in {2,3,4}.

in
liwork

The length of iwork. If liwork = -1, a workspace query is assumed.

out
info

= -i < 0 : the i-th argument had an illegal value. = 0 : successful return. = 1 : void input (m=0 or n=0), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency detected and (for jobs==’C’) a column of Y was zeroed; warning flag.

Functions

void cgedmd(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          c64*  restrict X,
    const INT            ldx,
          c64*  restrict Y,
    const INT            ldy,
    const INT            nrnk,
    const f32            tol,
          INT*           k,
          c64*  restrict eigs,
          c64*  restrict Z,
    const INT            ldz,
          f32*  restrict res,
          c64*  restrict B,
    const INT            ldb,
          c64*  restrict W,
    const INT            ldw,
          c64*  restrict S,
    const INT            lds,
          c64*  restrict zwork,
    const INT            lzwork,
          f32*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void cgedmd(const char *jobs, const char *jobz, const char *jobr, const char *jobf, const INT whtsvd, const INT m, const INT n, c64 *restrict X, const INT ldx, c64 *restrict Y, const INT ldy, const INT nrnk, const f32 tol, INT *k, c64 *restrict eigs, c64 *restrict Z, const INT ldz, f32 *restrict res, c64 *restrict B, const INT ldb, c64 *restrict W, const INT ldw, c64 *restrict S, const INT lds, c64 *restrict zwork, const INT lzwork, f32 *restrict rwork, const INT lrwork, INT *restrict iwork, const INT liwork, INT *info)#

CGEDMD computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices.

For the input matrices X and Y such that Y = A*X with an unaccessible matrix A, CGEDMD computes a certain number of Ritz pairs of A using the standard Rayleigh-Ritz extraction from a subspace of range(X) that is determined using the leading left singular vectors of X. Optionally, CGEDMD returns the residuals of the computed Ritz pairs, the information needed for a refinement of the Ritz vectors, or the eigenvectors of the Exact DMD.

Parameters

in
jobs

Determines whether the initial data snapshots are scaled by a diagonal matrix (‘S’,’C’,’Y’,’N’).

in
jobz

Determines whether the eigenvectors (Koopman modes) will be computed (‘V’,’F’,’N’).

in
jobr

Determines whether to compute the residuals (‘R’,’N’).

in
jobf

Specifies whether to store information needed for post-processing (‘R’,’E’,’N’).

in
whtsvd

Selects the SVD algorithm from LAPACK, in {1,2,3,4}. 1 :: cgesvd, 2 :: cgesdd, 3 :: cgesvdq, 4 :: cgejsv.

in
m

The state space dimension (rows of X, Y). m >= 0.

in
n

The number of data snapshot pairs. 0 <= n <= m.

inout
X

Complex M-by-N array. On entry the data snapshot matrix X. On exit, the leading K columns contain a POD basis.

in
ldx

The leading dimension of X. ldx >= m.

inout
Y

Complex M-by-N array. On entry the data snapshot matrix Y. On exit, if jobr==’R’ the leading K columns contain the residual vectors; otherwise Y contains the original input data scaled per jobs.

in
ldy

The leading dimension of Y. ldy >= m.

in
nrnk

Determines how to compute the numerical rank (-1, -2, or 0 < nrnk <= n).

in
tol

Tolerance for truncating small singular values, 0 <= tol < 1.

out
k

0 <= k <= n. The dimension of the POD basis and the number of computed Ritz pairs.

out
eigs

N-by-1 array. eigs[0:K] contain the computed eigenvalues LAMBDA(i).

out
Z

M-by-N array. If jobz==’V’, the Ritz vectors; if jobz==’F’, the descriptions hold for X(:,1:K)*W(1:K,1:K).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

N-by-1 real array. res[0:K] contain the residuals.

out
B

M-by-N array. Refinement / Exact DMD data (see jobf).

in
ldb

The leading dimension of B. ldb >= m.

out
W

N-by-N array. On exit W(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient. Also used as workspace for the right singular vectors of X.

in
ldw

The leading dimension of W. ldw >= n.

out
S

N-by-N array. Used for the Rayleigh quotient, overwritten during the eigenvalue decomposition.

in
lds

The leading dimension of S. lds >= n.

out
zwork

Complex workspace/output. On workspace query, zwork[0] is the minimal and zwork[1] the optimal length.

in
lzwork

The length of zwork. If lzwork = -1, a workspace query.

out
rwork

Real workspace/output. On exit rwork[0:N] contains the singular values of (scaled) X. If whtsvd==4, rwork[N] and rwork[N+1] contain a scaling factor.

in
lrwork

The length of rwork. If lrwork = -1, a workspace query.

out
iwork

Integer workspace, required only if whtsvd in {2,3,4}.

in
liwork

The length of iwork. If liwork = -1, a workspace query.

out
info

= -i < 0 : the i-th argument had an illegal value. = 0 : successful return. = 1 : void input (m=0 or n=0), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency detected and (for jobs==’C’) a column of Y was zeroed; warning flag.

Functions

void zgedmd(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          c128* restrict X,
    const INT            ldx,
          c128* restrict Y,
    const INT            ldy,
    const INT            nrnk,
    const f64            tol,
          INT*           k,
          c128* restrict eigs,
          c128* restrict Z,
    const INT            ldz,
          f64*  restrict res,
          c128* restrict B,
    const INT            ldb,
          c128* restrict W,
    const INT            ldw,
          c128* restrict S,
    const INT            lds,
          c128* restrict zwork,
    const INT            lzwork,
          f64*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void zgedmd(const char *jobs, const char *jobz, const char *jobr, const char *jobf, const INT whtsvd, const INT m, const INT n, c128 *restrict X, const INT ldx, c128 *restrict Y, const INT ldy, const INT nrnk, const f64 tol, INT *k, c128 *restrict eigs, c128 *restrict Z, const INT ldz, f64 *restrict res, c128 *restrict B, const INT ldb, c128 *restrict W, const INT ldw, c128 *restrict S, const INT lds, c128 *restrict zwork, const INT lzwork, f64 *restrict rwork, const INT lrwork, INT *restrict iwork, const INT liwork, INT *info)#

ZGEDMD computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices.

For the input matrices X and Y such that Y = A*X with an unaccessible matrix A, ZGEDMD computes a certain number of Ritz pairs of A using the standard Rayleigh-Ritz extraction from a subspace of range(X) that is determined using the leading left singular vectors of X. Optionally, ZGEDMD returns the residuals of the computed Ritz pairs, the information needed for a refinement of the Ritz vectors, or the eigenvectors of the Exact DMD.

Parameters

in
jobs

Determines whether the initial data snapshots are scaled by a diagonal matrix (‘S’,’C’,’Y’,’N’).

in
jobz

Determines whether the eigenvectors (Koopman modes) will be computed (‘V’,’F’,’N’).

in
jobr

Determines whether to compute the residuals (‘R’,’N’).

in
jobf

Specifies whether to store information needed for post-processing (‘R’,’E’,’N’).

in
whtsvd

Selects the SVD algorithm from LAPACK, in {1,2,3,4}. 1 :: zgesvd, 2 :: zgesdd, 3 :: zgesvdq, 4 :: zgejsv.

in
m

The state space dimension (rows of X, Y). m >= 0.

in
n

The number of data snapshot pairs. 0 <= n <= m.

inout
X

Complex M-by-N array. On entry the data snapshot matrix X. On exit, the leading K columns contain a POD basis.

in
ldx

The leading dimension of X. ldx >= m.

inout
Y

Complex M-by-N array. On entry the data snapshot matrix Y. On exit, if jobr==’R’ the leading K columns contain the residual vectors; otherwise Y contains the original input data scaled per jobs.

in
ldy

The leading dimension of Y. ldy >= m.

in
nrnk

Determines how to compute the numerical rank (-1, -2, or 0 < nrnk <= n).

in
tol

Tolerance for truncating small singular values, 0 <= tol < 1.

out
k

0 <= k <= n. The dimension of the POD basis and the number of computed Ritz pairs.

out
eigs

N-by-1 array. eigs[0:K] contain the computed eigenvalues LAMBDA(i).

out
Z

M-by-N array. If jobz==’V’, the Ritz vectors; if jobz==’F’, the descriptions hold for X(:,1:K)*W(1:K,1:K).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

N-by-1 real array. res[0:K] contain the residuals.

out
B

M-by-N array. Refinement / Exact DMD data (see jobf).

in
ldb

The leading dimension of B. ldb >= m.

out
W

N-by-N array. On exit W(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient. Also used as workspace for the right singular vectors of X.

in
ldw

The leading dimension of W. ldw >= n.

out
S

N-by-N array. Used for the Rayleigh quotient, overwritten during the eigenvalue decomposition.

in
lds

The leading dimension of S. lds >= n.

out
zwork

Complex workspace/output. On workspace query, zwork[0] is the minimal and zwork[1] the optimal length.

in
lzwork

The length of zwork. If lzwork = -1, a workspace query.

out
rwork

Real workspace/output. On exit rwork[0:N] contains the singular values of (scaled) X. If whtsvd==4, rwork[N] and rwork[N+1] contain a scaling factor.

in
lrwork

The length of rwork. If lrwork = -1, a workspace query.

out
iwork

Integer workspace, required only if whtsvd in {2,3,4}.

in
liwork

The length of iwork. If liwork = -1, a workspace query.

out
info

= -i < 0 : the i-th argument had an illegal value. = 0 : successful return. = 1 : void input (m=0 or n=0), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency detected and (for jobs==’C’) a column of Y was zeroed; warning flag.