1- ! LAPACK interface
1+ !> Kind-agnostic LAPACK interface linking to internal or external implementations
22module la_lapack
33 use la_constants
44 use la_blas
@@ -11,52 +11,57 @@ module la_lapack
1111 use la_lapack_w
1212 implicit none(type,external)
1313 public
14-
15- !> BBCSD: computes the CS decomposition of a unitary matrix in
16- !! bidiagonal-block form,
17- !! [ B11 | B12 0 0 ]
18- !! [ 0 | 0 -I 0 ]
19- !! X = [----------------]
20- !! [ B21 | B22 0 0 ]
21- !! [ 0 | 0 0 I ]
22- !! [ C | -S 0 0 ]
23- !! [ U1 | ] [ 0 | 0 -I 0 ] [ V1 | ]**H
24- !! = [---------] [---------------] [---------] .
25- !! [ | U2 ] [ S | C 0 0 ] [ | V2 ]
26- !! [ 0 | 0 0 I ]
27- !! X is M-by-M, its top-left block is P-by-Q, and Q must be no larger
28- !! than P, M-P, or M-Q. (If Q is not the smallest index, then X must be
29- !! transposed and/or permuted. This can be done in constant time using
30- !! the TRANS and SIGNS options. See CUNCSD for details.)
31- !! The bidiagonal matrices B11, B12, B21, and B22 are represented
32- !! implicitly by angles THETA(1:Q) and PHI(1:Q-1).
33- !! The unitary matrices U1, U2, V1T, and V2T are input/output.
34- !! The input matrices are pre- or post-multiplied by the appropriate
35- !! singular vector matrices.
36- public :: bbcsd
37-
38-
39- !> BBCSD: computes the CS decomposition of a unitary matrix in
40- !! bidiagonal-block form,
41- !! [ B11 | B12 0 0 ]
42- !! [ 0 | 0 -I 0 ]
43- !! X = [----------------]
44- !! [ B21 | B22 0 0 ]
45- !! [ 0 | 0 0 I ]
46- !! [ C | -S 0 0 ]
47- !! [ U1 | ] [ 0 | 0 -I 0 ] [ V1 | ]**H
48- !! = [---------] [---------------] [---------] .
49- !! [ | U2 ] [ S | C 0 0 ] [ | V2 ]
50- !! [ 0 | 0 0 I ]
51- !! X is M-by-M, its top-left block is P-by-Q, and Q must be no larger
52- !! than P, M-P, or M-Q. (If Q is not the smallest index, then X must be
53- !! transposed and/or permuted. This can be done in constant time using
54- !! the TRANS and SIGNS options. See CUNCSD for details.)
55- !! The bidiagonal matrices B11, B12, B21, and B22 are represented
56- !! implicitly by angles THETA(1:Q) and PHI(1:Q-1).
57- !! The unitary matrices U1, U2, V1T, and V2T are input/output.
58- !! The input matrices are pre- or post-multiplied by the appropriate
59- !! singular vector matrices.
14+
15+ !> @brief BBCSD computes the CS decomposition of a unitary matrix in
16+ !> bidiagonal-block form.
17+ !>
18+ !> \f[
19+ !> \renewcommand\arraystretch{1.3}
20+ !> \left[
21+ !> \begin{array}{c|ccc}
22+ !> B_{11} & B_{12} & 0 & 0 \\
23+ !> 0 & 0 & -I & 0 \\
24+ !> \hline
25+ !> B_{21} & B_{22} & 0 & 0 \\
26+ !> 0 & 0 & 0 & I \\
27+ !> C & -S & 0 & 0
28+ !> \end{array}
29+ !> \right] =
30+ !> \left[
31+ !> \begin{array}{c|c}
32+ !> U_1 & 0 \\
33+ !> \hline
34+ !> 0 & U_2
35+ !> \end{array}
36+ !> \right]
37+ !> \left[
38+ !> \begin{array}{c|ccc}
39+ !> 0 & 0 & -I & 0 \\
40+ !> \hline
41+ !> S & C & 0 & 0 \\
42+ !> 0 & 0 & 0 & I
43+ !> \end{array}
44+ !> \right]
45+ !> \left[
46+ !> \begin{array}{c|c}
47+ !> V_1^H & 0 \\
48+ !> \hline
49+ !> 0 & V_2^H
50+ !> \end{array}
51+ !> \right]
52+ !> \f]
53+ !>
54+ !> X is \f$M \times M\f$, its top-left block is \f$P \times Q\f$, and \f$Q\f$ must be no larger
55+ !> than \f$P\f$, \f$M-P\f$, or \f$M-Q\f$. (If \f$Q\f$ is not the smallest index, then X must be
56+ !> transposed and/or permuted. This can be done in constant time using
57+ !> the TRANS and SIGNS options. See CUNCSD for details.)
58+ !>
59+ !> The bidiagonal matrices \f$B_{11}\f$, \f$B_{12}\f$, \f$B_{21}\f$, and \f$B_{22}\f$ are represented
60+ !> implicitly by angles \f$\theta(1:Q)\f$ and \f$\phi(1:Q-1)\f$.
61+ !>
62+ !> The unitary matrices \f$U_1\f$, \f$U_2\f$, \f$V_1^T\f$, and \f$V_2^T\f$ are input/output.
63+ !>
64+ !> The input matrices are pre- or post-multiplied by the appropriate singular vector matrices.
6065 interface bbcsd
6166#ifdef LA_EXTERNAL_LAPACK
6267 pure subroutine cbbcsd(jobu1,jobu2,jobv1t,jobv2t,trans,m,p,q,theta,phi, &
0 commit comments