uncsd#

Functions

void cuncsd(
    const char*          jobu1,
    const char*          jobu2,
    const char*          jobv1t,
    const char*          jobv2t,
    const char*          trans,
    const char*          signs,
    const INT            m,
    const INT            p,
    const INT            q,
          c64*           X11,
    const INT            ldx11,
          c64*           X12,
    const INT            ldx12,
          c64*           X21,
    const INT            ldx21,
          c64*           X22,
    const INT            ldx22,
          f32*  restrict theta,
          c64*  restrict U1,
    const INT            ldu1,
          c64*  restrict U2,
    const INT            ldu2,
          c64*  restrict V1T,
    const INT            ldv1t,
          c64*  restrict V2T,
    const INT            ldv2t,
          c64*  restrict work,
    const INT            lwork,
          f32*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
          INT*           info
);
void cuncsd(const char *jobu1, const char *jobu2, const char *jobv1t, const char *jobv2t, const char *trans, const char *signs, const INT m, const INT p, const INT q, c64 *X11, const INT ldx11, c64 *X12, const INT ldx12, c64 *X21, const INT ldx21, c64 *X22, const INT ldx22, f32 *restrict theta, c64 *restrict U1, const INT ldu1, c64 *restrict U2, const INT ldu2, c64 *restrict V1T, const INT ldv1t, c64 *restrict V2T, const INT ldv2t, c64 *restrict work, const INT lwork, f32 *restrict rwork, const INT lrwork, INT *restrict iwork, INT *info)#

CUNCSD computes the CS decomposition of an M-by-M partitioned 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 |    ]**H
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 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

in
jobu1

= ‘Y’: U1 is computed; otherwise: U1 is not computed.

in
jobu2

= ‘Y’: U2 is computed; otherwise: U2 is not computed.

in
jobv1t

= ‘Y’: V1T is computed; otherwise: V1T is not computed.

in
jobv2t

= ‘Y’: V2T is computed; otherwise: V2T is not computed.

in
trans

= ‘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.

in
signs

= ‘O’: The lower-left block is made nonpositive (“other” convention); otherwise: The upper-right block is made nonpositive (“default” convention).

in
m

The number of rows and columns in X.

in
p

The number of rows in X11 and X12. 0 <= p <= m.

in
q

The number of columns in X11 and X21. 0 <= q <= m.

inout
X11

Complex*16 array, dimension (ldx11, q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx11

The leading dimension of X11.

inout
X12

Complex*16 array, dimension (ldx12, m-q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx12

The leading dimension of X12.

inout
X21

Complex*16 array, dimension (ldx21, q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx21

The leading dimension of X21.

inout
X22

Complex*16 array, dimension (ldx22, m-q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx22

The leading dimension of X22.

out
theta

Single precision array, dimension (r), where 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)) ).

out
U1

If jobu1 = ‘Y’, U1 contains the P-by-P unitary matrix U1.

in
ldu1

The leading dimension of U1.

out
U2

If jobu2 = ‘Y’, U2 contains the (M-P)-by-(M-P) unitary matrix U2.

in
ldu2

The leading dimension of U2.

out
V1T

If jobv1t = ‘Y’, V1T contains the Q-by-Q unitary matrix V1**H.

in
ldv1t

The leading dimension of V1T.

out
V2T

If jobv2t = ‘Y’, V2T contains the (M-Q)-by-(M-Q) unitary matrix V2**H.

in
ldv2t

The leading dimension of V2T.

out
work

Complex*16 array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1, a workspace query is assumed.

out
rwork

Single precision array, dimension (max(1, lrwork)). On exit, if info = 0, rwork[0] returns the optimal lrwork.

in
lrwork

The dimension of the array rwork. If lrwork = -1, a workspace query is assumed.

out
iwork

Integer array, dimension (m - min(p, m-p, q, m-q)).

out
info

  • = 0: successful exit.

  • < 0: if info = -i, the i-th argument had an illegal value.

  • > 0: CBBCSD did not converge.

Functions

void zuncsd(
    const char*          jobu1,
    const char*          jobu2,
    const char*          jobv1t,
    const char*          jobv2t,
    const char*          trans,
    const char*          signs,
    const INT            m,
    const INT            p,
    const INT            q,
          c128*          X11,
    const INT            ldx11,
          c128*          X12,
    const INT            ldx12,
          c128*          X21,
    const INT            ldx21,
          c128*          X22,
    const INT            ldx22,
          f64*  restrict theta,
          c128* restrict U1,
    const INT            ldu1,
          c128* restrict U2,
    const INT            ldu2,
          c128* restrict V1T,
    const INT            ldv1t,
          c128* restrict V2T,
    const INT            ldv2t,
          c128* restrict work,
    const INT            lwork,
          f64*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
          INT*           info
);
void zuncsd(const char *jobu1, const char *jobu2, const char *jobv1t, const char *jobv2t, const char *trans, const char *signs, const INT m, const INT p, const INT q, c128 *X11, const INT ldx11, c128 *X12, const INT ldx12, c128 *X21, const INT ldx21, c128 *X22, const INT ldx22, f64 *restrict theta, c128 *restrict U1, const INT ldu1, c128 *restrict U2, const INT ldu2, c128 *restrict V1T, const INT ldv1t, c128 *restrict V2T, const INT ldv2t, c128 *restrict work, const INT lwork, f64 *restrict rwork, const INT lrwork, INT *restrict iwork, INT *info)#

ZUNCSD computes the CS decomposition of an M-by-M partitioned 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 |    ]**H
X = [——–&#8212;] = [——&#8212;] [——————&#8212;] [——&#8212;] . [ 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 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

in
jobu1

= ‘Y’: U1 is computed; otherwise: U1 is not computed.

in
jobu2

= ‘Y’: U2 is computed; otherwise: U2 is not computed.

in
jobv1t

= ‘Y’: V1T is computed; otherwise: V1T is not computed.

in
jobv2t

= ‘Y’: V2T is computed; otherwise: V2T is not computed.

in
trans

= ‘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.

in
signs

= ‘O’: The lower-left block is made nonpositive (“other” convention); otherwise: The upper-right block is made nonpositive (“default” convention).

in
m

The number of rows and columns in X.

in
p

The number of rows in X11 and X12. 0 <= p <= m.

in
q

The number of columns in X11 and X21. 0 <= q <= m.

inout
X11

Complex*16 array, dimension (ldx11, q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx11

The leading dimension of X11.

inout
X12

Complex*16 array, dimension (ldx12, m-q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx12

The leading dimension of X12.

inout
X21

Complex*16 array, dimension (ldx21, q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx21

The leading dimension of X21.

inout
X22

Complex*16 array, dimension (ldx22, m-q). On entry, part of the unitary matrix whose CSD is desired.

in
ldx22

The leading dimension of X22.

out
theta

Double precision array, dimension (r), where 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)) ).

out
U1

If jobu1 = ‘Y’, U1 contains the P-by-P unitary matrix U1.

in
ldu1

The leading dimension of U1.

out
U2

If jobu2 = ‘Y’, U2 contains the (M-P)-by-(M-P) unitary matrix U2.

in
ldu2

The leading dimension of U2.

out
V1T

If jobv1t = ‘Y’, V1T contains the Q-by-Q unitary matrix V1**H.

in
ldv1t

The leading dimension of V1T.

out
V2T

If jobv2t = ‘Y’, V2T contains the (M-Q)-by-(M-Q) unitary matrix V2**H.

in
ldv2t

The leading dimension of V2T.

out
work

Complex*16 array, dimension (max(1, lwork)). On exit, if info = 0, work[0] returns the optimal lwork.

in
lwork

The dimension of the array work. If lwork = -1, a workspace query is assumed.

out
rwork

Double precision array, dimension (max(1, lrwork)). On exit, if info = 0, rwork[0] returns the optimal lrwork.

in
lrwork

The dimension of the array rwork. If lrwork = -1, a workspace query is assumed.

out
iwork

Integer array, dimension (m - min(p, m-p, q, m-q)).

out
info

  • = 0: successful exit.

  • < 0: if info = -i, the i-th argument had an illegal value.

  • > 0: ZBBCSD did not converge.