Cosine-Sine(CS) Decomposition APIs#
BBSCD#
- group bbscd
Functions
-
template<typename T>
void bbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, integer *m, integer *p, integer *q, T *theta, T *phi, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *v2t, integer *ldv2t, T *b11d, T *b11e, T *b12d, T *b12e, T *b21d, T *b21e, T *b22d, T *b22e, T *work, integer *lwork, integer *info)# Bidiagonal block cs decomposition of orthogonal/unitary matrix.
Purpose:
bbcsd() is inline function to call respective LAPACK API using templates. Where T can be REAL or DOUBLE PRECISION. X is M-by-M, its top-left block is P-by-Q, and Q must be no larger than P, M-P, or M-Q. BBCSD computes the CS decomposition of an orthogonal matrix in bidiagonal-block form, [ B11 | B12 0 0 ] [ 0 | 0 -I 0 ] X = [----------------] [ B21 | B22 0 0 ] [ 0 | 0 0 I ] [ C | -S 0 0 ] [ U1 | ] [ 0 | 0 -I 0 ] [ V1 | ]**T = [---------] [---------------] [---------] . [ | U2 ] [ S | C 0 0 ] [ | V2 ] [ 0 | 0 0 I ] X is M-by-M, its top-left block is P-by-Q, and Q must be no larger than P, M-P, or M-Q. (If Q is not the smallest index, then X must be transposed and/or permuted. This can be done in constant time using the TRANS and SIGNS options. See SORCSD for details.) The bidiagonal matrices B11, B12, B21, and B22 are represented implicitly by angles THETA(1:Q) and PHI(1:Q-1). The orthogonal matrices U1, U2, V1T, and V2T are input/output. The input matrices are pre- or post-multiplied by the appropriate singular vector matrices. Real reference: http://www.netlib.org/lapack/explore-html/d1/df5/group__real_o_t_h_e_rcomputational_ga95bdd6e44aed23173e9a0c93c32dad78.html#ga95bdd6e44aed23173e9a0c93c32dad78 Double reference: http://www.netlib.org/lapack/explore-html/da/dba/group__double_o_t_h_e_rcomputational_ga27a367582a76c7b48a8bf3eed068e216.html#ga27a367582a76c7b48a8bf3eed068e216 Complex reference: http://www.netlib.org/lapack/explore-html/d3/db9/group__complex_o_t_h_e_rcomputational_gaa78ee3c0b2912f780622143726a5299e.html#gaa78ee3c0b2912f780622143726a5299e Complex double reference: http://www.netlib.org/lapack/explore-html/d0/da6/group__complex16_o_t_h_e_rcomputational_gab100b320bf854584daf3579ff6d96485.html#gab100b320bf854584daf3579ff6d96485
- Parameters:
JOBU1 – [in]
JOBU1 is CHARACTER
= ‘Y’: U1 is updated;
otherwise: U1 is not updated.JOBU2 – [in]
JOBU2 is CHARACTER
= ‘Y’: U2 is updated;
otherwise: U2 is not updated.JOBV1T – [in]
JOBV1T is CHARACTER
= ‘Y’: V1T is updated;
otherwise: V1T is not updated.JOBV2T – [in]
JOBV2T is CHARACTER
= ‘Y’: V2T is updated;
otherwise: V2T is not updated.TRANS – [in]
TRANS is CHARACTER
= ‘T’: X, U1, U2, V1T, and V2T are stored in row-major order;
otherwise: X, U1, U2, V1T, and V2T are stored in column- major order.M – [in]
M is INTEGER
The number of rows and columns in X, the orthogonal matrix in bidiagonal-block form.
P – [in]
P is INTEGER
The number of rows in the top-left block of X. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in the top-left block of X. 0 <= Q <= MIN(P,M-P,M-Q).
THETA – [inout]
THETA is REAL or DOUBLE PRECISION array, dimension (Q)
On entry, the angles THETA(1),…,THETA(Q) that, along with PHI(1), …,PHI(Q-1), define the matrix in bidiagonal-block form. On exit, the angles whose cosines and sines define the diagonal blocks in the CS decomposition.
PHI – [inout]
PHI is REAL or DOUBLE PRECISION array, dimension (Q-1)
The angles PHI(1),…,PHI(Q-1) that, along with THETA(1),…, THETA(Q), define the matrix in bidiagonal-block form.
U1 – [inout]
U1 is REAL or DOUBLE PRECISION or COMPLEX or COMPLEX*16 array, dimension (LDU1,P)
On entry, a P-by-P matrix. On exit, U1 is postmultiplied by the left singular vector matrix common to [ B11 ; 0 ] and [ B12 0 0 ; 0 -I 0 0 ].
LDU1 – [in]
LDU1 is INTEGER
The leading dimension of the array U1, LDU1 >= MAX(1,P).
U2 – [inout]
U2 is REAL or DOUBLE PRECISION or COMPLEX or COMPLEX*16 array, dimension (LDU2,M-P)
On entry, an (M-P)-by-(M-P) matrix. On exit, U2 is postmultiplied by the left singular vector matrix common to [ B21 ; 0 ] and [ B22 0 0 ; 0 0 I ].
LDU2 – [in]
LDU2 is INTEGER
The leading dimension of the array U2, LDU2 >= MAX(1,M-P).
V1T – [inout]
V1T is REAL or DOUBLE PRECISION or COMPLEX or COMPLEX*16 array, dimension (LDV1T,Q)
On entry, a Q-by-Q matrix. On exit, V1T is premultiplied by the transpose of the right singular vector matrix common to [ B11 ; 0 ] and [ B21 ; 0 ].
LDV1T – [in]
LDV1T is INTEGER
The leading dimension of the array V1T, LDV1T >= MAX(1,Q).
V2T – [inout]
V2T is REAL or DOUBLE PRECISION or COMPLEX or COMPLEX*16 array, dimension (LDV2T,M-Q)
On entry, an (M-Q)-by-(M-Q) matrix. On exit, V2T is premultiplied by the transpose of the right singular vector matrix common to [ B12 0 0 ; 0 -I 0 ] and [ B22 0 0 ; 0 0 I ].
LDV2T – [in]
LDV2T is INTEGER
The leading dimension of the array V2T, LDV2T >= MAX(1,M-Q).
B11D – [out]
B11D is REAL or DOUBLE PRECISION array, dimension (Q)
When SBBCSD converges, B11D contains the cosines of THETA(1), …, THETA(Q). If SBBCSD fails to converge, then B11D contains the diagonal of the partially reduced top-left block.
B11E – [out]
B11E is REAL or DOUBLE PRECISION array, dimension (Q-1)
When SBBCSD converges, B11E contains zeros. If SBBCSD fails to converge, then B11E contains the superdiagonal of the partially reduced top-left block.
B12D – [out]
B12D is REAL or DOUBLE PRECISION array, dimension (Q)
When SBBCSD converges, B12D contains the negative sines of THETA(1), …, THETA(Q). If SBBCSD fails to converge, then B12D contains the diagonal of the partially reduced top-right block.
B12E – [out]
B12E is REAL or DOUBLE PRECISION array, dimension (Q-1)
When SBBCSD converges, B12E contains zeros. If SBBCSD fails to converge, then B12E contains the subdiagonal of the partially reduced top-right block.
B21D – [out]
B21D is REAL or DOUBLE PRECISION array, dimension (Q)
When SBBCSD converges, B21D contains the negative sines of THETA(1), …, THETA(Q). If SBBCSD fails to converge, then B21D contains the diagonal of the partially reduced bottom-left block.
B21E – [out]
B21E is REAL or DOUBLE PRECISION array, dimension (Q-1)
When SBBCSD converges, B21E contains zeros. If SBBCSD fails to converge, then B21E contains the subdiagonal of the partially reduced bottom-left block.
B22D – [out]
B22D is REAL or DOUBLE PRECISION array, dimension (Q)
When SBBCSD converges, B22D contains the negative sines of THETA(1), …, THETA(Q). If SBBCSD fails to converge, then B22D contains the diagonal of the partially reduced bottom-right block.
B22E – [out]
B22E is REAL or DOUBLE PRECISION array, dimension (Q-1)
When SBBCSD converges, B22E contains zeros. If SBBCSD fails to converge, then B22E contains the subdiagonal of the partially reduced bottom-right block.
WORK – [out]
WORK is REAL or DOUBLE PRECISION array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= MAX(1,8*Q).
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the work array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: if SBBCSD did not converge, INFO specifies the number of nonzero entries in PHI, and B11D, B11E, etc., contain the partially reduced matrix.
-
template<typename T, typename Ta>
void bbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, integer *m, integer *p, integer *q, Ta *theta, Ta *phi, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *v2t, integer *ldv2t, Ta *b11d, Ta *b11e, Ta *b12d, Ta *b12e, Ta *b21d, Ta *b21e, Ta *b22d, Ta *b22e, Ta *rwork, integer *lrwork, integer *info)#
-
template<typename T>
ORCSD#
- group orcsd
Functions
-
template<typename T>
void orcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x12, integer *ldx12, T *x21, integer *ldx21, T *x22, integer *ldx22, T *theta, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *v2t, integer *ldv2t, T *work, integer *lwork, integer *iwork, integer *info)# ORCSD computes the CS decomposition of an M-by-M partitioned orthogonal/unitary matrix X.
Purpose:
ORCSD computes the CS decomposition of an M-by-M partitioned orthogonal/unitary matrix X: [ I 0 0 | 0 0 0 ] [ 0 C 0 | 0 -S 0 ] [ X11 | X12 ] [ U1 | ] [ 0 0 0 | 0 0 -I ] [ V1 | ]**T X = [-----------] = [---------] [---------------------] [---------] . [ X21 | X22 ] [ | U2 ] [ 0 0 0 | I 0 0 ] [ | V2 ] [ 0 S 0 | 0 C 0 ] [ 0 0 I | 0 0 0 ] X11 is P-by-Q. The orthogonal/unitary matrices U1, U2, V1, and V2 are P-by-P, (M-P)-by-(M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. C and S are R-by-R nonnegative diagonal matrices satisfying C^2 + S^2 = I, in which R = MIN(P,M-P,Q,M-Q).
- Parameters:
JOBU1 – [in]
JOBU1 is CHARACTER
= ‘Y’: U1 is computed;
otherwise: U1 is not computed.JOBU2 – [in]
JOBU2 is CHARACTER
= ‘Y’: U2 is computed;
otherwise: U2 is not computed.JOBV1T – [in]
JOBV1T is CHARACTER
= ‘Y’: V1T is computed;
otherwise: V1T is not computed.JOBV2T – [in]
JOBV2T is CHARACTER
= ‘Y’: V2T is computed;
otherwise: V2T is not computed.TRANS – [in]
TRANS is CHARACTER
= ‘T’: X, U1, U2, V1T, and V2T are stored in row-major order;
otherwise: X, U1, U2, V1T, and V2T are stored in column- major order.SIGNS – [in]
SIGNS is CHARACTER
= ‘O’: The lower-left block is made nonpositive (the “other” convention);
otherwise: The upper-right block is made nonpositive (the “default” convention).M – [in]
M is INTEGER
The number of rows and columns in X.
P – [in]
P is INTEGER
The number of rows in X11 and X12. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= M.
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= MAX(1,P).
X12 – [inout]
X12 is REAL array, dimension (LDX12,M-Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX12 – [in]
LDX12 is INTEGER
The leading dimension of X12. LDX12 >= MAX(1,P).
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X11. LDX21 >= MAX(1,M-P).
X22 – [inout]
X22 is REAL array, dimension (LDX22,M-Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX22 – [in]
LDX22 is INTEGER
The leading dimension of X11. LDX22 >= MAX(1,M-P).
THETA – [out]
THETA is REAL array, dimension (R), in which R = MIN(P,M-P,Q,M-Q).
C = DIAG( COS(THETA(1)), … , COS(THETA(R))) and
S = DIAG( SIN(THETA(1)), … , SIN(THETA(R))).U1 – [out]
U1 is REAL array, dimension (LDU1,P)
If JOBU1 = ‘Y’, U1 contains the P-by-P orthogonal matrix U1.
LDU1 – [in]
LDU1 is INTEGER
The leading dimension of U1. If JOBU1 = ‘Y’, LDU1 >= MAX(1,P).
U2 – [out]
U2 is REAL array, dimension (LDU2,M-P)
If JOBU2 = ‘Y’, U2 contains the (M-P)-by-(M-P) orthogonal matrix U2.
LDU2 – [in]
LDU2 is INTEGER
The leading dimension of U2. If JOBU2 = ‘Y’, LDU2 >= MAX(1,M-P).
V1T – [out]
V1T is REAL array, dimension (LDV1T,Q)
If JOBV1T = ‘Y’, V1T contains the Q-by-Q matrix orthogonal matrix V1**T.
LDV1T – [in]
LDV1T is INTEGER
The leading dimension of V1T. If JOBV1T = ‘Y’, LDV1T >= MAX(1,Q).
V2T – [out]
V2T is REAL array, dimension (LDV2T,M-Q)
If JOBV2T = ‘Y’, V2T contains the (M-Q)-by-(M-Q) orthogonal matrix V2**T.
LDV2T – [in]
LDV2T is INTEGER
The leading dimension of V2T. If JOBV2T = ‘Y’, LDV2T >= MAX(1,M-Q).
WORK – [out]
WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. If INFO > 0 on exit, WORK(2:R) contains the values PHI(1), …, PHI(R-1) that, together with THETA(1), …, THETA(R), define the matrix in intermediate bidiagonal-block form remaining after nonconvergence. INFO specifies the number of nonzero PHI’s.
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the work array, and no error message related to LWORK is issued by XERBLA.IWORK – [out] IWORK is INTEGER array, dimension (M-MIN(P, M-P, Q, M-Q))
INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: SBBCSD did not converge. See the description of WORK above for details.
-
template<typename T, typename Ta>
void uncsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, char *signs, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x12, integer *ldx12, T *x21, integer *ldx21, T *x22, integer *ldx22, Ta *theta, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *v2t, integer *ldv2t, T *work, integer *lwork, Ta *rwork, integer *lrwork, integer *iwork, integer *info)#
-
template<typename T>
ORCSD2BY1#
- group orcsd2by1
Functions
-
template<typename T>
void orcsd2by1(char *jobu1, char *jobu2, char *jobv1t, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, T *theta, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *work, integer *lwork, integer *iwork, integer *info)# ORCSD2BY1 computes the CS decomposition of an M-by-Q matrix X with orthonormal columns.
Purpose:
ORCSD2BY1 computes the CS decomposition of an M-by-Q matrix X with orthonormal columns that has been partitioned into a 2-by-1 block structure: [ I1 0 0 ] [ 0 C 0 ] [ X11 ] [ U1 | ] [ 0 0 0 ] X = [-----] = [---------] [----------] V1**T . [ X21 ] [ | U2 ] [ 0 0 0 ] [ 0 S 0 ] [ 0 0 I2] X11 is P-by-Q. The orthogonal matrices U1, U2, and V1 are P-by-P, (M-P)-by-(M-P), and Q-by-Q, respectively. C and S are R-by-R nonnegative diagonal matrices satisfying C^2 + S^2 = I, in which R = MIN(P,M-P,Q,M-Q). I1 is a K1-by-K1 identity matrix and I2 is a K2-by-K2 identity matrix, where K1 = MAX(Q+P-M,0), K2 = MAX(Q-P,0).
- Parameters:
JOBU1 – [in]
JOBU1 is CHARACTER
= ‘Y’: U1 is computed;
otherwise: U1 is not computed.JOBU2 – [in]
JOBU2 is CHARACTER
= ‘Y’: U2 is computed;
otherwise: U2 is not computed.JOBV1T – [in]
JOBV1T is CHARACTER
= ‘Y’: V1T is computed;
otherwise: V1T is not computed.M – [in]
M is INTEGER
The number of rows in X.
P – [in]
P is INTEGER
The number of rows in X11. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= M.
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= MAX(1,P).
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, part of the orthogonal matrix whose CSD is desired.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. LDX21 >= MAX(1,M-P).
THETA – [out]
THETA is REAL array, dimension (R), in which R = MIN(P,M-P,Q,M-Q).
C = DIAG( COS(THETA(1)), … , COS(THETA(R))) and
S = DIAG( SIN(THETA(1)), … , SIN(THETA(R))).U1 – [out]
U1 is REAL array, dimension (P)
If JOBU1 = ‘Y’, U1 contains the P-by-P orthogonal matrix U1.
LDU1 – [in]
LDU1 is INTEGER
The leading dimension of U1. If JOBU1 = ‘Y’, LDU1 >= MAX(1,P).
U2 – [out]
U2 is REAL array, dimension (M-P)
If JOBU2 = ‘Y’, U2 contains the (M-P)-by-(M-P) orthogonal matrix U2.
LDU2 – [in]
LDU2 is INTEGER
The leading dimension of U2. If JOBU2 = ‘Y’, LDU2 >= MAX(1,M-P).
V1T – [out]
V1T is REAL array, dimension (Q)
If JOBV1T = ‘Y’, V1T contains the Q-by-Q matrix orthogonal matrix V1**T.
LDV1T – [in]
LDV1T is INTEGER
The leading dimension of V1T. If JOBV1T = ‘Y’, LDV1T >= MAX(1,Q).
WORK – [out]
WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. If INFO > 0 on exit, WORK(2:R) contains the values PHI(1), …, PHI(R-1) that, together with THETA(1), …, THETA(R), define the matrix in intermediate bidiagonal-block form remaining after nonconvergence. INFO specifies the number of nonzero PHI’s.
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the work array, and no error message related to LWORK is issued by XERBLA.IWORK – [out] IWORK is INTEGER array, dimension (M-MIN(P,M-P,Q,M-Q))
INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: SBBCSD did not converge. See the description of WORK above for details.
-
template<typename T, typename Ta>
void uncsd2by1(char *jobu1, char *jobu2, char *jobv1t, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, Ta *theta, T *u1, integer *ldu1, T *u2, integer *ldu2, T *v1t, integer *ldv1t, T *work, integer *lwork, Ta *rwork, integer *lrwork, integer *iwork, integer *info)#
-
template<typename T>
ORBDB#
- group orbdb
Functions
-
template<typename T>
void orbdb(char *trans, char *signs, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x12, integer *ldx12, T *x21, integer *ldx21, T *x22, integer *ldx22, T *theta, T *phi, T *taup1, T *taup2, T *tauq1, T *tauq2, T *work, integer *lwork, integer *info)# ORBDB simultaneously bidiagonalizes the blocks of an M-by-M
partitioned orthogonal matrix X.
Purpose:
ORBDB simultaneously bidiagonalizes the blocks of an M-by-M partitioned orthogonal matrix X: [ B11 | B12 0 0 ] [ X11 | X12 ] [ P1 | ] [ 0 | 0 -I 0 ] [ Q1 | ]**T X = [-----------] = [---------] [----------------] [---------] . [ X21 | X22 ] [ | P2 ] [ B21 | B22 0 0 ] [ | Q2 ] [ 0 | 0 0 I ] X11 is P-by-Q. Q must be no larger than P, M-P, or M-Q. (If this is not the case, then X must be transposed and/or permuted. This can be done in constant time using the TRANS and SIGNS options. See SORCSD for details.) The orthogonal matrices P1, P2, Q1, and Q2 are P-by-P, (M-P)-by- (M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11, B12, B21, and B22 are Q-by-Q bidiagonal matrices represented implicitly by angles THETA, PHI.
- Parameters:
TRANS – [in]
TRANS is CHARACTER
= ‘T’: X, U1, U2, V1T, and V2T are stored in row-major order;
otherwise: X, U1, U2, V1T, and V2T are stored in column- major order.SIGNS – [in]
SIGNS is CHARACTER
= ‘O’: The lower-left block is made nonpositive (the “other” convention);
otherwise: The upper-right block is made nonpositive (the “default” convention).M – [in]
M is INTEGER
The number of rows and columns in X.
P – [in]
P is INTEGER
The number of rows in X11 and X12. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= MIN(P,M-P,M-Q).
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, the top-left block of the orthogonal matrix to be reduced. On exit, the form depends on TRANS:
If TRANS = ‘N’, then
the columns of tril(X11) specify reflectors for P1, the rows of triu(X11,1) specify reflectors for Q1;
else TRANS = ‘T’, and
the rows of triu(X11) specify reflectors for P1, the columns of tril(X11,-1) specify reflectors for Q1.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. If TRANS = ‘N’, then LDX11 >= P; else LDX11 >= Q.
X12 – [inout]
X12 is REAL array, dimension (LDX12,M-Q)
On entry, the top-right block of the orthogonal matrix to be reduced. On exit, the form depends on TRANS:
If TRANS = ‘N’, then
the rows of triu(X12) specify the first P reflectors for Q2;
else TRANS = ‘T’, and
the columns of tril(X12) specify the first P reflectors for Q2.
LDX12 – [in]
LDX12 is INTEGER
The leading dimension of X12. If TRANS = ‘N’, then LDX12 >= P; else LDX11 >= M-Q.
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, the bottom-left block of the orthogonal matrix to be reduced. On exit, the form depends on TRANS:
If TRANS = ‘N’, then
the columns of tril(X21) specify reflectors for P2;
else TRANS = ‘T’, and
the rows of triu(X21) specify reflectors for P2.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. If TRANS = ‘N’, then LDX21 >= M-P; else LDX21 >= Q.
X22 – [inout]
X22 is REAL array, dimension (LDX22,M-Q)
On entry, the bottom-right block of the orthogonal matrix to be reduced. On exit, the form depends on TRANS:
If TRANS = ‘N’, then
the rows of triu(X22(Q+1:M-P,P+1:M-Q)) specify the last M-P-Q reflectors for Q2,
else TRANS = ‘T’, and
the columns of tril(X22(P+1:M-Q,Q+1:M-P)) specify the last M-P-Q reflectors for P2.
LDX22 – [in]
LDX22 is INTEGER
The leading dimension of X22. If TRANS = ‘N’, then LDX22 >= M-P; else LDX22 >= M-Q.
THETA – [out]
THETA is REAL array, dimension (Q)
The entries of the bidiagonal blocks B11, B12, B21, B22 can be computed from the angles THETA and PHI. See Further Details.
PHI – [out]
PHI is REAL array, dimension (Q-1)
The entries of the bidiagonal blocks B11, B12, B21, B22 can be computed from the angles THETA and PHI. See Further Details.
TAUP1 – [out]
TAUP1 is REAL array, dimension (P)
The scalar factors of the elementary reflectors that define P1.
TAUP2 – [out]
TAUP2 is REAL array, dimension (M-P)
The scalar factors of the elementary reflectors that define P2.
TAUQ1 – [out]
TAUQ1 is REAL array, dimension (Q)
The scalar factors of the elementary reflectors that define Q1.
TAUQ2 – [out]
TAUQ2 is REAL array, dimension (M-Q)
The scalar factors of the elementary reflectors that define Q2.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= M-Q.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T, typename Ta>
void unbdb(char *trans, char *signs, integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x12, integer *ldx12, T *x21, integer *ldx21, T *x22, integer *ldx22, Ta *theta, Ta *phi, T *taup1, T *taup2, T *tauq1, T *tauq2, T *work, integer *lwork, integer *info)#
-
template<typename T>
ORBDB1#
- group orbdb1
Functions
-
template<typename T>
void orbdb1(integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, T *theta, T *phi, T *taup1, T *taup2, T *tauq1, T *work, integer *lwork, integer *info)# ORBDB1 simultaneously bidiagonalizes the blocks of a tall and skinny
matrix X with orthonomal columns.
Purpose:
ORBDB1 simultaneously bidiagonalizes the blocks of a tall and skinny matrix X with orthonomal columns: [ B11 ] [ X11 ] [ P1 | ] [ 0 ] [-----] = [---------] [-----] Q1**T . [ X21 ] [ | P2 ] [ B21 ] [ 0 ] X11 is P-by-Q, and X21 is (M-P)-by-Q. Q must be no larger than P, M-P, or M-Q. Routines SORBDB2, SORBDB3, and SORBDB4 handle cases in which Q is not the minimum dimension. The orthogonal matrices P1, P2, and Q1 are P-by-P, (M-P)-by-(M-P), and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11 and B12 are Q-by-Q bidiagonal matrices represented implicitly by angles THETA, PHI.
- Parameters:
M – [in]
M is INTEGER
The number of rows X11 plus the number of rows in X21.
P – [in]
P is INTEGER
The number of rows in X11. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= MIN(P,M-P,M-Q).
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, the top block of the matrix X to be reduced. On exit, the columns of tril(X11) specify reflectors for P1 and the rows of triu(X11,1) specify reflectors for Q1.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= P.
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, the bottom block of the matrix X to be reduced. On exit, the columns of tril(X21) specify reflectors for P2.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. LDX21 >= M-P.
THETA – [out]
THETA is REAL array, dimension (Q)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
PHI – [out]
PHI is REAL array, dimension (Q-1)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
TAUP1 – [out]
TAUP1 is REAL array, dimension (P)
The scalar factors of the elementary reflectors that define P1.
TAUP2 – [out]
TAUP2 is REAL array, dimension (M-P)
The scalar factors of the elementary reflectors that define P2.
TAUQ1 – [out]
TAUQ1 is REAL array, dimension (Q)
The scalar factors of the elementary reflectors that define Q1.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= M-Q.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
ORBDB2#
- group orbdb2
Functions
-
template<typename T>
void orbdb2(integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, T *theta, T *phi, T *taup1, T *taup2, T *tauq1, T *work, integer *lwork, integer *info)# ORBDB2 simultaneously bidiagonalizes the blocks of a tall and skinny
matrix X with orthonomal columns.
Purpose:
ORBDB2 simultaneously bidiagonalizes the blocks of a tall and skinny matrix X with orthonomal columns: [ B11 ] [ X11 ] [ P1 | ] [ 0 ] [-----] = [---------] [-----] Q1**T . [ X21 ] [ | P2 ] [ B21 ] [ 0 ] X11 is P-by-Q, and X21 is (M-P)-by-Q. P must be no larger than M-P, Q, or M-Q. Routines SORBDB1, SORBDB3, and SORBDB4 handle cases in which P is not the minimum dimension. The orthogonal matrices P1, P2, and Q1 are P-by-P, (M-P)-by-(M-P), and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11 and B12 are P-by-P bidiagonal matrices represented implicitly by angles THETA, PHI.
- Parameters:
M – [in]
M is INTEGER
The number of rows X11 plus the number of rows in X21.
P – [in]
P is INTEGER
The number of rows in X11. 0 <= P <= min(M-P,Q,M-Q).
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= M.
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, the top block of the matrix X to be reduced. On exit, the columns of tril(X11) specify reflectors for P1 and the rows of triu(X11,1) specify reflectors for Q1.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= P.
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, the bottom block of the matrix X to be reduced. On exit, the columns of tril(X21) specify reflectors for P2.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. LDX21 >= M-P.
THETA – [out]
THETA is REAL array, dimension (Q)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
PHI – [out]
PHI is REAL array, dimension (Q-1)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
TAUP1 – [out]
TAUP1 is REAL array, dimension (P)
The scalar factors of the elementary reflectors that define P1.
TAUP2 – [out]
TAUP2 is REAL array, dimension (M-P)
The scalar factors of the elementary reflectors that define P2.
TAUQ1 – [out]
TAUQ1 is REAL array, dimension (Q)
The scalar factors of the elementary reflectors that define Q1.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= M-Q.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
ORBDB3#
- group orbdb3
Functions
-
template<typename T>
void orbdb3(integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, T *theta, T *phi, T *taup1, T *taup2, T *tauq1, T *work, integer *lwork, integer *info)# ORBDB3 simultaneously bidiagonalizes the blocks of a tall and skinny
matrix X with orthonomal columns.
Purpose:
ORBDB3 simultaneously bidiagonalizes the blocks of a tall and skinny matrix X with orthonomal columns: [ B11 ] [ X11 ] [ P1 | ] [ 0 ] [-----] = [---------] [-----] Q1**T . [ X21 ] [ | P2 ] [ B21 ] [ 0 ] X11 is P-by-Q, and X21 is (M-P)-by-Q. M-P must be no larger than P, Q, or M-Q. Routines SORBDB1, SORBDB2, and SORBDB4 handle cases in which M-P is not the minimum dimension. The orthogonal matrices P1, P2, and Q1 are P-by-P, (M-P)-by-(M-P), and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11 and B12 are (M-P)-by-(M-P) bidiagonal matrices represented implicitly by angles THETA, PHI.
- Parameters:
M – [in]
M is INTEGER
The number of rows X11 plus the number of rows in X21.
P – [in]
P is INTEGER
The number of rows in X11. 0 <= P <= M. M-P <= min(P,Q,M-Q).
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= M.
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, the top block of the matrix X to be reduced. On exit, the columns of tril(X11) specify reflectors for P1 and the rows of triu(X11,1) specify reflectors for Q1.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= P.
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, the bottom block of the matrix X to be reduced. On exit, the columns of tril(X21) specify reflectors for P2.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. LDX21 >= M-P.
THETA – [out]
THETA is REAL array, dimension (Q)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
PHI – [out]
PHI is REAL array, dimension (Q-1)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
TAUP1 – [out]
TAUP1 is REAL array, dimension (P)
The scalar factors of the elementary reflectors that define P1.
TAUP2 – [out]
TAUP2 is REAL array, dimension (M-P)
The scalar factors of the elementary reflectors that define P2.
TAUQ1 – [out]
TAUQ1 is REAL array, dimension (Q)
The scalar factors of the elementary reflectors that define Q1.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= M-Q.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
ORBDB4#
- group orbdb4
Functions
-
template<typename T>
void orbdb4(integer *m, integer *p, integer *q, T *x11, integer *ldx11, T *x21, integer *ldx21, T *theta, T *phi, T *taup1, T *phantom, T *taup2, T *tauq1, T *work, integer *lwork, integer *info)# ORBDB4 simultaneously bidiagonalizes the blocks of a tall and skinny
matrix X with orthonomal columns.
Purpose:
ORBDB4 simultaneously bidiagonalizes the blocks of a tall and skinny matrix X with orthonomal columns: [ B11 ] [ X11 ] [ P1 | ] [ 0 ] [-----] = [---------] [-----] Q1**T . [ X21 ] [ | P2 ] [ B21 ] [ 0 ] X11 is P-by-Q, and X21 is (M-P)-by-Q. M-Q must be no larger than P, M-P, or Q. Routines SORBDB1, SORBDB2, and SORBDB3 handle cases in which M-Q is not the minimum dimension. The orthogonal matrices P1, P2, and Q1 are P-by-P, (M-P)-by-(M-P), and (M-Q)-by-(M-Q), respectively. They are represented implicitly by Householder vectors. B11 and B12 are (M-Q)-by-(M-Q) bidiagonal matrices represented implicitly by angles THETA, PHI.
- Parameters:
M – [in]
M is INTEGER
The number of rows X11 plus the number of rows in X21.
P – [in]
P is INTEGER
The number of rows in X11. 0 <= P <= M.
Q – [in]
Q is INTEGER
The number of columns in X11 and X21. 0 <= Q <= M and M-Q <= min(P,M-P,Q).
X11 – [inout]
X11 is REAL array, dimension (LDX11,Q)
On entry, the top block of the matrix X to be reduced. On exit, the columns of tril(X11) specify reflectors for P1 and the rows of triu(X11,1) specify reflectors for Q1.
LDX11 – [in]
LDX11 is INTEGER
The leading dimension of X11. LDX11 >= P.
X21 – [inout]
X21 is REAL array, dimension (LDX21,Q)
On entry, the bottom block of the matrix X to be reduced. On exit, the columns of tril(X21) specify reflectors for P2.
LDX21 – [in]
LDX21 is INTEGER
The leading dimension of X21. LDX21 >= M-P.
THETA – [out]
THETA is REAL array, dimension (Q)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
PHI – [out]
PHI is REAL array, dimension (Q-1)
The entries of the bidiagonal blocks B11, B21 are defined by THETA and PHI. See Further Details.
TAUP1 – [out]
TAUP1 is REAL array, dimension (P)
The scalar factors of the elementary reflectors that define P1.
TAUP2 – [out]
TAUP2 is REAL array, dimension (M-P)
The scalar factors of the elementary reflectors that define P2.
TAUQ1 – [out]
TAUQ1 is REAL array, dimension (Q)
The scalar factors of the elementary reflectors that define Q1.
PHANTOM – [out]
PHANTOM is REAL array, dimension (M)
The routine computes an M-by-1 column vector Y that is orthogonal to the columns of [ X11; X21 ]. PHANTOM(1:P) and PHANTOM(P+1:M) contain Householder vectors for Y(1:P) and Y(P+1:M), respectively.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= M-Q.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
UNBDB5#
- group unbdb5
Functions
-
template<typename T>
void orbdb5(integer *m1, integer *m2, integer *n, T *x1, integer *incx1, T *x2, integer *incx2, T *q1, integer *ldq1, T *q2, integer *ldq2, T *work, integer *lwork, integer *info)# ORBDB5 orthogonalizes the column vector.
Purpose:
ORBDB5 orthogonalizes the column vector X = [ X1 ] [ X2 ] with respect to the columns of Q = [ Q1 ] . [ Q2 ] The columns of Q must be orthonormal. If the projection is zero according to Kahan's "twice is enough" criterion, then some other vector from the orthogonal complement is returned. This vector is chosen in an arbitrary but deterministic way.
- Parameters:
M1 – [in]
M1 is INTEGER
The dimension of X1 and the number of rows in Q1. 0 <= M1.
M2 – [in]
M2 is INTEGER
The dimension of X2 and the number of rows in Q2. 0 <= M2.
N – [in]
N is INTEGER
The number of columns in Q1 and Q2. 0 <= N.
X1 – [inout]
X1 is REAL array, dimension (M1)
On entry, the top part of the vector to be orthogonalized. On exit, the top part of the projected vector.
INCX1 – [in]
INCX1 is INTEGER
Increment for entries of X1.
X2 – [inout]
X2 is REAL array, dimension (M2)
On entry, the bottom part of the vector to be orthogonalized. On exit, the bottom part of the projected vector.
INCX2 – [in]
INCX2 is INTEGER
Increment for entries of X2.
Q1 – [in]
Q1 is REAL array, dimension (LDQ1, N)
The top part of the orthonormal basis matrix.
LDQ1 – [in]
LDQ1 is INTEGER
The leading dimension of Q1. LDQ1 >= M1.
Q2 – [in]
Q2 is REAL array, dimension (LDQ2, N)
The bottom part of the orthonormal basis matrix.
LDQ2 – [in]
LDQ2 is INTEGER
The leading dimension of Q2. LDQ2 >= M2.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= N.
INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
ORBDB6#
- group orbdb6
Functions
-
template<typename T>
void orbdb6(integer *m1, integer *m2, integer *n, T *x1, integer *incx1, T *x2, integer *incx2, T *q1, integer *ldq1, T *q2, integer *ldq2, T *work, integer *lwork, integer *info)# ORBDB6 orthogonalizes the column vector.
Purpose:
ORBDB6 orthogonalizes the column vector X = [ X1 ] [ X2 ] with respect to the columns of Q = [ Q1 ] . [ Q2 ] The columns of Q must be orthonormal. If the projection is zero according to Kahan's "twice is enough" criterion, then the zero vector is returned.
- Parameters:
M1 – [in]
M1 is INTEGER
The dimension of X1 and the number of rows in Q1. 0 <= M1.
M2 – [in]
M2 is INTEGER
The dimension of X2 and the number of rows in Q2. 0 <= M2.
N – [in]
N is INTEGER
The number of columns in Q1 and Q2. 0 <= N.
X1 – [inout]
X1 is REAL array, dimension (M1)
On entry, the top part of the vector to be orthogonalized. On exit, the top part of the projected vector.
INCX1 – [in]
INCX1 is INTEGER
Increment for entries of X1.
X2 – [inout]
X2 is REAL array, dimension (M2)
On entry, the bottom part of the vector to be orthogonalized. On exit, the bottom part of the projected vector.
INCX2 – [in]
INCX2 is INTEGER
Increment for entries of X2.
Q1 – [in]
Q1 is REAL array, dimension (LDQ1, N)
The top part of the orthonormal basis matrix.
LDQ1 – [in]
LDQ1 is INTEGER
The leading dimension of Q1. LDQ1 >= M1.
Q2 – [in]
Q2 is REAL array, dimension (LDQ2, N)
The bottom part of the orthonormal basis matrix.
LDQ2 – [in]
LDQ2 is INTEGER
The leading dimension of Q2. LDQ2 >= M2.
WORK – [out] WORK is REAL array, dimension (LWORK)
LWORK – [in]
LWORK is INTEGER
The dimension of the array WORK. LWORK >= N.
INFO – [out]
INFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
-
template<typename T>
LAPMR#
- group lapmr
Functions
-
template<typename T>
void lapmr(logical *forwrd, integer *m, integer *n, T *x, integer *ldx, integer *k)# LAPMR rearranges rows of a matrix as specified by a permutation vector.
Purpose:
LAPMR rearranges the rows of the M by N matrix X as specified by the permutation K(1),K(2),...,K(M) of the integers 1,...,M. If FORWRD = .TRUE., forward permutation: X(K(I),*) is moved X(I,*) for I = 1,2,...,M. If FORWRD = .FALSE., backward permutation: X(I,*) is moved to X(K(I),*) for I = 1,2,...,M.
- Parameters:
FORWRD – [in]
FORWRD is LOGICAL
= .TRUE., forward permutation
= .FALSE., backward permutationM – [in]
M is INTEGER
The number of rows of the matrix X. M >= 0.
N – [in]
N is INTEGER
The number of columns of the matrix X. N >= 0.
X – [inout]
X is REAL array, dimension (LDX,N)
On entry, the M by N matrix X.
On exit, X contains the permuted matrix X.LDX – [in]
LDX is INTEGER
The leading dimension of the array X, LDX >= MAX(1,M).
K – [inout]
K is INTEGER array, dimension (M)
On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output.
-
template<typename T>
LAPMT#
- group lapmt
Functions
-
template<typename T>
void lapmt(logical *forwrd, integer *m, integer *n, T *x, integer *ldx, integer *k)# LAPMT performs a forward or backward permutation of the columns of a matrix.
Purpose:
LAPMT rearranges the columns of the M by N matrix X as specified by the permutation K(1),K(2),...,K(N) of the integers 1,...,N. If FORWRD = .TRUE., forward permutation: X(*,K(J)) is moved X(*,J) for J = 1,2,...,N. If FORWRD = .FALSE., backward permutation: X(*,J) is moved to X(*,K(J)) for J = 1,2,...,N.
- Parameters:
FORWRD – [in]
FORWRD is LOGICAL
= .TRUE., forward permutation
= .FALSE., backward permutationM – [in]
M is INTEGER
The number of rows of the matrix X. M >= 0.
N – [in]
N is INTEGER
The number of columns of the matrix X. N >= 0.
X – [inout]
X is REAL array, dimension (LDX,N)
On entry, the M by N matrix X.
On exit, X contains the permuted matrix X.LDX – [in]
LDX is INTEGER
The leading dimension of the array X, LDX >= MAX(1,M).
K – [inout]
K is INTEGER array, dimension (M)
On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output.
-
template<typename T>