gedmdq#

Functions

void sgedmdq(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobq,
    const char*          jobt,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          f32*  restrict F,
    const INT            ldf,
          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 V,
    const INT            ldv,
          f32*  restrict S,
    const INT            lds,
          f32*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void sgedmdq(const char *jobs, const char *jobz, const char *jobr, const char *jobq, const char *jobt, const char *jobf, const INT whtsvd, const INT m, const INT n, f32 *restrict F, const INT ldf, 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 V, const INT ldv, f32 *restrict S, const INT lds, f32 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

SGEDMDQ computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices, using a QR factorization based compression of the data.

For the input matrix that contains a sequence of snapshots, SGEDMDQ computes a certain number of Ritz pairs using the standard Rayleigh-Ritz extraction from a subspace determined by the leading left singular vectors of the projected snapshots.

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’ :: computed and returned in Z. ‘F’ :: returned in factored form as Z*V. ‘Q’ :: returned in factored form as Q*Z. ‘N’ :: not computed.

in
jobr

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

in
jobq

Specifies whether to explicitly compute and return the orthogonal matrix from the QR factorization. ‘Q’ :: Q computed and stored in F. ‘N’ :: Q not explicitly computed.

in
jobt

Specifies whether to return the upper triangular factor from the QR factorization. ‘R’ :: R returned in Y. ‘N’ :: R not returned.

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}.

in
m

The state space dimension (rows of F). m >= 0.

in
n

The number of data snapshots (columns of F). 0 <= n <= m.

inout
F

Single precision M-by-N array. On entry the data snapshots. On exit, if jobq==’Q’ the orthogonal factor of the QR factorization; otherwise the Householder vectors as returned by sgeqrf.

in
ldf

The leading dimension of F. ldf >= m.

out
X

MIN(M,N)-by-(N-1) array, workspace to hold the leading N-1 snapshots in the QR basis. On exit the leading K columns contain the leading K left singular vectors.

in
ldx

The leading dimension of X. ldx >= n.

out
Y

MIN(M,N)-by-(N-1) array, workspace for the trailing N-1 snapshots in the QR basis. On exit, if jobt==’R’, Y contains the upper triangular factor R.

in
ldy

The leading dimension of Y. ldy >= n.

in
nrnk

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

in
tol

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

out
k

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

out
reig

(N-1)-by-1 array. Real parts of the eigenvalues.

out
imeig

(N-1)-by-1 array. Imaginary parts of the eigenvalues.

out
Z

M-by-(N-1) array. Ritz vectors (see jobz).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

(N-1)-by-1 array. Residuals for the K Ritz pairs.

out
B

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

in
ldb

The leading dimension of B. ldb >= min(m,n).

out
V

(N-1)-by-(N-1) array. On exit V(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient.

in
ldv

The leading dimension of V. ldv >= n-1.

out
S

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

in
lds

The leading dimension of S. lds >= n-1.

out
work

Workspace/output array. On exit work[0:MIN(M,N)] contains the scalar factors from sgeqrf, and work[MIN(M,N):MIN(M,N)+N-1] the singular values. On workspace query, work[0] and work[1] hold the minimal and optimal lengths.

in
lwork

The length of work. If lwork = -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 or n=1), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency warning (see sgedmd).

Functions

void dgedmdq(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobq,
    const char*          jobt,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          f64*  restrict F,
    const INT            ldf,
          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 V,
    const INT            ldv,
          f64*  restrict S,
    const INT            lds,
          f64*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void dgedmdq(const char *jobs, const char *jobz, const char *jobr, const char *jobq, const char *jobt, const char *jobf, const INT whtsvd, const INT m, const INT n, f64 *restrict F, const INT ldf, 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 V, const INT ldv, f64 *restrict S, const INT lds, f64 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

DGEDMDQ computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices, using a QR factorization based compression of the data.

For the input matrix that contains a sequence of snapshots, DGEDMDQ computes a certain number of Ritz pairs using the standard Rayleigh-Ritz extraction from a subspace determined by the leading left singular vectors of the projected snapshots.

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’ :: computed and returned in Z. ‘F’ :: returned in factored form as Z*V. ‘Q’ :: returned in factored form as Q*Z. ‘N’ :: not computed.

in
jobr

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

in
jobq

Specifies whether to explicitly compute and return the orthogonal matrix from the QR factorization. ‘Q’ :: Q computed and stored in F. ‘N’ :: Q not explicitly computed.

in
jobt

Specifies whether to return the upper triangular factor from the QR factorization. ‘R’ :: R returned in Y. ‘N’ :: R not returned.

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}.

in
m

The state space dimension (rows of F). m >= 0.

in
n

The number of data snapshots (columns of F). 0 <= n <= m.

inout
F

Double precision M-by-N array. On entry the data snapshots. On exit, if jobq==’Q’ the orthogonal factor of the QR factorization; otherwise the Householder vectors as returned by dgeqrf.

in
ldf

The leading dimension of F. ldf >= m.

out
X

MIN(M,N)-by-(N-1) array, workspace to hold the leading N-1 snapshots in the QR basis. On exit the leading K columns contain the leading K left singular vectors.

in
ldx

The leading dimension of X. ldx >= n.

out
Y

MIN(M,N)-by-(N-1) array, workspace for the trailing N-1 snapshots in the QR basis. On exit, if jobt==’R’, Y contains the upper triangular factor R.

in
ldy

The leading dimension of Y. ldy >= n.

in
nrnk

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

in
tol

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

out
k

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

out
reig

(N-1)-by-1 array. Real parts of the eigenvalues.

out
imeig

(N-1)-by-1 array. Imaginary parts of the eigenvalues.

out
Z

M-by-(N-1) array. Ritz vectors (see jobz).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

(N-1)-by-1 array. Residuals for the K Ritz pairs.

out
B

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

in
ldb

The leading dimension of B. ldb >= min(m,n).

out
V

(N-1)-by-(N-1) array. On exit V(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient.

in
ldv

The leading dimension of V. ldv >= n-1.

out
S

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

in
lds

The leading dimension of S. lds >= n-1.

out
work

Workspace/output array. On exit work[0:MIN(M,N)] contains the scalar factors from dgeqrf, and work[MIN(M,N):MIN(M,N)+N-1] the singular values. On workspace query, work[0] and work[1] hold the minimal and optimal lengths.

in
lwork

The length of work. If lwork = -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 or n=1), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency warning (see dgedmd).

Functions

void cgedmdq(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobq,
    const char*          jobt,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          c64*  restrict F,
    const INT            ldf,
          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 V,
    const INT            ldv,
          c64*  restrict S,
    const INT            lds,
          c64*  restrict zwork,
    const INT            lzwork,
          f32*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void cgedmdq(const char *jobs, const char *jobz, const char *jobr, const char *jobq, const char *jobt, const char *jobf, const INT whtsvd, const INT m, const INT n, c64 *restrict F, const INT ldf, 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 V, const INT ldv, c64 *restrict S, const INT lds, c64 *restrict zwork, const INT lzwork, f32 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

CGEDMDQ computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices, using a QR factorization based compression of the data.

For the input matrix that contains a sequence of snapshots, CGEDMDQ computes a certain number of Ritz pairs using the standard Rayleigh-Ritz extraction from a subspace determined by the leading left singular vectors of the projected snapshots.

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’,’Q’,’N’).

in
jobr

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

in
jobq

Specifies whether to explicitly compute and return the unitary matrix from the QR factorization (‘Q’,’N’).

in
jobt

Specifies whether to return the upper triangular factor from the QR factorization (‘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}.

in
m

The state space dimension (rows of F). m >= 0.

in
n

The number of data snapshots (columns of F). 0 <= n <= m.

inout
F

Complex M-by-N array. On entry the data snapshots. On exit, if jobq==’Q’ the unitary factor of the QR factorization; otherwise the Householder vectors as returned by cgeqrf.

in
ldf

The leading dimension of F. ldf >= m.

out
X

MIN(M,N)-by-(N-1) array, workspace to hold the leading N-1 snapshots in the QR basis. On exit the leading K columns contain the leading K left singular vectors.

in
ldx

The leading dimension of X. ldx >= n.

out
Y

MIN(M,N)-by-(N-1) array, workspace for the trailing N-1 snapshots in the QR basis. On exit, if jobt==’R’, Y contains the upper triangular factor R.

in
ldy

The leading dimension of Y. ldy >= n.

in
nrnk

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

in
tol

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

out
k

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

out
eigs

(N-1)-by-1 array. The computed eigenvalues.

out
Z

M-by-(N-1) array. Ritz vectors (see jobz).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

(N-1)-by-1 real array. Residuals for the K Ritz pairs.

out
B

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

in
ldb

The leading dimension of B. ldb >= min(m,n).

out
V

(N-1)-by-(N-1) array. On exit V(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient.

in
ldv

The leading dimension of V. ldv >= n-1.

out
S

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

in
lds

The leading dimension of S. lds >= n-1.

out
zwork

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

in
lzwork

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

out
work

Real workspace/output.

in
lwork

The length of work. If lwork = -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 or n=1), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency warning (see cgedmd).

Functions

void zgedmdq(
    const char*          jobs,
    const char*          jobz,
    const char*          jobr,
    const char*          jobq,
    const char*          jobt,
    const char*          jobf,
    const INT            whtsvd,
    const INT            m,
    const INT            n,
          c128* restrict F,
    const INT            ldf,
          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 V,
    const INT            ldv,
          c128* restrict S,
    const INT            lds,
          c128* restrict zwork,
    const INT            lzwork,
          f64*  restrict work,
    const INT            lwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void zgedmdq(const char *jobs, const char *jobz, const char *jobr, const char *jobq, const char *jobt, const char *jobf, const INT whtsvd, const INT m, const INT n, c128 *restrict F, const INT ldf, 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 V, const INT ldv, c128 *restrict S, const INT lds, c128 *restrict zwork, const INT lzwork, f64 *restrict work, const INT lwork, INT *restrict iwork, const INT liwork, INT *info)#

ZGEDMDQ computes the Dynamic Mode Decomposition (DMD) for a pair of data snapshot matrices, using a QR factorization based compression of the data.

For the input matrix that contains a sequence of snapshots, ZGEDMDQ computes a certain number of Ritz pairs using the standard Rayleigh-Ritz extraction from a subspace determined by the leading left singular vectors of the projected snapshots.

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’,’Q’,’N’).

in
jobr

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

in
jobq

Specifies whether to explicitly compute and return the unitary matrix from the QR factorization (‘Q’,’N’).

in
jobt

Specifies whether to return the upper triangular factor from the QR factorization (‘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}.

in
m

The state space dimension (rows of F). m >= 0.

in
n

The number of data snapshots (columns of F). 0 <= n <= m.

inout
F

Complex M-by-N array. On entry the data snapshots. On exit, if jobq==’Q’ the unitary factor of the QR factorization; otherwise the Householder vectors as returned by zgeqrf.

in
ldf

The leading dimension of F. ldf >= m.

out
X

MIN(M,N)-by-(N-1) array, workspace to hold the leading N-1 snapshots in the QR basis. On exit the leading K columns contain the leading K left singular vectors.

in
ldx

The leading dimension of X. ldx >= n.

out
Y

MIN(M,N)-by-(N-1) array, workspace for the trailing N-1 snapshots in the QR basis. On exit, if jobt==’R’, Y contains the upper triangular factor R.

in
ldy

The leading dimension of Y. ldy >= n.

in
nrnk

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

in
tol

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

out
k

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

out
eigs

(N-1)-by-1 array. The computed eigenvalues.

out
Z

M-by-(N-1) array. Ritz vectors (see jobz).

in
ldz

The leading dimension of Z. ldz >= m.

out
res

(N-1)-by-1 real array. Residuals for the K Ritz pairs.

out
B

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

in
ldb

The leading dimension of B. ldb >= min(m,n).

out
V

(N-1)-by-(N-1) array. On exit V(1:K,1:K) contains the K eigenvectors of the Rayleigh quotient.

in
ldv

The leading dimension of V. ldv >= n-1.

out
S

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

in
lds

The leading dimension of S. lds >= n-1.

out
zwork

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

in
lzwork

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

out
work

Real workspace/output.

in
lwork

The length of work. If lwork = -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 or n=1), quick exit. = 2 : the SVD computation of X did not converge. = 3 : the computation of the eigenvalues did not converge. = 4 : data inconsistency warning (see zgedmd).