aboutsummaryrefslogtreecommitdiff
path: root/TESTING/MATGEN
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2011-10-06 06:53:11 +0000
committerjulie <julielangou@users.noreply.github.com>2011-10-06 06:53:11 +0000
commite1d39294aee16fa6db9ba079b14442358217db71 (patch)
tree30e5aa04c1f6596991fda5334f63dfb9b8027849 /TESTING/MATGEN
parent5fe0466a14e395641f4f8a300ecc9dcb8058081b (diff)
Integrating Doxygen in comments
Diffstat (limited to 'TESTING/MATGEN')
-rw-r--r--TESTING/MATGEN/clagge.f165
-rw-r--r--TESTING/MATGEN/claghe.f147
-rw-r--r--TESTING/MATGEN/clagsy.f147
-rw-r--r--TESTING/MATGEN/clahilb.f271
-rw-r--r--TESTING/MATGEN/clakf2.f147
-rw-r--r--TESTING/MATGEN/clarge.f124
-rw-r--r--TESTING/MATGEN/clarnd.f104
-rw-r--r--TESTING/MATGEN/claror.f265
-rw-r--r--TESTING/MATGEN/clarot.f432
-rw-r--r--TESTING/MATGEN/clatm1.f221
-rw-r--r--TESTING/MATGEN/clatm2.f344
-rw-r--r--TESTING/MATGEN/clatm3.f368
-rw-r--r--TESTING/MATGEN/clatm5.f431
-rw-r--r--TESTING/MATGEN/clatm6.f270
-rw-r--r--TESTING/MATGEN/clatme.f498
-rw-r--r--TESTING/MATGEN/clatmr.f859
-rw-r--r--TESTING/MATGEN/clatms.f584
-rw-r--r--TESTING/MATGEN/clatmt.f597
-rw-r--r--TESTING/MATGEN/dlagge.f162
-rw-r--r--TESTING/MATGEN/dlagsy.f144
-rw-r--r--TESTING/MATGEN/dlahilb.f256
-rw-r--r--TESTING/MATGEN/dlakf2.f147
-rw-r--r--TESTING/MATGEN/dlaran.f88
-rw-r--r--TESTING/MATGEN/dlarge.f124
-rw-r--r--TESTING/MATGEN/dlarnd.f100
-rw-r--r--TESTING/MATGEN/dlaror.f240
-rw-r--r--TESTING/MATGEN/dlarot.f424
-rw-r--r--TESTING/MATGEN/dlatm1.f217
-rw-r--r--TESTING/MATGEN/dlatm2.f336
-rw-r--r--TESTING/MATGEN/dlatm3.f362
-rw-r--r--TESTING/MATGEN/dlatm5.f431
-rw-r--r--TESTING/MATGEN/dlatm6.f272
-rw-r--r--TESTING/MATGEN/dlatm7.f220
-rw-r--r--TESTING/MATGEN/dlatme.f558
-rw-r--r--TESTING/MATGEN/dlatmr.f822
-rw-r--r--TESTING/MATGEN/dlatms.f563
-rw-r--r--TESTING/MATGEN/dlatmt.f582
-rw-r--r--TESTING/MATGEN/slagge.f162
-rw-r--r--TESTING/MATGEN/slagsy.f144
-rw-r--r--TESTING/MATGEN/slahilb.f256
-rw-r--r--TESTING/MATGEN/slakf2.f147
-rw-r--r--TESTING/MATGEN/slaran.f88
-rw-r--r--TESTING/MATGEN/slarge.f124
-rw-r--r--TESTING/MATGEN/slarnd.f100
-rw-r--r--TESTING/MATGEN/slaror.f240
-rw-r--r--TESTING/MATGEN/slarot.f424
-rw-r--r--TESTING/MATGEN/slatm1.f217
-rw-r--r--TESTING/MATGEN/slatm2.f336
-rw-r--r--TESTING/MATGEN/slatm3.f362
-rw-r--r--TESTING/MATGEN/slatm5.f431
-rw-r--r--TESTING/MATGEN/slatm6.f272
-rw-r--r--TESTING/MATGEN/slatm7.f220
-rw-r--r--TESTING/MATGEN/slatme.f558
-rw-r--r--TESTING/MATGEN/slatmr.f822
-rw-r--r--TESTING/MATGEN/slatms.f563
-rw-r--r--TESTING/MATGEN/slatmt.f582
-rw-r--r--TESTING/MATGEN/zlagge.f165
-rw-r--r--TESTING/MATGEN/zlaghe.f147
-rw-r--r--TESTING/MATGEN/zlagsy.f147
-rw-r--r--TESTING/MATGEN/zlahilb.f271
-rw-r--r--TESTING/MATGEN/zlakf2.f147
-rw-r--r--TESTING/MATGEN/zlarge.f124
-rw-r--r--TESTING/MATGEN/zlarnd.f104
-rw-r--r--TESTING/MATGEN/zlaror.f263
-rw-r--r--TESTING/MATGEN/zlarot.f432
-rw-r--r--TESTING/MATGEN/zlatm1.f221
-rw-r--r--TESTING/MATGEN/zlatm2.f342
-rw-r--r--TESTING/MATGEN/zlatm3.f368
-rw-r--r--TESTING/MATGEN/zlatm5.f431
-rw-r--r--TESTING/MATGEN/zlatm6.f268
-rw-r--r--TESTING/MATGEN/zlatme.f498
-rw-r--r--TESTING/MATGEN/zlatmr.f859
-rw-r--r--TESTING/MATGEN/zlatms.f584
-rw-r--r--TESTING/MATGEN/zlatmt.f597
74 files changed, 14958 insertions, 9080 deletions
diff --git a/TESTING/MATGEN/clagge.f b/TESTING/MATGEN/clagge.f
index 7ba73df8..36222571 100644
--- a/TESTING/MATGEN/clagge.f
+++ b/TESTING/MATGEN/clagge.f
@@ -1,63 +1,134 @@
- SUBROUTINE CLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, KL, KU, LDA, M, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL D( * )
- COMPLEX A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b CLAGGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL D( * )
+* COMPLEX A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* CLAGGE generates a complex general m by n matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with random unitary matrices:
-* A = U*D*V. The lower and upper bandwidths may then be reduced to
-* kl and ku by additional unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAGGE generates a complex general m by n matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with random unitary matrices:
+*> A = U*D*V. The lower and upper bandwidths may then be reduced to
+*> kl and ku by additional unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* The number of rows of the matrix A. M >= 0.
-*
-* N (input) INTEGER
-* The number of columns of the matrix A. N >= 0.
-*
-* KL (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= KL <= M-1.
-*
-* KU (input) INTEGER
-* The number of nonzero superdiagonals within the band of A.
-* 0 <= KU <= N-1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of the matrix A. M >= 0.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= KL <= M-1.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> The number of nonzero superdiagonals within the band of A.
+*> 0 <= KU <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (min(M,N))
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA,N)
+*> The generated m by n matrix A.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= M.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension (M+N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) REAL array, dimension (min(M,N))
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX array, dimension (LDA,N)
-* The generated m by n matrix A.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= M.
+*> \ingroup complex_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE CLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX array, dimension (M+N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL D( * )
+ COMPLEX A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/claghe.f b/TESTING/MATGEN/claghe.f
index f9e4a03d..6cee2d60 100644
--- a/TESTING/MATGEN/claghe.f
+++ b/TESTING/MATGEN/claghe.f
@@ -1,57 +1,122 @@
- SUBROUTINE CLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL D( * )
- COMPLEX A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b CLAGHE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL D( * )
+* COMPLEX A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* CLAGHE generates a complex hermitian matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random unitary matrix:
-* A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
-* unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAGHE generates a complex hermitian matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random unitary matrix:
+*> A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
+*> unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA,N)
+*> The generated n by n hermitian matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) REAL array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX array, dimension (LDA,N)
-* The generated n by n hermitian matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE CLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL D( * )
+ COMPLEX A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/clagsy.f b/TESTING/MATGEN/clagsy.f
index 8b356c94..afa1d80c 100644
--- a/TESTING/MATGEN/clagsy.f
+++ b/TESTING/MATGEN/clagsy.f
@@ -1,57 +1,122 @@
- SUBROUTINE CLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL D( * )
- COMPLEX A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b CLAGSY
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL D( * )
+* COMPLEX A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* CLAGSY generates a complex symmetric matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random unitary matrix:
-* A = U*D*U**T. The semi-bandwidth may then be reduced to k by
-* additional unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAGSY generates a complex symmetric matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random unitary matrix:
+*> A = U*D*U**T. The semi-bandwidth may then be reduced to k by
+*> additional unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA,N)
+*> The generated n by n symmetric matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) REAL array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX array, dimension (LDA,N)
-* The generated n by n symmetric matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE CLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL D( * )
+ COMPLEX A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/clahilb.f b/TESTING/MATGEN/clahilb.f
index 174fd513..4c04f0a9 100644
--- a/TESTING/MATGEN/clahilb.f
+++ b/TESTING/MATGEN/clahilb.f
@@ -1,104 +1,167 @@
+*> \brief \b CLAHILB
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK,
+* INFO, PATH)
+*
+* .. Scalar Arguments ..
+* INTEGER N, NRHS, LDA, LDX, LDB, INFO
+* .. Array Arguments ..
+* REAL WORK(N)
+* COMPLEX A(LDA,N), X(LDX, NRHS), B(LDB, NRHS)
+* CHARACTER*3 PATH
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAHILB generates an N by N scaled Hilbert matrix in A along with
+*> NRHS right-hand sides in B and solutions in X such that A*X=B.
+*>
+*> The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
+*> entries are integers. The right-hand sides are the first NRHS
+*> columns of M * the identity matrix, and the solutions are the
+*> first NRHS columns of the inverse Hilbert matrix.
+*>
+*> The condition number of the Hilbert matrix grows exponentially with
+*> its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
+*> Hilbert matrices beyond a relatively small dimension cannot be
+*> generated exactly without extra precision. Precision is exhausted
+*> when the largest entry in the inverse Hilbert matrix is greater than
+*> 2 to the power of the number of bits in the fraction of the data type
+*> used plus one, which is 24 for single precision.
+*>
+*> In single, the generated solution is exact for N <= 6 and has
+*> small componentwise error for 7 <= N <= 11.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The dimension of the matrix A.
+*> \endverbatim
+*>
+*> \param[in] NRHS
+*> \verbatim
+*> NRHS is INTEGER
+*> The requested number of right-hand sides.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA, N)
+*> The generated scaled Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX array, dimension (LDX, NRHS)
+*> The generated exact solutions. Currently, the first NRHS
+*> columns of the inverse Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of the array X. LDX >= N.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is REAL array, dimension (LDB, NRHS)
+*> The generated right-hand sides. Currently, the first NRHS
+*> columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of the array B. LDB >= N.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> = 1: N is too large; the data is still generated but may not
+*> be not exact.
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK,
$ INFO, PATH)
-!
-! -- LAPACK auxiliary test routine (version 3.2.2) --
-! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
-! Courant Institute, Argonne National Lab, and Rice University
-* June 2010
-!
-! David Vu <dtv@cs.berkeley.edu>
-! Yozo Hida <yozo@cs.berkeley.edu>
-! Jason Riedy <ejr@cs.berkeley.edu>
-! D. Halligan <dhalligan@berkeley.edu>
-!
- IMPLICIT NONE
-! .. Scalar Arguments ..
+*
+* -- LAPACK auxiliary routine (version 3.2.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
INTEGER N, NRHS, LDA, LDX, LDB, INFO
-! .. Array Arguments ..
+* .. Array Arguments ..
REAL WORK(N)
COMPLEX A(LDA,N), X(LDX, NRHS), B(LDB, NRHS)
CHARACTER*3 PATH
-! ..
-!
-! Purpose
-! =======
-!
-! CLAHILB generates an N by N scaled Hilbert matrix in A along with
-! NRHS right-hand sides in B and solutions in X such that A*X=B.
-!
-! The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
-! entries are integers. The right-hand sides are the first NRHS
-! columns of M * the identity matrix, and the solutions are the
-! first NRHS columns of the inverse Hilbert matrix.
-!
-! The condition number of the Hilbert matrix grows exponentially with
-! its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
-! Hilbert matrices beyond a relatively small dimension cannot be
-! generated exactly without extra precision. Precision is exhausted
-! when the largest entry in the inverse Hilbert matrix is greater than
-! 2 to the power of the number of bits in the fraction of the data type
-! used plus one, which is 24 for single precision.
-!
-! In single, the generated solution is exact for N <= 6 and has
-! small componentwise error for 7 <= N <= 11.
-!
-! Arguments
-! =========
-!
-! N (input) INTEGER
-! The dimension of the matrix A.
-!
-! NRHS (input) INTEGER
-! The requested number of right-hand sides.
-!
-! A (output) COMPLEX array, dimension (LDA, N)
-! The generated scaled Hilbert matrix.
-!
-! LDA (input) INTEGER
-! The leading dimension of the array A. LDA >= N.
-!
-! X (output) COMPLEX array, dimension (LDX, NRHS)
-! The generated exact solutions. Currently, the first NRHS
-! columns of the inverse Hilbert matrix.
-!
-! LDX (input) INTEGER
-! The leading dimension of the array X. LDX >= N.
-!
-! B (output) REAL array, dimension (LDB, NRHS)
-! The generated right-hand sides. Currently, the first NRHS
-! columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
-!
-! LDB (input) INTEGER
-! The leading dimension of the array B. LDB >= N.
-!
-! WORK (workspace) REAL array, dimension (N)
-!
-!
-! INFO (output) INTEGER
-! = 0: successful exit
-! = 1: N is too large; the data is still generated but may not
-! be not exact.
-! < 0: if INFO = -i, the i-th argument had an illegal value
-!
-! =====================================================================
+* ..
+*
+* =====================================================================
-! .. Local Scalars ..
+* .. Local Scalars ..
INTEGER TM, TI, R
INTEGER M
INTEGER I, J
COMPLEX TMP
CHARACTER*2 C2
-! .. Parameters ..
-! NMAX_EXACT the largest dimension where the generated data is
-! exact.
-! NMAX_APPROX the largest dimension where the generated data has
-! a small componentwise relative error.
-! ??? complex uses how many bits ???
+* .. Parameters ..
+* NMAX_EXACT the largest dimension where the generated data is
+* exact.
+* NMAX_APPROX the largest dimension where the generated data has
+* a small componentwise relative error.
+* ??? complex uses how many bits ???
INTEGER NMAX_EXACT, NMAX_APPROX, SIZE_D
PARAMETER (NMAX_EXACT = 6, NMAX_APPROX = 11, SIZE_D = 8)
-! d's are generated from random permuation of those eight elements.
+* d's are generated from random permuation of those eight elements.
COMPLEX D1(8), D2(8), INVD1(8), INVD2(8)
DATA D1 /(-1,0),(0,1),(-1,-1),(0,-1),(1,0),(-1,1),(1,1),(1,-1)/
DATA D2 /(-1,0),(0,-1),(-1,1),(0,1),(1,0),(-1,-1),(1,-1),(1,1)/
@@ -108,17 +171,17 @@
DATA INVD2 /(-1,0),(0,1),(-.5,-.5),(0,-1),(1,0),
$ (-.5,.5),(.5,.5),(.5,-.5)/
-! ..
-! .. External Functions
+* ..
+* .. External Functions
EXTERNAL CLASET, LSAMEN
INTRINSIC REAL
LOGICAL LSAMEN
-! ..
-! .. Executable Statements ..
+* ..
+* .. Executable Statements ..
C2 = PATH( 2: 3 )
-!
-! Test the input arguments
-!
+*
+* Test the input arguments
+*
INFO = 0
IF (N .LT. 0 .OR. N .GT. NMAX_APPROX) THEN
INFO = -1
@@ -139,8 +202,8 @@
INFO = 1
END IF
-! Compute M = the LCM of the integers [1, 2*N-1]. The largest
-! reasonable N is small enough that integers suffice (up to N = 11).
+* Compute M = the LCM of the integers [1, 2*N-1]. The largest
+* reasonable N is small enough that integers suffice (up to N = 11).
M = 1
DO I = 2, (2*N-1)
TM = M
@@ -154,9 +217,9 @@
M = (M / TI) * I
END DO
-! Generate the scaled Hilbert matrix in A
-! If we are testing SY routines, take
-! D1_i = D2_i, else, D1_i = D2_i*
+* Generate the scaled Hilbert matrix in A
+* If we are testing SY routines, take
+* D1_i = D2_i, else, D1_i = D2_i*
IF ( LSAMEN( 2, C2, 'SY' ) ) THEN
DO J = 1, N
DO I = 1, N
@@ -173,22 +236,22 @@
END DO
END IF
-! Generate matrix B as simply the first NRHS columns of M * the
-! identity.
+* Generate matrix B as simply the first NRHS columns of M * the
+* identity.
TMP = REAL(M)
CALL CLASET('Full', N, NRHS, (0.0,0.0), TMP, B, LDB)
-! Generate the true solutions in X. Because B = the first NRHS
-! columns of M*I, the true solutions are just the first NRHS columns
-! of the inverse Hilbert matrix.
+* Generate the true solutions in X. Because B = the first NRHS
+* columns of M*I, the true solutions are just the first NRHS columns
+* of the inverse Hilbert matrix.
WORK(1) = N
DO J = 2, N
WORK(J) = ( ( (WORK(J-1)/(J-1)) * (J-1 - N) ) /(J-1) )
$ * (N +J -1)
END DO
-! If we are testing SY routines,
-! take D1_i = D2_i, else, D1_i = D2_i*
+* If we are testing SY routines,
+* take D1_i = D2_i, else, D1_i = D2_i*
IF ( LSAMEN( 2, C2, 'SY' ) ) THEN
DO J = 1, NRHS
DO I = 1, N
diff --git a/TESTING/MATGEN/clakf2.f b/TESTING/MATGEN/clakf2.f
index 6f401b04..09553ecb 100644
--- a/TESTING/MATGEN/clakf2.f
+++ b/TESTING/MATGEN/clakf2.f
@@ -1,54 +1,125 @@
- SUBROUTINE CLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDZ, M, N
-* ..
-* .. Array Arguments ..
- COMPLEX A( LDA, * ), B( LDA, * ), D( LDA, * ),
- $ E( LDA, * ), Z( LDZ, * )
-* ..
-*
+*> \brief \b CLAKF2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+* COMPLEX A( LDA, * ), B( LDA, * ), D( LDA, * ),
+* $ E( LDA, * ), Z( LDZ, * )
+* ..
+*
* Purpose
* =======
*
-* Form the 2*M*N by 2*M*N matrix
-*
-* Z = [ kron(In, A) -kron(B', Im) ]
-* [ kron(In, D) -kron(E', Im) ],
-*
-* where In is the identity matrix of size n and X' is the transpose
-* of X. kron(X, Y) is the Kronecker product between the matrices X
-* and Y.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> Form the 2*M*N by 2*M*N matrix
+*>
+*> Z = [ kron(In, A) -kron(B', Im) ]
+*> [ kron(In, D) -kron(E', Im) ],
+*>
+*> where In is the identity matrix of size n and X' is the transpose
+*> of X. kron(X, Y) is the Kronecker product between the matrices X
+*> and Y.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] A
+*> \verbatim
+*> A is COMPLEX, dimension ( LDA, M )
+*> The matrix A in the output matrix Z.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \endverbatim
+*>
+*> \param[in] B
+*> \verbatim
+*> B is COMPLEX, dimension ( LDA, N )
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX, dimension ( LDA, M )
+*> \endverbatim
+*>
+*> \param[in] E
+*> \verbatim
+*> E is COMPLEX, dimension ( LDA, N )
+*> \endverbatim
+*> \verbatim
+*> The matrices used in forming the output matrix Z.
+*> \endverbatim
+*>
+*> \param[out] Z
+*> \verbatim
+*> Z is COMPLEX, dimension ( LDZ, 2*M*N )
+*> The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+*> \endverbatim
+*>
+*> \param[in] LDZ
+*> \verbatim
+*> LDZ is INTEGER
+*> The leading dimension of Z. ( LDZ >= 2*M*N )
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* N (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input) COMPLEX, dimension ( LDA, M )
-* The matrix A in the output matrix Z.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \ingroup complex_matgen
*
-* B (input) COMPLEX, dimension ( LDA, N )
-* D (input) COMPLEX, dimension ( LDA, M )
-* E (input) COMPLEX, dimension ( LDA, N )
-* The matrices used in forming the output matrix Z.
+* =====================================================================
+ SUBROUTINE CLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
*
-* Z (output) COMPLEX, dimension ( LDZ, 2*M*N )
-* The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* LDZ (input) INTEGER
-* The leading dimension of Z. ( LDZ >= 2*M*N )
+* .. Scalar Arguments ..
+ INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+ COMPLEX A( LDA, * ), B( LDA, * ), D( LDA, * ),
+ $ E( LDA, * ), Z( LDZ, * )
+* ..
*
* ====================================================================
*
diff --git a/TESTING/MATGEN/clarge.f b/TESTING/MATGEN/clarge.f
index f44a64c8..93b9ee8a 100644
--- a/TESTING/MATGEN/clarge.f
+++ b/TESTING/MATGEN/clarge.f
@@ -1,48 +1,106 @@
- SUBROUTINE CLARGE( N, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- COMPLEX A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b CLARGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLARGE( N, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* CLARGE pre- and post-multiplies a complex general n by n matrix A
-* with a random unitary matrix: A = U*D*U'.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLARGE pre- and post-multiplies a complex general n by n matrix A
+*> with a random unitary matrix: A = U*D*U'.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA,N)
+*> On entry, the original n by n matrix A.
+*> On exit, A is overwritten by U*A*U' for some random
+*> unitary matrix U.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input/output) COMPLEX array, dimension (LDA,N)
-* On entry, the original n by n matrix A.
-* On exit, A is overwritten by U*A*U' for some random
-* unitary matrix U.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE CLARGE( N, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ COMPLEX A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/clarnd.f b/TESTING/MATGEN/clarnd.f
index ac8117ba..46fa07ac 100644
--- a/TESTING/MATGEN/clarnd.f
+++ b/TESTING/MATGEN/clarnd.f
@@ -1,45 +1,95 @@
- COMPLEX FUNCTION CLARND( IDIST, ISEED )
+*> \brief \b CLARND
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Scalar Arguments ..
- INTEGER IDIST
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
*
+* COMPLEX FUNCTION CLARND( IDIST, ISEED )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* CLARND returns a random complex number from a uniform or normal
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLARND returns a random complex number from a uniform or normal
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* IDIST (input) INTEGER
-* Specifies the distribution of the random numbers:
-* = 1: real and imaginary parts each uniform (0,1)
-* = 2: real and imaginary parts each uniform (-1,1)
-* = 3: real and imaginary parts each normal (0,1)
-* = 4: uniformly distributed on the disc abs(z) <= 1
-* = 5: uniformly distributed on the circle abs(z) = 1
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> Specifies the distribution of the random numbers:
+*> = 1: real and imaginary parts each uniform (0,1)
+*> = 2: real and imaginary parts each uniform (-1,1)
+*> = 3: real and imaginary parts each normal (0,1)
+*> = 4: uniformly distributed on the disc abs(z) <= 1
+*> = 5: uniformly distributed on the circle abs(z) = 1
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine calls the auxiliary routine SLARAN to generate a random
+*> real number from a uniform (0,1) distribution. The Box-Muller method
+*> is used to transform numbers from a uniform to a normal distribution.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ COMPLEX FUNCTION CLARND( IDIST, ISEED )
*
-* This routine calls the auxiliary routine SLARAN to generate a random
-* real number from a uniform (0,1) distribution. The Box-Muller method
-* is used to transform numbers from a uniform to a normal distribution.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
+ INTEGER IDIST
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/claror.f b/TESTING/MATGEN/claror.f
index d1d04d26..495976db 100644
--- a/TESTING/MATGEN/claror.f
+++ b/TESTING/MATGEN/claror.f
@@ -1,8 +1,172 @@
+*> \brief \b CLAROR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER INIT, SIDE
+* INTEGER INFO, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX A( LDA, * ), X( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAROR pre- or post-multiplies an M by N matrix A by a random
+*> unitary matrix U, overwriting A. A may optionally be
+*> initialized to the identity matrix before multiplying by U.
+*> U is generated using the method of G.W. Stewart
+*> ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ).
+*> (BLAS-2 version)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] SIDE
+*> \verbatim
+*> SIDE is CHARACTER*1
+*> SIDE specifies whether A is multiplied on the left or right
+*> by U.
+*> SIDE = 'L' Multiply A on the left (premultiply) by U
+*> SIDE = 'R' Multiply A on the right (postmultiply) by UC> SIDE = 'C' Multiply A on the left by U and the right by UC> SIDE = 'T' Multiply A on the left by U and the right by U'
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] INIT
+*> \verbatim
+*> INIT is CHARACTER*1
+*> INIT specifies whether or not A should be initialized to
+*> the identity matrix.
+*> INIT = 'I' Initialize A to (a section of) the
+*> identity matrix before applying U.
+*> INIT = 'N' No initialization. Apply U to the
+*> input matrix A.
+*> \endverbatim
+*> \verbatim
+*> INIT = 'I' may be used to generate square (i.e., unitary)
+*> or rectangular orthogonal matrices (orthogonality being
+*> in the sense of CDOTC):
+*> \endverbatim
+*> \verbatim
+*> For square matrices, M=N, and SIDE many be either 'L' or
+*> 'R'; the rows will be orthogonal to each other, as will the
+*> columns.
+*> For rectangular matrices where M < N, SIDE = 'R' will
+*> produce a dense matrix whose rows will be orthogonal and
+*> whose columns will not, while SIDE = 'L' will produce a
+*> matrix whose rows will be orthogonal, and whose first M
+*> columns will be orthogonal, the remaining columns being
+*> zero.
+*> For matrices where M > N, just use the previous
+*> explaination, interchanging 'L' and 'R' and "rows" and
+*> "columns".
+*> \endverbatim
+*> \verbatim
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX array, dimension ( LDA, N )
+*> Input and output array. Overwritten by U A ( if SIDE = 'L' )
+*> or by A U ( if SIDE = 'R' )
+*> or by U A U* ( if SIDE = 'C')
+*> or by U A U' ( if SIDE = 'T') on exit.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> Leading dimension of A. Must be at least MAX ( 1, M ).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The array elements should be between 0 and 4095;
+*> if not they will be reduced mod 4096. Also, ISEED(4) must
+*> be odd. The random number generator uses a linear
+*> congruential sequence limited to small integers, and so
+*> should produce machine independent random numbers. The
+*> values of ISEED are changed on exit, and can be used in the
+*> next call to CLAROR to continue the same random number
+*> sequence.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX array, dimension ( 3*MAX( M, N ) )
+*> Workspace. Of length:
+*> 2*M + N if SIDE = 'L',
+*> 2*N + M if SIDE = 'R',
+*> 3*N if SIDE = 'C' or 'T'.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> An error flag. It is set to:
+*> 0 if no error.
+*> 1 if CLARND returned a bad random number (installation
+*> problem)
+*> -1 if SIDE is not L, R, C, or T.
+*> -3 if M is negative.
+*> -4 if N is negative or if SIDE is C or T and N is not equal
+*> to M.
+*> -6 if LDA is less than M.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER INIT, SIDE
@@ -13,101 +177,6 @@
COMPLEX A( LDA, * ), X( * )
* ..
*
-* Purpose
-* =======
-*
-* CLAROR pre- or post-multiplies an M by N matrix A by a random
-* unitary matrix U, overwriting A. A may optionally be
-* initialized to the identity matrix before multiplying by U.
-* U is generated using the method of G.W. Stewart
-* ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ).
-* (BLAS-2 version)
-*
-* Arguments
-* =========
-*
-* SIDE (input) CHARACTER*1
-* SIDE specifies whether A is multiplied on the left or right
-* by U.
-* SIDE = 'L' Multiply A on the left (premultiply) by U
-* SIDE = 'R' Multiply A on the right (postmultiply) by U*
-* SIDE = 'C' Multiply A on the left by U and the right by U*
-* SIDE = 'T' Multiply A on the left by U and the right by U'
-* Not modified.
-*
-* INIT (input) CHARACTER*1
-* INIT specifies whether or not A should be initialized to
-* the identity matrix.
-* INIT = 'I' Initialize A to (a section of) the
-* identity matrix before applying U.
-* INIT = 'N' No initialization. Apply U to the
-* input matrix A.
-*
-* INIT = 'I' may be used to generate square (i.e., unitary)
-* or rectangular orthogonal matrices (orthogonality being
-* in the sense of CDOTC):
-*
-* For square matrices, M=N, and SIDE many be either 'L' or
-* 'R'; the rows will be orthogonal to each other, as will the
-* columns.
-* For rectangular matrices where M < N, SIDE = 'R' will
-* produce a dense matrix whose rows will be orthogonal and
-* whose columns will not, while SIDE = 'L' will produce a
-* matrix whose rows will be orthogonal, and whose first M
-* columns will be orthogonal, the remaining columns being
-* zero.
-* For matrices where M > N, just use the previous
-* explaination, interchanging 'L' and 'R' and "rows" and
-* "columns".
-*
-* Not modified.
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* A (input/output) COMPLEX array, dimension ( LDA, N )
-* Input and output array. Overwritten by U A ( if SIDE = 'L' )
-* or by A U ( if SIDE = 'R' )
-* or by U A U* ( if SIDE = 'C')
-* or by U A U' ( if SIDE = 'T') on exit.
-*
-* LDA (input) INTEGER
-* Leading dimension of A. Must be at least MAX ( 1, M ).
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The array elements should be between 0 and 4095;
-* if not they will be reduced mod 4096. Also, ISEED(4) must
-* be odd. The random number generator uses a linear
-* congruential sequence limited to small integers, and so
-* should produce machine independent random numbers. The
-* values of ISEED are changed on exit, and can be used in the
-* next call to CLAROR to continue the same random number
-* sequence.
-* Modified.
-*
-* X (workspace) COMPLEX array, dimension ( 3*MAX( M, N ) )
-* Workspace. Of length:
-* 2*M + N if SIDE = 'L',
-* 2*N + M if SIDE = 'R',
-* 3*N if SIDE = 'C' or 'T'.
-* Modified.
-*
-* INFO (output) INTEGER
-* An error flag. It is set to:
-* 0 if no error.
-* 1 if CLARND returned a bad random number (installation
-* problem)
-* -1 if SIDE is not L, R, C, or T.
-* -3 if M is negative.
-* -4 if N is negative or if SIDE is C or T and N is not equal
-* to M.
-* -6 if LDA is less than M.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clarot.f b/TESTING/MATGEN/clarot.f
index f73d10b4..0060bf6c 100644
--- a/TESTING/MATGEN/clarot.f
+++ b/TESTING/MATGEN/clarot.f
@@ -1,9 +1,248 @@
+*> \brief \b CLAROT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+* XRIGHT )
+*
+* .. Scalar Arguments ..
+* LOGICAL LLEFT, LRIGHT, LROWS
+* INTEGER LDA, NL
+* COMPLEX C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+* COMPLEX A( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLAROT applies a (Givens) rotation to two adjacent rows or
+*> columns, where one element of the first and/or last column/row
+*> for use on matrices stored in some format other than GE, so
+*> that elements of the matrix may be used or modified for which
+*> no array element is provided.
+*>
+*> One example is a symmetric matrix in SB format (bandwidth=4), for
+*> which UPLO='L': Two adjacent rows will have the format:
+*>
+*> row j: C> C> C> C> C> . . . .
+*> row j+1: C> C> C> C> C> . . . .
+*>
+*> '*' indicates elements for which storage is provided,
+*> '.' indicates elements for which no storage is provided, but
+*> are not necessarily zero; their values are determined by
+*> symmetry. ' ' indicates elements which are necessarily zero,
+*> and have no storage provided.
+*>
+*> Those columns which have two '*'s can be handled by SROT.
+*> Those columns which have no '*'s can be ignored, since as long
+*> as the Givens rotations are carefully applied to preserve
+*> symmetry, their values are determined.
+*> Those columns which have one '*' have to be handled separately,
+*> by using separate variables "p" and "q":
+*>
+*> row j: C> C> C> C> C> p . . .
+*> row j+1: q C> C> C> C> C> . . . .
+*>
+*> The element p would have to be set correctly, then that column
+*> is rotated, setting p to its new value. The next call to
+*> CLAROT would rotate columns j and j+1, using p, and restore
+*> symmetry. The element q would start out being zero, and be
+*> made non-zero by the rotation. Later, rotations would presumably
+*> be chosen to zero q out.
+*>
+*> Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
+*> ------- ------- ---------
+*>
+*> General dense matrix:
+*>
+*> CALL CLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
+*> A(i,1),LDA, DUMMY, DUMMY)
+*>
+*> General banded matrix in GB format:
+*>
+*> j = MAX(1, i-KL )
+*> NL = MIN( N, i+KU+1 ) + 1-j
+*> CALL CLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
+*> A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,KL+1) ]
+*>
+*> Symmetric banded matrix in SY format, bandwidth K,
+*> lower triangle only:
+*>
+*> j = MAX(1, i-K )
+*> NL = MIN( K+1, i ) + 1
+*> CALL CLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
+*> A(i,j), LDA, XLEFT, XRIGHT )
+*>
+*> Same, but upper triangle only:
+*>
+*> NL = MIN( K+1, N-i ) + 1
+*> CALL CLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
+*> A(i,i), LDA, XLEFT, XRIGHT )
+*>
+*> Symmetric banded matrix in SB format, bandwidth K,
+*> lower triangle only:
+*>
+*> [ same as for SY, except:]
+*> . . . .
+*> A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,K+1) ]
+*>
+*> Same, but upper triangle only:
+*> . . .
+*> A(K+1,i), LDA-1, XLEFT, XRIGHT )
+*>
+*> Rotating columns is just the transpose of rotating rows, except
+*> for GB and SB: (rotating columns i and i+1)
+*>
+*> GB:
+*> j = MAX(1, i-KU )
+*> NL = MIN( N, i+KL+1 ) + 1-j
+*> CALL CLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
+*> A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> [note that KU+j+1-i is just MAX(1,KU+2-i)]
+*>
+*> SB: (upper triangle)
+*>
+*> . . . . . .
+*> A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> SB: (lower triangle)
+*>
+*> . . . . . .
+*> A(1,i),LDA-1, XTOP, XBOTTM )
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \verbatim
+*> LROWS - LOGICAL
+*> If .TRUE., then CLAROT will rotate two rows. If .FALSE.,
+*> then it will rotate two columns.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LLEFT - LOGICAL
+*> If .TRUE., then XLEFT will be used instead of the
+*> corresponding element of A for the first element in the
+*> second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
+*> If .FALSE., then the corresponding element of A will be
+*> used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LRIGHT - LOGICAL
+*> If .TRUE., then XRIGHT will be used instead of the
+*> corresponding element of A for the last element in the
+*> first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
+*> .FALSE., then the corresponding element of A will be used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> NL - INTEGER
+*> The length of the rows (if LROWS=.TRUE.) or columns (if
+*> LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
+*> used, the columns/rows they are in should be included in
+*> NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
+*> least 2. The number of rows/columns to be rotated
+*> exclusive of those involving XLEFT and/or XRIGHT may
+*> not be negative, i.e., NL minus how many of LLEFT and
+*> LRIGHT are .TRUE. must be at least zero; if not, XERBLA
+*> will be called.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> C, S - COMPLEX
+*> Specify the Givens rotation to be applied. If LROWS is
+*> true, then the matrix ( c s )
+*> ( _ _ )
+*> (-s c ) is applied from the left;
+*> if false, then the transpose (not conjugated) thereof is
+*> applied from the right. Note that in contrast to the
+*> output of CROTG or to most versions of CROT, both C and S
+*> are complex. For a Givens rotation, |C|**2 + |S|**2 should
+*> be 1, but this is not checked.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> A - COMPLEX array.
+*> The array containing the rows/columns to be rotated. The
+*> first element of A should be the upper left element to
+*> be rotated.
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> LDA - INTEGER
+*> The "effective" leading dimension of A. If A contains
+*> a matrix stored in GE, HE, or SY format, then this is just
+*> the leading dimension of A as dimensioned in the calling
+*> routine. If A contains a matrix stored in band (GB, HB, or
+*> SB) format, then this should be *one less* than the leading
+*> dimension used in the calling routine. Thus, if A were
+*> dimensioned A(LDA,*) in CLAROT, then A(1,j) would be the
+*> j-th element in the first of the two rows to be rotated,
+*> and A(2,j) would be the j-th in the second, regardless of
+*> how the array may be stored in the calling routine. [A
+*> cannot, however, actually be dimensioned thus, since for
+*> band format, the row number may exceed LDA, which is not
+*> legal FORTRAN.]
+*> If LROWS=.TRUE., then LDA must be at least 1, otherwise
+*> it must be at least NL minus the number of .TRUE. values
+*> in XLEFT and XRIGHT.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> XLEFT - COMPLEX
+*> If LLEFT is .TRUE., then XLEFT will be used and modified
+*> instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> XRIGHT - COMPLEX
+*> If LRIGHT is .TRUE., then XRIGHT will be used and modified
+*> instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
$ XRIGHT )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
LOGICAL LLEFT, LRIGHT, LROWS
@@ -14,193 +253,6 @@
COMPLEX A( * )
* ..
*
-* Purpose
-* =======
-*
-* CLAROT applies a (Givens) rotation to two adjacent rows or
-* columns, where one element of the first and/or last column/row
-* for use on matrices stored in some format other than GE, so
-* that elements of the matrix may be used or modified for which
-* no array element is provided.
-*
-* One example is a symmetric matrix in SB format (bandwidth=4), for
-* which UPLO='L': Two adjacent rows will have the format:
-*
-* row j: * * * * * . . . .
-* row j+1: * * * * * . . . .
-*
-* '*' indicates elements for which storage is provided,
-* '.' indicates elements for which no storage is provided, but
-* are not necessarily zero; their values are determined by
-* symmetry. ' ' indicates elements which are necessarily zero,
-* and have no storage provided.
-*
-* Those columns which have two '*'s can be handled by SROT.
-* Those columns which have no '*'s can be ignored, since as long
-* as the Givens rotations are carefully applied to preserve
-* symmetry, their values are determined.
-* Those columns which have one '*' have to be handled separately,
-* by using separate variables "p" and "q":
-*
-* row j: * * * * * p . . .
-* row j+1: q * * * * * . . . .
-*
-* The element p would have to be set correctly, then that column
-* is rotated, setting p to its new value. The next call to
-* CLAROT would rotate columns j and j+1, using p, and restore
-* symmetry. The element q would start out being zero, and be
-* made non-zero by the rotation. Later, rotations would presumably
-* be chosen to zero q out.
-*
-* Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
-* ------- ------- ---------
-*
-* General dense matrix:
-*
-* CALL CLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
-* A(i,1),LDA, DUMMY, DUMMY)
-*
-* General banded matrix in GB format:
-*
-* j = MAX(1, i-KL )
-* NL = MIN( N, i+KU+1 ) + 1-j
-* CALL CLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
-* A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,KL+1) ]
-*
-* Symmetric banded matrix in SY format, bandwidth K,
-* lower triangle only:
-*
-* j = MAX(1, i-K )
-* NL = MIN( K+1, i ) + 1
-* CALL CLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
-* A(i,j), LDA, XLEFT, XRIGHT )
-*
-* Same, but upper triangle only:
-*
-* NL = MIN( K+1, N-i ) + 1
-* CALL CLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
-* A(i,i), LDA, XLEFT, XRIGHT )
-*
-* Symmetric banded matrix in SB format, bandwidth K,
-* lower triangle only:
-*
-* [ same as for SY, except:]
-* . . . .
-* A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,K+1) ]
-*
-* Same, but upper triangle only:
-* . . .
-* A(K+1,i), LDA-1, XLEFT, XRIGHT )
-*
-* Rotating columns is just the transpose of rotating rows, except
-* for GB and SB: (rotating columns i and i+1)
-*
-* GB:
-* j = MAX(1, i-KU )
-* NL = MIN( N, i+KL+1 ) + 1-j
-* CALL CLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
-* A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* [note that KU+j+1-i is just MAX(1,KU+2-i)]
-*
-* SB: (upper triangle)
-*
-* . . . . . .
-* A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* SB: (lower triangle)
-*
-* . . . . . .
-* A(1,i),LDA-1, XTOP, XBOTTM )
-*
-* Arguments
-* =========
-*
-* LROWS - LOGICAL
-* If .TRUE., then CLAROT will rotate two rows. If .FALSE.,
-* then it will rotate two columns.
-* Not modified.
-*
-* LLEFT - LOGICAL
-* If .TRUE., then XLEFT will be used instead of the
-* corresponding element of A for the first element in the
-* second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
-* If .FALSE., then the corresponding element of A will be
-* used.
-* Not modified.
-*
-* LRIGHT - LOGICAL
-* If .TRUE., then XRIGHT will be used instead of the
-* corresponding element of A for the last element in the
-* first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
-* .FALSE., then the corresponding element of A will be used.
-* Not modified.
-*
-* NL - INTEGER
-* The length of the rows (if LROWS=.TRUE.) or columns (if
-* LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
-* used, the columns/rows they are in should be included in
-* NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
-* least 2. The number of rows/columns to be rotated
-* exclusive of those involving XLEFT and/or XRIGHT may
-* not be negative, i.e., NL minus how many of LLEFT and
-* LRIGHT are .TRUE. must be at least zero; if not, XERBLA
-* will be called.
-* Not modified.
-*
-* C, S - COMPLEX
-* Specify the Givens rotation to be applied. If LROWS is
-* true, then the matrix ( c s )
-* ( _ _ )
-* (-s c ) is applied from the left;
-* if false, then the transpose (not conjugated) thereof is
-* applied from the right. Note that in contrast to the
-* output of CROTG or to most versions of CROT, both C and S
-* are complex. For a Givens rotation, |C|**2 + |S|**2 should
-* be 1, but this is not checked.
-* Not modified.
-*
-* A - COMPLEX array.
-* The array containing the rows/columns to be rotated. The
-* first element of A should be the upper left element to
-* be rotated.
-* Read and modified.
-*
-* LDA - INTEGER
-* The "effective" leading dimension of A. If A contains
-* a matrix stored in GE, HE, or SY format, then this is just
-* the leading dimension of A as dimensioned in the calling
-* routine. If A contains a matrix stored in band (GB, HB, or
-* SB) format, then this should be *one less* than the leading
-* dimension used in the calling routine. Thus, if A were
-* dimensioned A(LDA,*) in CLAROT, then A(1,j) would be the
-* j-th element in the first of the two rows to be rotated,
-* and A(2,j) would be the j-th in the second, regardless of
-* how the array may be stored in the calling routine. [A
-* cannot, however, actually be dimensioned thus, since for
-* band format, the row number may exceed LDA, which is not
-* legal FORTRAN.]
-* If LROWS=.TRUE., then LDA must be at least 1, otherwise
-* it must be at least NL minus the number of .TRUE. values
-* in XLEFT and XRIGHT.
-* Not modified.
-*
-* XLEFT - COMPLEX
-* If LLEFT is .TRUE., then XLEFT will be used and modified
-* instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
-* (if LROWS=.FALSE.).
-* Read and modified.
-*
-* XRIGHT - COMPLEX
-* If LRIGHT is .TRUE., then XRIGHT will be used and modified
-* instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
-* (if LROWS=.FALSE.).
-* Read and modified.
-*
* =====================================================================
*
* .. Local Scalars ..
diff --git a/TESTING/MATGEN/clatm1.f b/TESTING/MATGEN/clatm1.f
index 6d5bc37c..86ea9370 100644
--- a/TESTING/MATGEN/clatm1.f
+++ b/TESTING/MATGEN/clatm1.f
@@ -1,8 +1,148 @@
+*> \brief \b CLATM1
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST, INFO, IRSIGN, MODE, N
+* REAL COND
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX D( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATM1 computes the entries of D(1..N) as specified by
+*> MODE, COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. CLATM1 is called by CLATMR to generate
+*> random test matrices for LAPACK programs.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IRSIGN
+*> \verbatim
+*> IRSIGN is INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by random complex number
+*> uniformly distributed with absolute value 1
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to CLATM1
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 4
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
INTEGER IDIST, INFO, IRSIGN, MODE, N
@@ -13,81 +153,6 @@
COMPLEX D( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATM1 computes the entries of D(1..N) as specified by
-* MODE, COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. CLATM1 is called by CLATMR to generate
-* random test matrices for LAPACK programs.
-*
-* Arguments
-* =========
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN (input) INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by random complex number
-* uniformly distributed with absolute value 1
-*
-* IDIST (input) CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to CLATM1
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) COMPLEX array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N (input) INTEGER
-* Number of entries of D. Not modified.
-*
-* INFO (output) INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 4
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatm2.f b/TESTING/MATGEN/clatm2.f
index 310a55bc..76e053bf 100644
--- a/TESTING/MATGEN/clatm2.f
+++ b/TESTING/MATGEN/clatm2.f
@@ -1,9 +1,223 @@
+*> \brief \b CLATM2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* COMPLEX FUNCTION CLATM2( M, N, I, J, KL, KU, IDIST, ISEED, D,
+* IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, J, KL, KU, M, N
+* REAL SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* COMPLEX D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATM2 returns the (I,J) entry of a random matrix of dimension
+*> (M, N) described by the other paramters. It is called by the
+*> CLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by CLATMR which has already checked the parameters.
+*>
+*> Use of CLATM2 differs from CLATM3 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With CLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With CLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, CLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. CLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*>
+*> The matrix whose (I,J) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If I is outside (1..M) or J is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0 , 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> 6 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is COMPLEX array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is COMPLEX array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) in position K was originally in
+*> position IWORK( K ).
+*> This differs from IWORK for CLATM3. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL
+*> Value between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
COMPLEX FUNCTION CLATM2( M, N, I, J, KL, KU, IDIST, ISEED, D,
$ IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -17,130 +231,6 @@
COMPLEX D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATM2 returns the (I,J) entry of a random matrix of dimension
-* (M, N) described by the other paramters. It is called by the
-* CLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by CLATMR which has already checked the parameters.
-*
-* Use of CLATM2 differs from CLATM3 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With CLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With CLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, CLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. CLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-*
-* The matrix whose (I,J) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If I is outside (1..M) or J is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of entry to be returned. Not modified.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0 , 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) COMPLEX array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* 6 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) COMPLEX array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) COMPLEX array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (workspace) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) in position K was originally in
-* position IWORK( K ).
-* This differs from IWORK for CLATM3. Not modified.
-*
-* SPARSE (input) REAL
-* Value between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatm3.f b/TESTING/MATGEN/clatm3.f
index c0354411..f2d9782a 100644
--- a/TESTING/MATGEN/clatm3.f
+++ b/TESTING/MATGEN/clatm3.f
@@ -1,10 +1,240 @@
+*> \brief \b CLATM3
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* COMPLEX FUNCTION CLATM3( M, N, I, J, ISUB, JSUB, KL, KU, IDIST,
+* ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
+* SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, ISUB, J, JSUB, KL,
+* $ KU, M, N
+* REAL SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* COMPLEX D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATM3 returns the (ISUB,JSUB) entry of a random matrix of
+*> dimension (M, N) described by the other paramters. (ISUB,JSUB)
+*> is the final position of the (I,J) entry after pivoting
+*> according to IPVTNG and IWORK. CLATM3 is called by the
+*> CLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by CLATMR which has already checked the parameters.
+*>
+*> Use of CLATM3 differs from CLATM2 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With CLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With CLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, CLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. CLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*> in different orders for different pivot orders).
+*>
+*> The matrix whose (ISUB,JSUB) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISUB
+*> \verbatim
+*> ISUB is INTEGER
+*> Row of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] JSUB
+*> \verbatim
+*> JSUB is INTEGER
+*> Column of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0 , 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> 6 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is COMPLEX array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is COMPLEX array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) originally in position K is in
+*> position IWORK( K ) after pivoting.
+*> This differs from IWORK for CLATM2. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
COMPLEX FUNCTION CLATM3( M, N, I, J, ISUB, JSUB, KL, KU, IDIST,
$ ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
$ SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -19,138 +249,6 @@
COMPLEX D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATM3 returns the (ISUB,JSUB) entry of a random matrix of
-* dimension (M, N) described by the other paramters. (ISUB,JSUB)
-* is the final position of the (I,J) entry after pivoting
-* according to IPVTNG and IWORK. CLATM3 is called by the
-* CLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by CLATMR which has already checked the parameters.
-*
-* Use of CLATM3 differs from CLATM2 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With CLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With CLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, CLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. CLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-* in different orders for different pivot orders).
-*
-* The matrix whose (ISUB,JSUB) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of unpivoted entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of unpivoted entry to be returned. Not modified.
-*
-* ISUB (input/output) INTEGER
-* Row of pivoted entry to be returned. Changed on exit.
-*
-* JSUB (input/output) INTEGER
-* Column of pivoted entry to be returned. Changed on exit.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0 , 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) COMPLEX array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* 6 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) COMPLEX array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) COMPLEX array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (input) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) originally in position K is in
-* position IWORK( K ) after pivoting.
-* This differs from IWORK for CLATM2. Not modified.
-*
-* SPARSE (input) REAL between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatm5.f b/TESTING/MATGEN/clatm5.f
index 8fcc6006..b49e5c91 100644
--- a/TESTING/MATGEN/clatm5.f
+++ b/TESTING/MATGEN/clatm5.f
@@ -1,177 +1,292 @@
- SUBROUTINE CLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
- $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
- $ QBLCKB )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
- $ PRTYPE, QBLCKA, QBLCKB
- REAL ALPHA
-* ..
-* .. Array Arguments ..
- COMPLEX A( LDA, * ), B( LDB, * ), C( LDC, * ),
- $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
- $ L( LDL, * ), R( LDR, * )
-* ..
-*
+*> \brief \b CLATM5
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+* E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+* QBLCKB )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+* $ PRTYPE, QBLCKA, QBLCKB
+* REAL ALPHA
+* ..
+* .. Array Arguments ..
+* COMPLEX A( LDA, * ), B( LDB, * ), C( LDC, * ),
+* $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+* $ L( LDL, * ), R( LDR, * )
+* ..
+*
* Purpose
* =======
*
-* CLATM5 generates matrices involved in the Generalized Sylvester
-* equation:
-*
-* A * R - L * B = C
-* D * R - L * E = F
-*
-* They also satisfy (the diagonalization condition)
-*
-* [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
-* [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
-*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATM5 generates matrices involved in the Generalized Sylvester
+*> equation:
+*>
+*> A * R - L * B = C
+*> D * R - L * E = F
+*>
+*> They also satisfy (the diagonalization condition)
+*>
+*> [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
+*> [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
+*>
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* PRTYPE (input) INTEGER
-* "Points" to a certian type of the matrices to generate
-* (see futher details).
-*
-* M (input) INTEGER
-* Specifies the order of A and D and the number of rows in
-* C, F, R and L.
-*
-* N (input) INTEGER
-* Specifies the order of B and E and the number of columns in
-* C, F, R and L.
-*
-* A (output) COMPLEX array, dimension (LDA, M).
-* On exit A M-by-M is initialized according to PRTYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A.
-*
-* B (output) COMPLEX array, dimension (LDB, N).
-* On exit B N-by-N is initialized according to PRTYPE.
-*
-* LDB (input) INTEGER
-* The leading dimension of B.
-*
-* C (output) COMPLEX array, dimension (LDC, N).
-* On exit C M-by-N is initialized according to PRTYPE.
-*
-* LDC (input) INTEGER
-* The leading dimension of C.
-*
-* D (output) COMPLEX array, dimension (LDD, M).
-* On exit D M-by-M is initialized according to PRTYPE.
-*
-* LDD (input) INTEGER
-* The leading dimension of D.
-*
-* E (output) COMPLEX array, dimension (LDE, N).
-* On exit E N-by-N is initialized according to PRTYPE.
-*
-* LDE (input) INTEGER
-* The leading dimension of E.
-*
-* F (output) COMPLEX array, dimension (LDF, N).
-* On exit F M-by-N is initialized according to PRTYPE.
-*
-* LDF (input) INTEGER
-* The leading dimension of F.
-*
-* R (output) COMPLEX array, dimension (LDR, N).
-* On exit R M-by-N is initialized according to PRTYPE.
-*
-* LDR (input) INTEGER
-* The leading dimension of R.
-*
-* L (output) COMPLEX array, dimension (LDL, N).
-* On exit L M-by-N is initialized according to PRTYPE.
-*
-* LDL (input) INTEGER
-* The leading dimension of L.
+*> \param[in] PRTYPE
+*> \verbatim
+*> PRTYPE is INTEGER
+*> "Points" to a certian type of the matrices to generate
+*> (see futher details).
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Specifies the order of A and D and the number of rows in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Specifies the order of B and E and the number of columns in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA, M).
+*> On exit A M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is COMPLEX array, dimension (LDB, N).
+*> On exit B N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of B.
+*> \endverbatim
+*>
+*> \param[out] C
+*> \verbatim
+*> C is COMPLEX array, dimension (LDC, N).
+*> On exit C M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDC
+*> \verbatim
+*> LDC is INTEGER
+*> The leading dimension of C.
+*> \endverbatim
+*>
+*> \param[out] D
+*> \verbatim
+*> D is COMPLEX array, dimension (LDD, M).
+*> On exit D M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDD
+*> \verbatim
+*> LDD is INTEGER
+*> The leading dimension of D.
+*> \endverbatim
+*>
+*> \param[out] E
+*> \verbatim
+*> E is COMPLEX array, dimension (LDE, N).
+*> On exit E N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDE
+*> \verbatim
+*> LDE is INTEGER
+*> The leading dimension of E.
+*> \endverbatim
+*>
+*> \param[out] F
+*> \verbatim
+*> F is COMPLEX array, dimension (LDF, N).
+*> On exit F M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDF
+*> \verbatim
+*> LDF is INTEGER
+*> The leading dimension of F.
+*> \endverbatim
+*>
+*> \param[out] R
+*> \verbatim
+*> R is COMPLEX array, dimension (LDR, N).
+*> On exit R M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDR
+*> \verbatim
+*> LDR is INTEGER
+*> The leading dimension of R.
+*> \endverbatim
+*>
+*> \param[out] L
+*> \verbatim
+*> L is COMPLEX array, dimension (LDL, N).
+*> On exit L M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDL
+*> \verbatim
+*> LDL is INTEGER
+*> The leading dimension of L.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is REAL
+*> Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \endverbatim
+*>
+*> \param[in] QBLCKA
+*> \verbatim
+*> QBLCKA is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in A. Otherwise, QBLCKA is not
+*> referenced. QBLCKA > 1.
+*> \endverbatim
+*>
+*> \param[in] QBLCKB
+*> \verbatim
+*> QBLCKB is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in B. Otherwise, QBLCKB is not
+*> referenced. QBLCKB > 1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* ALPHA (input) REAL
-* Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* QBLCKA (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in A. Otherwise, QBLCKA is not
-* referenced. QBLCKA > 1.
+*> \date November 2011
*
-* QBLCKB (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in B. Otherwise, QBLCKB is not
-* referenced. QBLCKB > 1.
+*> \ingroup complex_matgen
*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
+*>
+*> A : if (i == j) then A(i, j) = 1.0
+*> if (j == i + 1) then A(i, j) = -1.0
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> B : if (i == j) then B(i, j) = 1.0 - ALPHA
+*> if (j == i + 1) then B(i, j) = 1.0
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> D : if (i == j) then D(i, j) = 1.0
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*> E : if (i == j) then E(i, j) = 1.0
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L = R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
+*>
+*> A : if (i <= j) then A(i, j) = [-1...1]
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> if (PRTYPE = 3) then
+*> A(k + 1, k + 1) = A(k, k)
+*> A(k + 1, k) = [-1...1]
+*> sign(A(k, k + 1) = -(sin(A(k + 1, k))
+*> k = 1, M - 1, QBLCKA
+*>
+*> B : if (i <= j) then B(i, j) = [-1...1]
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> if (PRTYPE = 3) then
+*> B(k + 1, k + 1) = B(k, k)
+*> B(k + 1, k) = [-1...1]
+*> sign(B(k, k + 1) = -(sign(B(k + 1, k))
+*> k = 1, N - 1, QBLCKB
+*>
+*> D : if (i <= j) then D(i, j) = [-1...1].
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*>
+*> E : if (i <= j) then D(i, j) = [-1...1]
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L, R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 4 Full
+*> A(i, j) = [-10...10]
+*> D(i, j) = [-1...1] i,j = 1...M
+*> B(i, j) = [-10...10]
+*> E(i, j) = [-1...1] i,j = 1...N
+*> R(i, j) = [-10...10]
+*> L(i, j) = [-1...1] i = 1..M ,j = 1...N
+*>
+*> L, R specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 5 special case common and/or close eigs.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ SUBROUTINE CLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+ $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+ $ QBLCKB )
*
-* PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
-*
-* A : if (i == j) then A(i, j) = 1.0
-* if (j == i + 1) then A(i, j) = -1.0
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* B : if (i == j) then B(i, j) = 1.0 - ALPHA
-* if (j == i + 1) then B(i, j) = 1.0
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* D : if (i == j) then D(i, j) = 1.0
-* else D(i, j) = 0.0, i, j = 1...M
-*
-* E : if (i == j) then E(i, j) = 1.0
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L = R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
-*
-* A : if (i <= j) then A(i, j) = [-1...1]
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* if (PRTYPE = 3) then
-* A(k + 1, k + 1) = A(k, k)
-* A(k + 1, k) = [-1...1]
-* sign(A(k, k + 1) = -(sin(A(k + 1, k))
-* k = 1, M - 1, QBLCKA
-*
-* B : if (i <= j) then B(i, j) = [-1...1]
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* if (PRTYPE = 3) then
-* B(k + 1, k + 1) = B(k, k)
-* B(k + 1, k) = [-1...1]
-* sign(B(k, k + 1) = -(sign(B(k + 1, k))
-* k = 1, N - 1, QBLCKB
-*
-* D : if (i <= j) then D(i, j) = [-1...1].
-* else D(i, j) = 0.0, i, j = 1...M
-*
-*
-* E : if (i <= j) then D(i, j) = [-1...1]
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L, R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 4 Full
-* A(i, j) = [-10...10]
-* D(i, j) = [-1...1] i,j = 1...M
-* B(i, j) = [-10...10]
-* E(i, j) = [-1...1] i,j = 1...N
-* R(i, j) = [-10...10]
-* L(i, j) = [-1...1] i = 1..M ,j = 1...N
-*
-* L, R specifies the right hand sides (C, F).
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* PRTYPE = 5 special case common and/or close eigs.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+ $ PRTYPE, QBLCKA, QBLCKB
+ REAL ALPHA
+* ..
+* .. Array Arguments ..
+ COMPLEX A( LDA, * ), B( LDB, * ), C( LDC, * ),
+ $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+ $ L( LDL, * ), R( LDR, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/clatm6.f b/TESTING/MATGEN/clatm6.f
index 5780b607..72ba4e22 100644
--- a/TESTING/MATGEN/clatm6.f
+++ b/TESTING/MATGEN/clatm6.f
@@ -1,106 +1,196 @@
- SUBROUTINE CLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
- $ BETA, WX, WY, S, DIF )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDX, LDY, N, TYPE
- COMPLEX ALPHA, BETA, WX, WY
-* ..
-* .. Array Arguments ..
- REAL DIF( * ), S( * )
- COMPLEX A( LDA, * ), B( LDA, * ), X( LDX, * ),
- $ Y( LDY, * )
-* ..
-*
+*> \brief \b CLATM6
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+* BETA, WX, WY, S, DIF )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDX, LDY, N, TYPE
+* COMPLEX ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+* REAL DIF( * ), S( * )
+* COMPLEX A( LDA, * ), B( LDA, * ), X( LDX, * ),
+* $ Y( LDY, * )
+* ..
+*
* Purpose
* =======
*
-* CLATM6 generates test matrices for the generalized eigenvalue
-* problem, their corresponding right and left eigenvector matrices,
-* and also reciprocal condition numbers for all eigenvalues and
-* the reciprocal condition numbers of eigenvectors corresponding to
-* the 1th and 5th eigenvalues.
-*
-* Test Matrices
-* =============
-*
-* Two kinds of test matrix pairs
-* (A, B) = inverse(YH) * (Da, Db) * inverse(X)
-* are used in the tests:
-*
-* Type 1:
-* Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
-* 0 2+a 0 0 0 0 1 0 0 0
-* 0 0 3+a 0 0 0 0 1 0 0
-* 0 0 0 4+a 0 0 0 0 1 0
-* 0 0 0 0 5+a , 0 0 0 0 1
-* and Type 2:
-* Da = 1+i 0 0 0 0 Db = 1 0 0 0 0
-* 0 1-i 0 0 0 0 1 0 0 0
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 (1+a)+(1+b)i 0 0 0 0 1 0
-* 0 0 0 0 (1+a)-(1+b)i, 0 0 0 0 1 .
-*
-* In both cases the same inverse(YH) and inverse(X) are used to compute
-* (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
-*
-* YH: = 1 0 -y y -y X = 1 0 -x -x x
-* 0 1 -y y -y 0 1 x -x -x
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1 0 0 0 0 1 0
-* 0 0 0 0 1, 0 0 0 0 1 , where
-*
-* a, b, x and y will have all values independently of each other.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATM6 generates test matrices for the generalized eigenvalue
+*> problem, their corresponding right and left eigenvector matrices,
+*> and also reciprocal condition numbers for all eigenvalues and
+*> the reciprocal condition numbers of eigenvectors corresponding to
+*> the 1th and 5th eigenvalues.
+*>
+*> Test Matrices
+*> =============
+*>
+*> Two kinds of test matrix pairs
+*> (A, B) = inverse(YH) * (Da, Db) * inverse(X)
+*> are used in the tests:
+*>
+*> Type 1:
+*> Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
+*> 0 2+a 0 0 0 0 1 0 0 0
+*> 0 0 3+a 0 0 0 0 1 0 0
+*> 0 0 0 4+a 0 0 0 0 1 0
+*> 0 0 0 0 5+a , 0 0 0 0 1
+*> and Type 2:
+*> Da = 1+i 0 0 0 0 Db = 1 0 0 0 0
+*> 0 1-i 0 0 0 0 1 0 0 0
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 (1+a)+(1+b)i 0 0 0 0 1 0
+*> 0 0 0 0 (1+a)-(1+b)i, 0 0 0 0 1 .
+*>
+*> In both cases the same inverse(YH) and inverse(X) are used to compute
+*> (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
+*>
+*> YH: = 1 0 -y y -y X = 1 0 -x -x x
+*> 0 1 -y y -y 0 1 x -x -x
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1 0 0 0 0 1 0
+*> 0 0 0 0 1, 0 0 0 0 1 , where
+*>
+*> a, b, x and y will have all values independently of each other.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* TYPE (input) INTEGER
-* Specifies the problem type (see futher details).
-*
-* N (input) INTEGER
-* Size of the matrices A and B.
-*
-* A (output) COMPLEX array, dimension (LDA, N).
-* On exit A N-by-N is initialized according to TYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A and of B.
-*
-* B (output) COMPLEX array, dimension (LDA, N).
-* On exit B N-by-N is initialized according to TYPE.
-*
-* X (output) COMPLEX array, dimension (LDX, N).
-* On exit X is the N-by-N matrix of right eigenvectors.
-*
-* LDX (input) INTEGER
-* The leading dimension of X.
-*
-* Y (output) COMPLEX array, dimension (LDY, N).
-* On exit Y is the N-by-N matrix of left eigenvectors.
-*
-* LDY (input) INTEGER
-* The leading dimension of Y.
+*> \param[in] TYPE
+*> \verbatim
+*> TYPE is INTEGER
+*> Specifies the problem type (see futher details).
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of the matrices A and B.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA, N).
+*> On exit A N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A and of B.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is COMPLEX array, dimension (LDA, N).
+*> On exit B N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX array, dimension (LDX, N).
+*> On exit X is the N-by-N matrix of right eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of X.
+*> \endverbatim
+*>
+*> \param[out] Y
+*> \verbatim
+*> Y is COMPLEX array, dimension (LDY, N).
+*> On exit Y is the N-by-N matrix of left eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDY
+*> \verbatim
+*> LDY is INTEGER
+*> The leading dimension of Y.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is COMPLEX
+*> \endverbatim
+*>
+*> \param[in] BETA
+*> \verbatim
+*> BETA is COMPLEX
+*> \endverbatim
+*> \verbatim
+*> Weighting constants for matrix A.
+*> \endverbatim
+*>
+*> \param[in] WX
+*> \verbatim
+*> WX is COMPLEX
+*> Constant for right eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[in] WY
+*> \verbatim
+*> WY is COMPLEX
+*> Constant for left eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[out] S
+*> \verbatim
+*> S is REAL array, dimension (N)
+*> S(i) is the reciprocal condition number for eigenvalue i.
+*> \endverbatim
+*>
+*> \param[out] DIF
+*> \verbatim
+*> DIF is REAL array, dimension (N)
+*> DIF(i) is the reciprocal condition number for eigenvector i.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* ALPHA (input) COMPLEX
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* BETA (input) COMPLEX
-* Weighting constants for matrix A.
+*> \date November 2011
*
-* WX (input) COMPLEX
-* Constant for right eigenvector matrix.
+*> \ingroup complex_matgen
*
-* WY (input) COMPLEX
-* Constant for left eigenvector matrix.
+* =====================================================================
+ SUBROUTINE CLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+ $ BETA, WX, WY, S, DIF )
*
-* S (output) REAL array, dimension (N)
-* S(i) is the reciprocal condition number for eigenvalue i.
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* DIF (output) REAL array, dimension (N)
-* DIF(i) is the reciprocal condition number for eigenvector i.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDX, LDY, N, TYPE
+ COMPLEX ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+ REAL DIF( * ), S( * )
+ COMPLEX A( LDA, * ), B( LDA, * ), X( LDX, * ),
+ $ Y( LDY, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/clatme.f b/TESTING/MATGEN/clatme.f
index ae14e829..b2499c76 100644
--- a/TESTING/MATGEN/clatme.f
+++ b/TESTING/MATGEN/clatme.f
@@ -1,12 +1,312 @@
+*> \brief \b CLATME
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATME( N, DIST, ISEED, D, MODE, COND, DMAX,
+* RSIGN,
+* UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
+* A,
+* LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, RSIGN, SIM, UPPER
+* INTEGER INFO, KL, KU, LDA, MODE, MODES, N
+* REAL ANORM, COND, CONDS
+* COMPLEX DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL DS( * )
+* COMPLEX A( LDA, * ), D( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATME generates random non-symmetric square matrices with
+*> specified eigenvalues for testing LAPACK programs.
+*>
+*> CLATME operates by applying the following sequence of
+*> operations:
+*>
+*> 1. Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and RSIGN
+*> as described below.
+*>
+*> 2. If UPPER='T', the upper triangle of A is set to random values
+*> out of distribution DIST.
+*>
+*> 3. If SIM='T', A is multiplied on the left by a random matrix
+*> X, whose singular values are specified by DS, MODES, and
+*> CONDS, and on the right by X inverse.
+*>
+*> 4. If KL < N-1, the lower bandwidth is reduced to KL using
+*> Householder transformations. If KU < N-1, the upper
+*> bandwidth is reduced to KU.
+*>
+*> 5. If ANORM is not negative, the matrix is scaled to have
+*> maximum-element-norm ANORM.
+*>
+*> (Note: since the matrix cannot be reduced beyond Hessenberg form,
+*> no packing options are available.)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns (or rows) of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values, and on the
+*> upper triangle (see UPPER).
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> 'D' => uniform on the complex disc |z| < 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to CLATME
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX array, dimension ( N )
+*> This array is used to specify the eigenvalues of A. If
+*> MODE=0, then D is assumed to contain the eigenvalues
+*> otherwise they will be computed according to MODE, COND,
+*> DMAX, and RSIGN and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is between 1 and 4, D has entries ranging
+*> from 1 to 1/COND, if between -1 and -4, D has entries
+*> ranging from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is COMPLEX
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))). Note that DMAX need not be
+*> positive or real: if DMAX is negative or complex (or zero),
+*> D will be scaled by a negative or complex number (or zero).
+*> If RSIGN='F' then the largest (absolute) eigenvalue will be
+*> equal to DMAX.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE is not 0, 6, or -6, and RSIGN='T', then the
+*> elements of D, as computed according to MODE and COND, will
+*> be multiplied by a random complex number from the unit
+*> circle |z| = 1. If RSIGN='F', they will not be. RSIGN may
+*> only have the values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] UPPER
+*> \verbatim
+*> UPPER is CHARACTER*1
+*> If UPPER='T', then the elements of A above the diagonal
+*> will be set to random numbers out of DIST. If UPPER='F',
+*> they will not. UPPER may only have the values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] SIM
+*> \verbatim
+*> SIM is CHARACTER*1
+*> If SIM='T', then A will be operated on by a "similarity
+*> transform", i.e., multiplied on the left by a matrix X and
+*> on the right by X inverse. X = U S V, where U and V are
+*> random unitary matrices and S is a (diagonal) matrix of
+*> singular values specified by DS, MODES, and CONDS. If
+*> SIM='F', then A will not be transformed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DS
+*> \verbatim
+*> DS is REAL array, dimension ( N )
+*> This array is used to specify the singular values of X,
+*> in the same way that D specifies the eigenvalues of A.
+*> If MODE=0, the DS contains the singular values, which
+*> may not be zero.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODES
+*> \verbatim
+*> MODES is INTEGER
+*> \endverbatim
+*>
+*> \param[in] CONDS
+*> \verbatim
+*> CONDS is REAL
+*> Similar to MODE and COND, but for specifying the diagonal
+*> of S. MODES=-6 and +6 are not allowed (since they would
+*> result in randomly ill-conditioned eigenvalues.)
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. KL=1
+*> specifies upper Hessenberg form. If KL is at least N-1,
+*> then A will have full lower bandwidth.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. KU=1
+*> specifies lower Hessenberg form. If KU is at least N-1,
+*> then A will have full upper bandwidth; if KU and KL
+*> are both at least N-1, then A will be dense. Only one of
+*> KU and KL may be less than N-1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is REAL
+*> If ANORM is not negative, then A will be scaled by a non-
+*> negative real number to make the maximum-element-norm of A
+*> to be ANORM.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension ( LDA, N )
+*> On exit A is the desired test matrix.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. LDA must be at least M.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension ( 3*N )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => N negative
+*> -2 => DIST illegal string
+*> -5 => MODE not in range -6 to 6
+*> -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -9 => RSIGN is not 'T' or 'F'
+*> -10 => UPPER is not 'T' or 'F'
+*> -11 => SIM is not 'T' or 'F'
+*> -12 => MODES=0 and DS has a zero singular value.
+*> -13 => MODES is not in the range -5 to 5.
+*> -14 => MODES is nonzero and CONDS is less than 1.
+*> -15 => KL is less than 1.
+*> -16 => KU is less than 1, or KL and KU are both less than
+*> N-1.
+*> -19 => LDA is less than M.
+*> 1 => Error return from CLATM1 (computing D)
+*> 2 => Cannot scale to DMAX (max. eigenvalue is 0)
+*> 3 => Error return from SLATM1 (computing DS)
+*> 4 => Error return from CLARGE
+*> 5 => Zero singular value from SLATM1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLATME( N, DIST, ISEED, D, MODE, COND, DMAX,
$ RSIGN,
$ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
$ A,
$ LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, RSIGN, SIM, UPPER
@@ -20,198 +320,6 @@
COMPLEX A( LDA, * ), D( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATME generates random non-symmetric square matrices with
-* specified eigenvalues for testing LAPACK programs.
-*
-* CLATME operates by applying the following sequence of
-* operations:
-*
-* 1. Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and RSIGN
-* as described below.
-*
-* 2. If UPPER='T', the upper triangle of A is set to random values
-* out of distribution DIST.
-*
-* 3. If SIM='T', A is multiplied on the left by a random matrix
-* X, whose singular values are specified by DS, MODES, and
-* CONDS, and on the right by X inverse.
-*
-* 4. If KL < N-1, the lower bandwidth is reduced to KL using
-* Householder transformations. If KU < N-1, the upper
-* bandwidth is reduced to KU.
-*
-* 5. If ANORM is not negative, the matrix is scaled to have
-* maximum-element-norm ANORM.
-*
-* (Note: since the matrix cannot be reduced beyond Hessenberg form,
-* no packing options are available.)
-*
-* Arguments
-* =========
-*
-* N (input) INTEGER
-* The number of columns (or rows) of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values, and on the
-* upper triangle (see UPPER).
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* 'D' => uniform on the complex disc |z| < 1.
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to CLATME
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) COMPLEX array, dimension ( N )
-* This array is used to specify the eigenvalues of A. If
-* MODE=0, then D is assumed to contain the eigenvalues
-* otherwise they will be computed according to MODE, COND,
-* DMAX, and RSIGN and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is between 1 and 4, D has entries ranging
-* from 1 to 1/COND, if between -1 and -4, D has entries
-* ranging from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) COMPLEX
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))). Note that DMAX need not be
-* positive or real: if DMAX is negative or complex (or zero),
-* D will be scaled by a negative or complex number (or zero).
-* If RSIGN='F' then the largest (absolute) eigenvalue will be
-* equal to DMAX.
-* Not modified.
-*
-* RSIGN (input) CHARACTER*1
-* If MODE is not 0, 6, or -6, and RSIGN='T', then the
-* elements of D, as computed according to MODE and COND, will
-* be multiplied by a random complex number from the unit
-* circle |z| = 1. If RSIGN='F', they will not be. RSIGN may
-* only have the values 'T' or 'F'.
-* Not modified.
-*
-* UPPER (input) CHARACTER*1
-* If UPPER='T', then the elements of A above the diagonal
-* will be set to random numbers out of DIST. If UPPER='F',
-* they will not. UPPER may only have the values 'T' or 'F'.
-* Not modified.
-*
-* SIM (input) CHARACTER*1
-* If SIM='T', then A will be operated on by a "similarity
-* transform", i.e., multiplied on the left by a matrix X and
-* on the right by X inverse. X = U S V, where U and V are
-* random unitary matrices and S is a (diagonal) matrix of
-* singular values specified by DS, MODES, and CONDS. If
-* SIM='F', then A will not be transformed.
-* Not modified.
-*
-* DS (input/output) REAL array, dimension ( N )
-* This array is used to specify the singular values of X,
-* in the same way that D specifies the eigenvalues of A.
-* If MODE=0, the DS contains the singular values, which
-* may not be zero.
-* Modified if MODE is nonzero.
-*
-* MODES (input) INTEGER
-*
-* CONDS (input) REAL
-* Similar to MODE and COND, but for specifying the diagonal
-* of S. MODES=-6 and +6 are not allowed (since they would
-* result in randomly ill-conditioned eigenvalues.)
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. KL=1
-* specifies upper Hessenberg form. If KL is at least N-1,
-* then A will have full lower bandwidth.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. KU=1
-* specifies lower Hessenberg form. If KU is at least N-1,
-* then A will have full upper bandwidth; if KU and KL
-* are both at least N-1, then A will be dense. Only one of
-* KU and KL may be less than N-1.
-* Not modified.
-*
-* ANORM (input) REAL
-* If ANORM is not negative, then A will be scaled by a non-
-* negative real number to make the maximum-element-norm of A
-* to be ANORM.
-* Not modified.
-*
-* A (output) COMPLEX array, dimension ( LDA, N )
-* On exit A is the desired test matrix.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. LDA must be at least M.
-* Not modified.
-*
-* WORK (workspace) COMPLEX array, dimension ( 3*N )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => N negative
-* -2 => DIST illegal string
-* -5 => MODE not in range -6 to 6
-* -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -9 => RSIGN is not 'T' or 'F'
-* -10 => UPPER is not 'T' or 'F'
-* -11 => SIM is not 'T' or 'F'
-* -12 => MODES=0 and DS has a zero singular value.
-* -13 => MODES is not in the range -5 to 5.
-* -14 => MODES is nonzero and CONDS is less than 1.
-* -15 => KL is less than 1.
-* -16 => KU is less than 1, or KL and KU are both less than
-* N-1.
-* -19 => LDA is less than M.
-* 1 => Error return from CLATM1 (computing D)
-* 2 => Cannot scale to DMAX (max. eigenvalue is 0)
-* 3 => Error return from SLATM1 (computing DS)
-* 4 => Error return from CLARGE
-* 5 => Zero singular value from SLATM1.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatmr.f b/TESTING/MATGEN/clatmr.f
index 6ebeb7f2..70e8bcb3 100644
--- a/TESTING/MATGEN/clatmr.f
+++ b/TESTING/MATGEN/clatmr.f
@@ -1,11 +1,504 @@
+*> \brief \b CLATMR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
+* CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
+* PACK, A, LDA, IWORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, MODEL, MODER, N
+* REAL ANORM, COND, CONDL, CONDR, SPARSE
+* COMPLEX DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER IPIVOT( * ), ISEED( 4 ), IWORK( * )
+* COMPLEX A( LDA, * ), D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATMR generates random matrices of various types for testing
+*> LAPACK programs.
+*>
+*> CLATMR operates by applying the following sequence of
+*> operations:
+*>
+*> Generate a matrix A with random entries of distribution DIST
+*> which is symmetric if SYM='S', Hermitian if SYM='H', and
+*> nonsymmetric if SYM='N'.
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX and RSIGN
+*> as described below.
+*>
+*> Grade the matrix, if desired, from the left and/or right
+*> as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
+*> MODER and CONDR also determine the grading as described
+*> below.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> PIVTNG and IPIVOT.
+*>
+*> Set random entries to zero, if desired, to get a random sparse
+*> matrix as specified by SPARSE.
+*>
+*> Make A a band matrix, if desired, by zeroing out the matrix
+*> outside a band of lower bandwidth KL and upper bandwidth KU.
+*>
+*> Scale A, if desired, to have maximum entry ANORM.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric or Hermitian)
+*> zero out lower half (if symmetric or Hermitian)
+*> store the upper half columnwise (if symmetric or Hermitian
+*> or square upper triangular)
+*> store the lower half columnwise (if symmetric or Hermitian
+*> or square lower triangular)
+*> same as upper half rowwise if symmetric
+*> same as conjugate upper half rowwise if Hermitian
+*> store the lower triangle in banded format
+*> (if symmetric or Hermitian)
+*> store the upper triangle in banded format
+*> (if symmetric or Hermitian)
+*> store the entire matrix in banded format
+*>
+*> Note: If two calls to CLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*>
+*> If two calls to CLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be and
+*> is not maintained with less than full bandwidth.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate a random matrix .
+*> 'U' => real and imaginary parts are independent
+*> UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => real and imaginary parts are independent
+*> UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => real and imaginary parts are independent
+*> NORMAL( 0, 1 ) ( 'N' for normal )
+*> 'D' => uniform on interior of unit disk ( 'D' for disk )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to CLATMR
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S', generated matrix is symmetric.
+*> If SYM='H', generated matrix is Hermitian.
+*> If SYM='N', generated matrix is nonsymmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX array, dimension (min(M,N))
+*> On entry this array specifies the diagonal entries
+*> of the diagonal of A. D may either be specified
+*> on entry, or set according to MODE and COND as described
+*> below. If the matrix is Hermitian, the real part of D
+*> will be taken. May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be used:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is COMPLEX
+*> If MODE neither -6, 0 nor 6, the diagonal is scaled by
+*> DMAX / max(abs(D(i))), so that maximum absolute entry
+*> of diagonal is abs(DMAX). If DMAX is complex (or zero),
+*> diagonal will be scaled by a complex number (or zero).
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE neither -6, 0 nor 6, specifies sign of diagonal
+*> as follows:
+*> 'T' => diagonal entries are multiplied by a random complex
+*> number uniformly distributed with absolute value 1
+*> 'F' => diagonal unchanged
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] GRADE
+*> \verbatim
+*> GRADE is CHARACTER*1
+*> Specifies grading of matrix as follows:
+*> 'N' => no grading
+*> 'L' => matrix premultiplied by diag( DL )
+*> (only if matrix nonsymmetric)
+*> 'R' => matrix postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'B' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'H' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> (only if matrix Hermitian or nonsymmetric)
+*> 'S' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> (only if matrix symmetric or nonsymmetric)
+*> 'E' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> ( 'S' for similarity )
+*> (only if matrix nonsymmetric)
+*> Note: if GRADE='S', then M must equal N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DL
+*> \verbatim
+*> DL is COMPLEX array, dimension (M)
+*> If MODEL=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODEL is not zero, then DL will be set according
+*> to MODEL and CONDL, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DL).
+*> If GRADE='E', then DL cannot have zero entries.
+*> Not referenced if GRADE = 'N' or 'R'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODEL
+*> \verbatim
+*> MODEL is INTEGER
+*> This specifies how the diagonal array DL is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDL
+*> \verbatim
+*> CONDL is REAL
+*> When MODEL is not zero, this specifies the condition number
+*> of the computed DL. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DR
+*> \verbatim
+*> DR is COMPLEX array, dimension (N)
+*> If MODER=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODER is not zero, then DR will be set according
+*> to MODER and CONDR, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DR).
+*> Not referenced if GRADE = 'N', 'L', 'H' or 'S'.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODER
+*> \verbatim
+*> MODER is INTEGER
+*> This specifies how the diagonal array DR is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDR
+*> \verbatim
+*> CONDR is REAL
+*> When MODER is not zero, this specifies the condition number
+*> of the computed DR. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PIVTNG
+*> \verbatim
+*> PIVTNG is CHARACTER*1
+*> On entry specifies pivoting permutations as follows:
+*> 'N' or ' ' => none.
+*> 'L' => left or row pivoting (matrix must be nonsymmetric).
+*> 'R' => right or column pivoting (matrix must be
+*> nonsymmetric).
+*> 'B' or 'F' => both or full pivoting, i.e., on both sides.
+*> In this case, M must equal N
+*> \endverbatim
+*> \verbatim
+*> If two calls to CLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be
+*> maintained with less than full bandwidth.
+*> \endverbatim
+*>
+*> \param[in] IPIVOT
+*> \verbatim
+*> IPIVOT is INTEGER array, dimension (N or M)
+*> This array specifies the permutation used. After the
+*> basic matrix is generated, the rows, columns, or both
+*> are permuted. If, say, row pivoting is selected, CLATMR
+*> starts with the *last* row and interchanges the M-th and
+*> IPIVOT(M)-th rows, then moves to the next-to-last row,
+*> interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
+*> and so on. In terms of "2-cycles", the permutation is
+*> (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
+*> where the rightmost cycle is applied first. This is the
+*> *inverse* of the effect of pivoting in LINPACK. The idea
+*> is that factoring (with pivoting) an identity matrix
+*> which has been inverse-pivoted in this way should
+*> result in a pivot vector identical to IPIVOT.
+*> Not referenced if PIVTNG = 'N'. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL
+*> On entry specifies the sparsity of the matrix if a sparse
+*> matrix is to be generated. SPARSE should lie between
+*> 0 and 1. To generate a sparse matrix, for each matrix entry
+*> a uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> On entry specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL at least M-1 implies the matrix is not
+*> banded. Must equal KU if matrix is symmetric or Hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> On entry specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU at least N-1 implies the matrix is not
+*> banded. Must equal KL if matrix is symmetric or Hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is REAL
+*> On entry specifies maximum entry of output matrix
+*> (output matrix will by multiplied by a constant so that
+*> its largest absolute entry equal ANORM)
+*> if ANORM is nonnegative. If ANORM is negative no scaling
+*> is done. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> On entry specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries
+*> (if symmetric or Hermitian)
+*> 'L' => zero out all superdiagonal entries
+*> (if symmetric or Hermitian)
+*> 'C' => store the upper triangle columnwise
+*> (only if matrix symmetric or Hermitian or
+*> square upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if matrix symmetric or Hermitian or
+*> square lower triangular)
+*> (same as upper half rowwise if symmetric)
+*> (same as conjugate upper half rowwise if Hermitian)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or Hermitian)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or Hermitian)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, HB or TB - use 'B' or 'Q'
+*> PP, HP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to CLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA,N)
+*> On exit A is the desired test matrix. Only those
+*> entries of A which are significant on output
+*> will be referenced (even if A is in packed or band
+*> storage format). The 'unoccupied corners' of A in
+*> band format will be zeroed out.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> on entry LDA specifies the first dimension of A as
+*> declared in the calling program.
+*> If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
+*> If PACK='C' or 'R', LDA must be at least 1.
+*> If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
+*> If PACK='Z', LDA must be at least KUU+KLL+1, where
+*> KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array, dimension (N or M)
+*> Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error parameter on exit:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S' or 'H'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
+*> -11 => GRADE illegal string, or GRADE='E' and
+*> M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E'
+*> and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E'
+*> and SYM = 'S'
+*> -12 => GRADE = 'E' and DL contains zero
+*> -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
+*> 'S' or 'E'
+*> -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
+*> and MODEL neither -6, 0 nor 6
+*> -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
+*> -17 => CONDR less than 1.0, GRADE='R' or 'B', and
+*> MODER neither -6, 0 nor 6
+*> -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
+*> M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
+*> or 'H'
+*> -19 => IPIVOT contains out of range number and
+*> PIVTNG not equal to 'N'
+*> -20 => KL negative
+*> -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -22 => SPARSE not in range 0. to 1.
+*> -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
+*> and SYM='N', or PACK='C' and SYM='N' and either KL
+*> not equal to 0 or N not equal to M, or PACK='R' and
+*> SYM='N', and either KU not equal to 0 or N not equal
+*> to M
+*> -26 => LDA too small
+*> 1 => Error return from CLATM1 (computing D)
+*> 2 => Cannot scale diagonal to DMAX (max. entry is 0)
+*> 3 => Error return from CLATM1 (computing DL)
+*> 4 => Error return from CLATM1 (computing DR)
+*> 5 => ANORM is positive, but matrix constructed prior to
+*> attempting to scale it to have norm ANORM, is zero
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
$ CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
$ PACK, A, LDA, IWORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
@@ -18,366 +511,6 @@
COMPLEX A( LDA, * ), D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATMR generates random matrices of various types for testing
-* LAPACK programs.
-*
-* CLATMR operates by applying the following sequence of
-* operations:
-*
-* Generate a matrix A with random entries of distribution DIST
-* which is symmetric if SYM='S', Hermitian if SYM='H', and
-* nonsymmetric if SYM='N'.
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX and RSIGN
-* as described below.
-*
-* Grade the matrix, if desired, from the left and/or right
-* as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
-* MODER and CONDR also determine the grading as described
-* below.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* PIVTNG and IPIVOT.
-*
-* Set random entries to zero, if desired, to get a random sparse
-* matrix as specified by SPARSE.
-*
-* Make A a band matrix, if desired, by zeroing out the matrix
-* outside a band of lower bandwidth KL and upper bandwidth KU.
-*
-* Scale A, if desired, to have maximum entry ANORM.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric or Hermitian)
-* zero out lower half (if symmetric or Hermitian)
-* store the upper half columnwise (if symmetric or Hermitian
-* or square upper triangular)
-* store the lower half columnwise (if symmetric or Hermitian
-* or square lower triangular)
-* same as upper half rowwise if symmetric
-* same as conjugate upper half rowwise if Hermitian
-* store the lower triangle in banded format
-* (if symmetric or Hermitian)
-* store the upper triangle in banded format
-* (if symmetric or Hermitian)
-* store the entire matrix in banded format
-*
-* Note: If two calls to CLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-*
-* If two calls to CLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be and
-* is not maintained with less than full bandwidth.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate a random matrix .
-* 'U' => real and imaginary parts are independent
-* UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => real and imaginary parts are independent
-* UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => real and imaginary parts are independent
-* NORMAL( 0, 1 ) ( 'N' for normal )
-* 'D' => uniform on interior of unit disk ( 'D' for disk )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to CLATMR
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S', generated matrix is symmetric.
-* If SYM='H', generated matrix is Hermitian.
-* If SYM='N', generated matrix is nonsymmetric.
-* Not modified.
-*
-* D (input/output) COMPLEX array, dimension (min(M,N))
-* On entry this array specifies the diagonal entries
-* of the diagonal of A. D may either be specified
-* on entry, or set according to MODE and COND as described
-* below. If the matrix is Hermitian, the real part of D
-* will be taken. May be changed on exit if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be used:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) COMPLEX
-* If MODE neither -6, 0 nor 6, the diagonal is scaled by
-* DMAX / max(abs(D(i))), so that maximum absolute entry
-* of diagonal is abs(DMAX). If DMAX is complex (or zero),
-* diagonal will be scaled by a complex number (or zero).
-*
-* RSIGN (input) CHARACTER*1
-* If MODE neither -6, 0 nor 6, specifies sign of diagonal
-* as follows:
-* 'T' => diagonal entries are multiplied by a random complex
-* number uniformly distributed with absolute value 1
-* 'F' => diagonal unchanged
-* Not modified.
-*
-* GRADE (input) CHARACTER*1
-* Specifies grading of matrix as follows:
-* 'N' => no grading
-* 'L' => matrix premultiplied by diag( DL )
-* (only if matrix nonsymmetric)
-* 'R' => matrix postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'B' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'H' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* (only if matrix Hermitian or nonsymmetric)
-* 'S' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* (only if matrix symmetric or nonsymmetric)
-* 'E' => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* ( 'S' for similarity )
-* (only if matrix nonsymmetric)
-* Note: if GRADE='S', then M must equal N.
-* Not modified.
-*
-* DL (input/output) COMPLEX array, dimension (M)
-* If MODEL=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODEL is not zero, then DL will be set according
-* to MODEL and CONDL, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DL).
-* If GRADE='E', then DL cannot have zero entries.
-* Not referenced if GRADE = 'N' or 'R'. Changed on exit.
-*
-* MODEL (input) INTEGER
-* This specifies how the diagonal array DL is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDL (input) REAL
-* When MODEL is not zero, this specifies the condition number
-* of the computed DL. Not modified.
-*
-* DR (input/output) COMPLEX array, dimension (N)
-* If MODER=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODER is not zero, then DR will be set according
-* to MODER and CONDR, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DR).
-* Not referenced if GRADE = 'N', 'L', 'H' or 'S'.
-* Changed on exit.
-*
-* MODER (input) INTEGER
-* This specifies how the diagonal array DR is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDR (input) REAL
-* When MODER is not zero, this specifies the condition number
-* of the computed DR. Not modified.
-*
-* PIVTNG (input) CHARACTER*1
-* On entry specifies pivoting permutations as follows:
-* 'N' or ' ' => none.
-* 'L' => left or row pivoting (matrix must be nonsymmetric).
-* 'R' => right or column pivoting (matrix must be
-* nonsymmetric).
-* 'B' or 'F' => both or full pivoting, i.e., on both sides.
-* In this case, M must equal N
-*
-* If two calls to CLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be
-* maintained with less than full bandwidth.
-*
-* IPIVOT (input) INTEGER array, dimension (N or M)
-* This array specifies the permutation used. After the
-* basic matrix is generated, the rows, columns, or both
-* are permuted. If, say, row pivoting is selected, CLATMR
-* starts with the *last* row and interchanges the M-th and
-* IPIVOT(M)-th rows, then moves to the next-to-last row,
-* interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
-* and so on. In terms of "2-cycles", the permutation is
-* (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
-* where the rightmost cycle is applied first. This is the
-* *inverse* of the effect of pivoting in LINPACK. The idea
-* is that factoring (with pivoting) an identity matrix
-* which has been inverse-pivoted in this way should
-* result in a pivot vector identical to IPIVOT.
-* Not referenced if PIVTNG = 'N'. Not modified.
-*
-* SPARSE (input) REAL
-* On entry specifies the sparsity of the matrix if a sparse
-* matrix is to be generated. SPARSE should lie between
-* 0 and 1. To generate a sparse matrix, for each matrix entry
-* a uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
-* KL (input) INTEGER
-* On entry specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL at least M-1 implies the matrix is not
-* banded. Must equal KU if matrix is symmetric or Hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* On entry specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU at least N-1 implies the matrix is not
-* banded. Must equal KL if matrix is symmetric or Hermitian.
-* Not modified.
-*
-* ANORM (input) REAL
-* On entry specifies maximum entry of output matrix
-* (output matrix will by multiplied by a constant so that
-* its largest absolute entry equal ANORM)
-* if ANORM is nonnegative. If ANORM is negative no scaling
-* is done. Not modified.
-*
-* PACK (input) CHARACTER*1
-* On entry specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries
-* (if symmetric or Hermitian)
-* 'L' => zero out all superdiagonal entries
-* (if symmetric or Hermitian)
-* 'C' => store the upper triangle columnwise
-* (only if matrix symmetric or Hermitian or
-* square upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if matrix symmetric or Hermitian or
-* square lower triangular)
-* (same as upper half rowwise if symmetric)
-* (same as conjugate upper half rowwise if Hermitian)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or Hermitian)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or Hermitian)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, HB or TB - use 'B' or 'Q'
-* PP, HP or TP - use 'C' or 'R'
-*
-* If two calls to CLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX array, dimension (LDA,N)
-* On exit A is the desired test matrix. Only those
-* entries of A which are significant on output
-* will be referenced (even if A is in packed or band
-* storage format). The 'unoccupied corners' of A in
-* band format will be zeroed out.
-*
-* LDA (input) INTEGER
-* on entry LDA specifies the first dimension of A as
-* declared in the calling program.
-* If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
-* If PACK='C' or 'R', LDA must be at least 1.
-* If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
-* If PACK='Z', LDA must be at least KUU+KLL+1, where
-* KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
-* Not modified.
-*
-* IWORK (workspace) INTEGER array, dimension (N or M)
-* Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
-*
-* INFO (output) INTEGER
-* Error parameter on exit:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S' or 'H'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
-* -11 => GRADE illegal string, or GRADE='E' and
-* M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E'
-* and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E'
-* and SYM = 'S'
-* -12 => GRADE = 'E' and DL contains zero
-* -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
-* 'S' or 'E'
-* -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
-* and MODEL neither -6, 0 nor 6
-* -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
-* -17 => CONDR less than 1.0, GRADE='R' or 'B', and
-* MODER neither -6, 0 nor 6
-* -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
-* M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
-* or 'H'
-* -19 => IPIVOT contains out of range number and
-* PIVTNG not equal to 'N'
-* -20 => KL negative
-* -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -22 => SPARSE not in range 0. to 1.
-* -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
-* and SYM='N', or PACK='C' and SYM='N' and either KL
-* not equal to 0 or N not equal to M, or PACK='R' and
-* SYM='N', and either KU not equal to 0 or N not equal
-* to M
-* -26 => LDA too small
-* 1 => Error return from CLATM1 (computing D)
-* 2 => Cannot scale diagonal to DMAX (max. entry is 0)
-* 3 => Error return from CLATM1 (computing DL)
-* 4 => Error return from CLATM1 (computing DR)
-* 5 => ANORM is positive, but matrix constructed prior to
-* attempting to scale it to have norm ANORM, is zero
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatms.f b/TESTING/MATGEN/clatms.f
index 7fb5c495..7b206d7a 100644
--- a/TESTING/MATGEN/clatms.f
+++ b/TESTING/MATGEN/clatms.f
@@ -1,9 +1,345 @@
+*> \brief \b CLATMS
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, PACK, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, N
+* REAL COND, DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL D( * )
+* COMPLEX A( LDA, * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATMS generates random matrices with specified singular values
+*> (or hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> CLATMS operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then convert
+*> the bandwidth-1 to a bandwidth-2 matrix, etc. Note
+*> that for reasonably small bandwidths (relative to M and
+*> N) this requires less storage, as a dense matrix is not
+*> generated. Also, for hermitian or symmetric matrices,
+*> only one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if hermitian)
+*> zero out lower half (if hermitian)
+*> store the upper half columnwise (if hermitian or upper
+*> triangular)
+*> store the lower half columnwise (if hermitian or lower
+*> triangular)
+*> store the lower triangle in banded format (if hermitian or
+*> lower triangular)
+*> store the upper triangle in banded format (if hermitian or
+*> upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. N must equal M if the matrix
+*> is symmetric or hermitian (i.e., if SYM is not 'N')
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to CLATMS
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='H', the generated matrix is hermitian, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is hermitian, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> If SYM='S', the generated matrix is (complex) symmetric,
+*> with singular values specified by D, COND, MODE, and
+*> DMAX; they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( MIN( M, N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric
+*> or hermitian)
+*> 'L' => zero out all superdiagonal entries (if symmetric
+*> or hermitian)
+*> 'C' => store the upper triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or upper triangular)
+*> 'R' => store the lower triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB, HB, or TB - use 'B' or 'Q'
+*> PP, SP, HB, or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to CLATMS differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension ( 3*MAX( N, M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM is not 'N' and KU is not equal to
+*> KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from SLATM1
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from CLAGGE, CLAGHE or CLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, PACK, SYM
@@ -16,248 +352,6 @@
COMPLEX A( LDA, * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* CLATMS generates random matrices with specified singular values
-* (or hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* CLATMS operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then convert
-* the bandwidth-1 to a bandwidth-2 matrix, etc. Note
-* that for reasonably small bandwidths (relative to M and
-* N) this requires less storage, as a dense matrix is not
-* generated. Also, for hermitian or symmetric matrices,
-* only one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if hermitian)
-* zero out lower half (if hermitian)
-* store the upper half columnwise (if hermitian or upper
-* triangular)
-* store the lower half columnwise (if hermitian or lower
-* triangular)
-* store the lower triangle in banded format (if hermitian or
-* lower triangular)
-* store the upper triangle in banded format (if hermitian or
-* upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. N must equal M if the matrix
-* is symmetric or hermitian (i.e., if SYM is not 'N')
-* Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to CLATMS
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='H', the generated matrix is hermitian, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is hermitian, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* If SYM='S', the generated matrix is (complex) symmetric,
-* with singular values specified by D, COND, MODE, and
-* DMAX; they will not be negative.
-* Not modified.
-*
-* D (input/output) REAL array, dimension ( MIN( M, N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric
-* or hermitian)
-* 'L' => zero out all superdiagonal entries (if symmetric
-* or hermitian)
-* 'C' => store the upper triangle columnwise (only if the
-* matrix is symmetric, hermitian, or upper triangular)
-* 'R' => store the lower triangle columnwise (only if the
-* matrix is symmetric, hermitian, or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB, HB, or TB - use 'B' or 'Q'
-* PP, SP, HB, or TP - use 'C' or 'R'
-*
-* If two calls to CLATMS differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) COMPLEX array, dimension ( 3*MAX( N, M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM is not 'N' and KU is not equal to
-* KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from SLATM1
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from CLAGGE, CLAGHE or CLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/clatmt.f b/TESTING/MATGEN/clatmt.f
index 1d7a13c7..0a2542be 100644
--- a/TESTING/MATGEN/clatmt.f
+++ b/TESTING/MATGEN/clatmt.f
@@ -1,9 +1,353 @@
+*> \brief \b CLATMT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE CLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RANK, KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* REAL COND, DMAX
+* INTEGER INFO, KL, KU, LDA, M, MODE, N, RANK
+* CHARACTER DIST, PACK, SYM
+* ..
+* .. Array Arguments ..
+* COMPLEX A( LDA, * ), WORK( * )
+* REAL D( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> CLATMT generates random matrices with specified singular values
+*> (or hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> CLATMT operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then convert
+*> the bandwidth-1 to a bandwidth-2 matrix, etc. Note
+*> that for reasonably small bandwidths (relative to M and
+*> N) this requires less storage, as a dense matrix is not
+*> generated. Also, for hermitian or symmetric matrices,
+*> only one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if hermitian)
+*> zero out lower half (if hermitian)
+*> store the upper half columnwise (if hermitian or upper
+*> triangular)
+*> store the lower half columnwise (if hermitian or lower
+*> triangular)
+*> store the lower triangle in banded format (if hermitian or
+*> lower triangular)
+*> store the upper triangle in banded format (if hermitian or
+*> upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. N must equal M if the matrix
+*> is symmetric or hermitian (i.e., if SYM is not 'N')
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to CLATMT
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='H', the generated matrix is hermitian, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is hermitian, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> If SYM='S', the generated matrix is (complex) symmetric,
+*> with singular values specified by D, COND, MODE, and
+*> DMAX; they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( MIN( M, N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RANK
+*> \verbatim
+*> RANK is INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric
+*> or hermitian)
+*> 'L' => zero out all superdiagonal entries (if symmetric
+*> or hermitian)
+*> 'C' => store the upper triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or upper triangular)
+*> 'R' => store the lower triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB, HB, or TB - use 'B' or 'Q'
+*> PP, SP, HB, or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to CLATMT differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX array, dimension ( 3*MAX( N, M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM is not 'N' and KU is not equal to
+*> KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from SLATM7
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from CLAGGE, CLAGHE or CLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex_matgen
+*
+* =====================================================================
SUBROUTINE CLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RANK, KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
REAL COND, DMAX
@@ -16,253 +360,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* CLATMT generates random matrices with specified singular values
-* (or hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* CLATMT operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then convert
-* the bandwidth-1 to a bandwidth-2 matrix, etc. Note
-* that for reasonably small bandwidths (relative to M and
-* N) this requires less storage, as a dense matrix is not
-* generated. Also, for hermitian or symmetric matrices,
-* only one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if hermitian)
-* zero out lower half (if hermitian)
-* store the upper half columnwise (if hermitian or upper
-* triangular)
-* store the lower half columnwise (if hermitian or lower
-* triangular)
-* store the lower triangle in banded format (if hermitian or
-* lower triangular)
-* store the upper triangle in banded format (if hermitian or
-* upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. N must equal M if the matrix
-* is symmetric or hermitian (i.e., if SYM is not 'N')
-* Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to CLATMT
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='H', the generated matrix is hermitian, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is hermitian, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* If SYM='S', the generated matrix is (complex) symmetric,
-* with singular values specified by D, COND, MODE, and
-* DMAX; they will not be negative.
-* Not modified.
-*
-* D (input/output) REAL array, dimension ( MIN( M, N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* RANK (input) INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric
-* or hermitian)
-* 'L' => zero out all superdiagonal entries (if symmetric
-* or hermitian)
-* 'C' => store the upper triangle columnwise (only if the
-* matrix is symmetric, hermitian, or upper triangular)
-* 'R' => store the lower triangle columnwise (only if the
-* matrix is symmetric, hermitian, or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB, HB, or TB - use 'B' or 'Q'
-* PP, SP, HB, or TP - use 'C' or 'R'
-*
-* If two calls to CLATMT differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) COMPLEX array, dimension ( 3*MAX( N, M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM is not 'N' and KU is not equal to
-* KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from SLATM7
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from CLAGGE, CLAGHE or CLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlagge.f b/TESTING/MATGEN/dlagge.f
index f0ae2168..1a3b2a5c 100644
--- a/TESTING/MATGEN/dlagge.f
+++ b/TESTING/MATGEN/dlagge.f
@@ -1,62 +1,132 @@
- SUBROUTINE DLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, KL, KU, LDA, M, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
-* ..
-*
+*> \brief \b DLAGGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* DLAGGE generates a real general m by n matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with random orthogonal matrices:
-* A = U*D*V. The lower and upper bandwidths may then be reduced to
-* kl and ku by additional orthogonal transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLAGGE generates a real general m by n matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with random orthogonal matrices:
+*> A = U*D*V. The lower and upper bandwidths may then be reduced to
+*> kl and ku by additional orthogonal transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* The number of rows of the matrix A. M >= 0.
-*
-* N (input) INTEGER
-* The number of columns of the matrix A. N >= 0.
-*
-* KL (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= KL <= M-1.
-*
-* KU (input) INTEGER
-* The number of nonzero superdiagonals within the band of A.
-* 0 <= KU <= N-1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of the matrix A. M >= 0.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= KL <= M-1.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> The number of nonzero superdiagonals within the band of A.
+*> 0 <= KU <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (min(M,N))
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA,N)
+*> The generated m by n matrix A.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= M.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension (M+N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) DOUBLE PRECISION array, dimension (min(M,N))
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) DOUBLE PRECISION array, dimension (LDA,N)
-* The generated m by n matrix A.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= M.
+*> \ingroup double_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE DLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) DOUBLE PRECISION array, dimension (M+N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlagsy.f b/TESTING/MATGEN/dlagsy.f
index d9e81fbf..43853036 100644
--- a/TESTING/MATGEN/dlagsy.f
+++ b/TESTING/MATGEN/dlagsy.f
@@ -1,56 +1,120 @@
- SUBROUTINE DLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
-* ..
-*
+*> \brief \b DLAGSY
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* DLAGSY generates a real symmetric matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random orthogonal matrix:
-* A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
-* orthogonal transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLAGSY generates a real symmetric matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random orthogonal matrix:
+*> A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
+*> orthogonal transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA,N)
+*> The generated n by n symmetric matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) DOUBLE PRECISION array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) DOUBLE PRECISION array, dimension (LDA,N)
-* The generated n by n symmetric matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup double_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE DLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) DOUBLE PRECISION array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlahilb.f b/TESTING/MATGEN/dlahilb.f
index 7fa091f0..b35f40ee 100644
--- a/TESTING/MATGEN/dlahilb.f
+++ b/TESTING/MATGEN/dlahilb.f
@@ -1,107 +1,167 @@
+C> \brief \b DLAHILB
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK, INFO)
+*
+* .. Scalar Arguments ..
+* INTEGER N, NRHS, LDA, LDX, LDB, INFO
+* .. Array Arguments ..
+* DOUBLE PRECISION A(LDA, N), X(LDX, NRHS), B(LDB, NRHS), WORK(N)
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLAHILB generates an N by N scaled Hilbert matrix in A along with
+*> NRHS right-hand sides in B and solutions in X such that A*X=B.
+*>
+*> The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
+*> entries are integers. The right-hand sides are the first NRHS
+*> columns of M * the identity matrix, and the solutions are the
+*> first NRHS columns of the inverse Hilbert matrix.
+*>
+*> The condition number of the Hilbert matrix grows exponentially with
+*> its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
+*> Hilbert matrices beyond a relatively small dimension cannot be
+*> generated exactly without extra precision. Precision is exhausted
+*> when the largest entry in the inverse Hilbert matrix is greater than
+*> 2 to the power of the number of bits in the fraction of the data type
+*> used plus one, which is 24 for single precision.
+*>
+*> In single, the generated solution is exact for N <= 6 and has
+*> small componentwise error for 7 <= N <= 11.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The dimension of the matrix A.
+*> \endverbatim
+*>
+*> \param[in] NRHS
+*> \verbatim
+*> NRHS is INTEGER
+*> The requested number of right-hand sides.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA, N)
+*> The generated scaled Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is DOUBLE PRECISION array, dimension (LDX, NRHS)
+*> The generated exact solutions. Currently, the first NRHS
+*> columns of the inverse Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of the array X. LDX >= N.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is DOUBLE PRECISION array, dimension (LDB, NRHS)
+*> The generated right-hand sides. Currently, the first NRHS
+*> columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of the array B. LDB >= N.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension (N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> = 1: N is too large; the data is still generated but may not
+*> be not exact.
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK, INFO)
-!
-! -- LAPACK auxiliary test routine (version 3.2.2) --
-! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
-! Courant Institute, Argonne National Lab, and Rice University
-* June 2010
-!
-! David Vu <dtv@cs.berkeley.edu>
-! Yozo Hida <yozo@cs.berkeley.edu>
-! Jason Riedy <ejr@cs.berkeley.edu>
-! D. Halligan <dhalligan@berkeley.edu>
-!
- IMPLICIT NONE
-! .. Scalar Arguments ..
+*
+* -- LAPACK test routine (version 3.2.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
INTEGER N, NRHS, LDA, LDX, LDB, INFO
-! .. Array Arguments ..
+* .. Array Arguments ..
DOUBLE PRECISION A(LDA, N), X(LDX, NRHS), B(LDB, NRHS), WORK(N)
-! ..
-!
-! Purpose
-! =======
-!
-! DLAHILB generates an N by N scaled Hilbert matrix in A along with
-! NRHS right-hand sides in B and solutions in X such that A*X=B.
-!
-! The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
-! entries are integers. The right-hand sides are the first NRHS
-! columns of M * the identity matrix, and the solutions are the
-! first NRHS columns of the inverse Hilbert matrix.
-!
-! The condition number of the Hilbert matrix grows exponentially with
-! its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
-! Hilbert matrices beyond a relatively small dimension cannot be
-! generated exactly without extra precision. Precision is exhausted
-! when the largest entry in the inverse Hilbert matrix is greater than
-! 2 to the power of the number of bits in the fraction of the data type
-! used plus one, which is 24 for single precision.
-!
-! In single, the generated solution is exact for N <= 6 and has
-! small componentwise error for 7 <= N <= 11.
-!
-! Arguments
-! =========
-!
-! N (input) INTEGER
-! The dimension of the matrix A.
-!
-! NRHS (input) INTEGER
-! The requested number of right-hand sides.
-!
-! A (output) DOUBLE PRECISION array, dimension (LDA, N)
-! The generated scaled Hilbert matrix.
-!
-! LDA (input) INTEGER
-! The leading dimension of the array A. LDA >= N.
-!
-! X (output) DOUBLE PRECISION array, dimension (LDX, NRHS)
-! The generated exact solutions. Currently, the first NRHS
-! columns of the inverse Hilbert matrix.
-!
-! LDX (input) INTEGER
-! The leading dimension of the array X. LDX >= N.
-!
-! B (output) DOUBLE PRECISION array, dimension (LDB, NRHS)
-! The generated right-hand sides. Currently, the first NRHS
-! columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
-!
-! LDB (input) INTEGER
-! The leading dimension of the array B. LDB >= N.
-!
-! WORK (workspace) DOUBLE PRECISION array, dimension (N)
-!
-!
-! INFO (output) INTEGER
-! = 0: successful exit
-! = 1: N is too large; the data is still generated but may not
-! be not exact.
-! < 0: if INFO = -i, the i-th argument had an illegal value
-!
-! =====================================================================
+* ..
+*
+* =====================================================================
-! .. Local Scalars ..
+* .. Local Scalars ..
INTEGER TM, TI, R
INTEGER M
INTEGER I, J
COMPLEX*16 TMP
-! .. Parameters ..
-! NMAX_EXACT the largest dimension where the generated data is
-! exact.
-! NMAX_APPROX the largest dimension where the generated data has
-! a small componentwise relative error.
+* .. Parameters ..
+* NMAX_EXACT the largest dimension where the generated data is
+* exact.
+* NMAX_APPROX the largest dimension where the generated data has
+* a small componentwise relative error.
INTEGER NMAX_EXACT, NMAX_APPROX
PARAMETER (NMAX_EXACT = 6, NMAX_APPROX = 11)
-! ..
-! .. External Functions
+* ..
+* .. External Functions
EXTERNAL DLASET
INTRINSIC DBLE
-! ..
-! .. Executable Statements ..
-!
-! Test the input arguments
-!
+* ..
+* .. Executable Statements ..
+*
+* Test the input arguments
+*
INFO = 0
IF (N .LT. 0 .OR. N .GT. NMAX_APPROX) THEN
INFO = -1
@@ -122,8 +182,8 @@
INFO = 1
END IF
-! Compute M = the LCM of the integers [1, 2*N-1]. The largest
-! reasonable N is small enough that integers suffice (up to N = 11).
+* Compute M = the LCM of the integers [1, 2*N-1]. The largest
+* reasonable N is small enough that integers suffice (up to N = 11).
M = 1
DO I = 2, (2*N-1)
TM = M
@@ -137,21 +197,21 @@
M = (M / TI) * I
END DO
-! Generate the scaled Hilbert matrix in A
+* Generate the scaled Hilbert matrix in A
DO J = 1, N
DO I = 1, N
A(I, J) = DBLE(M) / (I + J - 1)
END DO
END DO
-! Generate matrix B as simply the first NRHS columns of M * the
-! identity.
+* Generate matrix B as simply the first NRHS columns of M * the
+* identity.
TMP = DBLE(M)
CALL DLASET('Full', N, NRHS, 0.0D+0, TMP, B, LDB)
-! Generate the true solutions in X. Because B = the first NRHS
-! columns of M*I, the true solutions are just the first NRHS columns
-! of the inverse Hilbert matrix.
+* Generate the true solutions in X. Because B = the first NRHS
+* columns of M*I, the true solutions are just the first NRHS columns
+* of the inverse Hilbert matrix.
WORK(1) = N
DO J = 2, N
WORK(J) = ( ( (WORK(J-1)/(J-1)) * (J-1 - N) ) /(J-1) )
diff --git a/TESTING/MATGEN/dlakf2.f b/TESTING/MATGEN/dlakf2.f
index 052719b8..57fe12aa 100644
--- a/TESTING/MATGEN/dlakf2.f
+++ b/TESTING/MATGEN/dlakf2.f
@@ -1,54 +1,125 @@
- SUBROUTINE DLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDZ, M, N
-* ..
-* .. Array Arguments ..
- DOUBLE PRECISION A( LDA, * ), B( LDA, * ), D( LDA, * ),
- $ E( LDA, * ), Z( LDZ, * )
-* ..
-*
+*> \brief \b DLAKF2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( LDA, * ), B( LDA, * ), D( LDA, * ),
+* $ E( LDA, * ), Z( LDZ, * )
+* ..
+*
* Purpose
* =======
*
-* Form the 2*M*N by 2*M*N matrix
-*
-* Z = [ kron(In, A) -kron(B', Im) ]
-* [ kron(In, D) -kron(E', Im) ],
-*
-* where In is the identity matrix of size n and X' is the transpose
-* of X. kron(X, Y) is the Kronecker product between the matrices X
-* and Y.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> Form the 2*M*N by 2*M*N matrix
+*>
+*> Z = [ kron(In, A) -kron(B', Im) ]
+*> [ kron(In, D) -kron(E', Im) ],
+*>
+*> where In is the identity matrix of size n and X' is the transpose
+*> of X. kron(X, Y) is the Kronecker product between the matrices X
+*> and Y.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] A
+*> \verbatim
+*> A is DOUBLE PRECISION, dimension ( LDA, M )
+*> The matrix A in the output matrix Z.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \endverbatim
+*>
+*> \param[in] B
+*> \verbatim
+*> B is DOUBLE PRECISION, dimension ( LDA, N )
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION, dimension ( LDA, M )
+*> \endverbatim
+*>
+*> \param[in] E
+*> \verbatim
+*> E is DOUBLE PRECISION, dimension ( LDA, N )
+*> \endverbatim
+*> \verbatim
+*> The matrices used in forming the output matrix Z.
+*> \endverbatim
+*>
+*> \param[out] Z
+*> \verbatim
+*> Z is DOUBLE PRECISION, dimension ( LDZ, 2*M*N )
+*> The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+*> \endverbatim
+*>
+*> \param[in] LDZ
+*> \verbatim
+*> LDZ is INTEGER
+*> The leading dimension of Z. ( LDZ >= 2*M*N )
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* N (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input) DOUBLE PRECISION, dimension ( LDA, M )
-* The matrix A in the output matrix Z.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \ingroup double_matgen
*
-* B (input) DOUBLE PRECISION, dimension ( LDA, N )
-* D (input) DOUBLE PRECISION, dimension ( LDA, M )
-* E (input) DOUBLE PRECISION, dimension ( LDA, N )
-* The matrices used in forming the output matrix Z.
+* =====================================================================
+ SUBROUTINE DLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
*
-* Z (output) DOUBLE PRECISION, dimension ( LDZ, 2*M*N )
-* The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* LDZ (input) INTEGER
-* The leading dimension of Z. ( LDZ >= 2*M*N )
+* .. Scalar Arguments ..
+ INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+ DOUBLE PRECISION A( LDA, * ), B( LDA, * ), D( LDA, * ),
+ $ E( LDA, * ), Z( LDZ, * )
+* ..
*
* ====================================================================
*
diff --git a/TESTING/MATGEN/dlaran.f b/TESTING/MATGEN/dlaran.f
index cb4481b4..cfd008ee 100644
--- a/TESTING/MATGEN/dlaran.f
+++ b/TESTING/MATGEN/dlaran.f
@@ -1,40 +1,84 @@
- DOUBLE PRECISION FUNCTION DLARAN( ISEED )
+*> \brief \b DLARAN
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
*
+* Definition
+* ==========
+*
+* DOUBLE PRECISION FUNCTION DLARAN( ISEED )
+*
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* DLARAN returns a random real number from a uniform (0,1)
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLARAN returns a random real number from a uniform (0,1)
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup list_temp
+*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine uses a multiplicative congruential method with modulus
+*> 2**48 and multiplier 33952834046453 (see G.S.Fishman,
+*> 'Multiplicative congruential random number generators with modulus
+*> 2**b: an exhaustive analysis for b = 32 and a partial analysis for
+*> b = 48', Math. Comp. 189, pp 331-344, 1990).
+*>
+*> 48-bit integers are stored in 4 integer array elements with 12 bits
+*> per element. Hence the routine is portable across machines with
+*> integers of 32 bits or more.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ DOUBLE PRECISION FUNCTION DLARAN( ISEED )
*
-* This routine uses a multiplicative congruential method with modulus
-* 2**48 and multiplier 33952834046453 (see G.S.Fishman,
-* 'Multiplicative congruential random number generators with modulus
-* 2**b: an exhaustive analysis for b = 32 and a partial analysis for
-* b = 48', Math. Comp. 189, pp 331-344, 1990).
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* 48-bit integers are stored in 4 integer array elements with 12 bits
-* per element. Hence the routine is portable across machines with
-* integers of 32 bits or more.
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlarge.f b/TESTING/MATGEN/dlarge.f
index 3b6d444e..e7e77e2a 100644
--- a/TESTING/MATGEN/dlarge.f
+++ b/TESTING/MATGEN/dlarge.f
@@ -1,48 +1,106 @@
- SUBROUTINE DLARGE( N, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b DLARGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLARGE( N, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* DLARGE pre- and post-multiplies a real general n by n matrix A
-* with a random orthogonal matrix: A = U*D*U'.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLARGE pre- and post-multiplies a real general n by n matrix A
+*> with a random orthogonal matrix: A = U*D*U'.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA,N)
+*> On entry, the original n by n matrix A.
+*> On exit, A is overwritten by U*A*U' for some random
+*> orthogonal matrix U.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
-* On entry, the original n by n matrix A.
-* On exit, A is overwritten by U*A*U' for some random
-* orthogonal matrix U.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup double_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE DLARGE( N, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) DOUBLE PRECISION array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlarnd.f b/TESTING/MATGEN/dlarnd.f
index a84ec8a9..3716cddd 100644
--- a/TESTING/MATGEN/dlarnd.f
+++ b/TESTING/MATGEN/dlarnd.f
@@ -1,43 +1,93 @@
- DOUBLE PRECISION FUNCTION DLARND( IDIST, ISEED )
+*> \brief \b DLARND
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Scalar Arguments ..
- INTEGER IDIST
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
*
+* DOUBLE PRECISION FUNCTION DLARND( IDIST, ISEED )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* DLARND returns a random real number from a uniform or normal
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLARND returns a random real number from a uniform or normal
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* IDIST (input) INTEGER
-* Specifies the distribution of the random numbers:
-* = 1: uniform (0,1)
-* = 2: uniform (-1,1)
-* = 3: normal (0,1)
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> Specifies the distribution of the random numbers:
+*> = 1: uniform (0,1)
+*> = 2: uniform (-1,1)
+*> = 3: normal (0,1)
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine calls the auxiliary routine DLARAN to generate a random
+*> real number from a uniform (0,1) distribution. The Box-Muller method
+*> is used to transform numbers from a uniform to a normal distribution.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ DOUBLE PRECISION FUNCTION DLARND( IDIST, ISEED )
*
-* This routine calls the auxiliary routine DLARAN to generate a random
-* real number from a uniform (0,1) distribution. The Box-Muller method
-* is used to transform numbers from a uniform to a normal distribution.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
+ INTEGER IDIST
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlaror.f b/TESTING/MATGEN/dlaror.f
index 468e37cd..e4a62686 100644
--- a/TESTING/MATGEN/dlaror.f
+++ b/TESTING/MATGEN/dlaror.f
@@ -1,8 +1,161 @@
+*> \brief \b DLAROR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER INIT, SIDE
+* INTEGER INFO, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), X( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLAROR pre- or post-multiplies an M by N matrix A by a random
+*> orthogonal matrix U, overwriting A. A may optionally be initialized
+*> to the identity matrix before multiplying by U. U is generated using
+*> the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409).
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] SIDE
+*> \verbatim
+*> SIDE is CHARACTER*1
+*> Specifies whether A is multiplied on the left or right by U.
+*> = 'L': Multiply A on the left (premultiply) by U
+*> = 'R': Multiply A on the right (postmultiply) by U'
+*> = 'C' or 'T': Multiply A on the left by U and the right
+*> by U' (Here, U' means U-transpose.)
+*> \endverbatim
+*>
+*> \param[in] INIT
+*> \verbatim
+*> INIT is CHARACTER*1
+*> Specifies whether or not A should be initialized to the
+*> identity matrix.
+*> = 'I': Initialize A to (a section of) the identity matrix
+*> before applying U.
+*> = 'N': No initialization. Apply U to the input matrix A.
+*> \endverbatim
+*> \verbatim
+*> INIT = 'I' may be used to generate square or rectangular
+*> orthogonal matrices:
+*> \endverbatim
+*> \verbatim
+*> For M = N and SIDE = 'L' or 'R', the rows will be orthogonal
+*> to each other, as will the columns.
+*> \endverbatim
+*> \verbatim
+*> If M < N, SIDE = 'R' produces a dense matrix whose rows are
+*> orthogonal and whose columns are not, while SIDE = 'L'
+*> produces a matrix whose rows are orthogonal, and whose first
+*> M columns are orthogonal, and whose remaining columns are
+*> zero.
+*> \endverbatim
+*> \verbatim
+*> If M > N, SIDE = 'L' produces a dense matrix whose columns
+*> are orthogonal and whose rows are not, while SIDE = 'R'
+*> produces a matrix whose columns are orthogonal, and whose
+*> first M rows are orthogonal, and whose remaining rows are
+*> zero.
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA, N)
+*> On entry, the array A.
+*> On exit, overwritten by U A ( if SIDE = 'L' ),
+*> or by A U ( if SIDE = 'R' ),
+*> or by U A U' ( if SIDE = 'C' or 'T').
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= max(1,M).
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. The array elements should be between 0 and 4095;
+*> if not they will be reduced mod 4096. Also, ISEED(4) must
+*> be odd. The random number generator uses a linear
+*> congruential sequence limited to small integers, and so
+*> should produce machine independent random numbers. The
+*> values of ISEED are changed on exit, and can be used in the
+*> next call to DLAROR to continue the same random number
+*> sequence.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is DOUBLE PRECISION array, dimension (3*MAX( M, N ))
+*> Workspace of length
+*> 2*M + N if SIDE = 'L',
+*> 2*N + M if SIDE = 'R',
+*> 3*N if SIDE = 'C' or 'T'.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> An error flag. It is set to:
+*> = 0: normal return
+*> < 0: if INFO = -k, the k-th argument had an illegal value
+*> = 1: if the random numbers generated by DLARND are bad.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER INIT, SIDE
@@ -13,87 +166,6 @@
DOUBLE PRECISION A( LDA, * ), X( * )
* ..
*
-* Purpose
-* =======
-*
-* DLAROR pre- or post-multiplies an M by N matrix A by a random
-* orthogonal matrix U, overwriting A. A may optionally be initialized
-* to the identity matrix before multiplying by U. U is generated using
-* the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409).
-*
-* Arguments
-* =========
-*
-* SIDE (input) CHARACTER*1
-* Specifies whether A is multiplied on the left or right by U.
-* = 'L': Multiply A on the left (premultiply) by U
-* = 'R': Multiply A on the right (postmultiply) by U'
-* = 'C' or 'T': Multiply A on the left by U and the right
-* by U' (Here, U' means U-transpose.)
-*
-* INIT (input) CHARACTER*1
-* Specifies whether or not A should be initialized to the
-* identity matrix.
-* = 'I': Initialize A to (a section of) the identity matrix
-* before applying U.
-* = 'N': No initialization. Apply U to the input matrix A.
-*
-* INIT = 'I' may be used to generate square or rectangular
-* orthogonal matrices:
-*
-* For M = N and SIDE = 'L' or 'R', the rows will be orthogonal
-* to each other, as will the columns.
-*
-* If M < N, SIDE = 'R' produces a dense matrix whose rows are
-* orthogonal and whose columns are not, while SIDE = 'L'
-* produces a matrix whose rows are orthogonal, and whose first
-* M columns are orthogonal, and whose remaining columns are
-* zero.
-*
-* If M > N, SIDE = 'L' produces a dense matrix whose columns
-* are orthogonal and whose rows are not, while SIDE = 'R'
-* produces a matrix whose columns are orthogonal, and whose
-* first M rows are orthogonal, and whose remaining rows are
-* zero.
-*
-* M (input) INTEGER
-* The number of rows of A.
-*
-* N (input) INTEGER
-* The number of columns of A.
-*
-* A (input/output) DOUBLE PRECISION array, dimension (LDA, N)
-* On entry, the array A.
-* On exit, overwritten by U A ( if SIDE = 'L' ),
-* or by A U ( if SIDE = 'R' ),
-* or by U A U' ( if SIDE = 'C' or 'T').
-*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= max(1,M).
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. The array elements should be between 0 and 4095;
-* if not they will be reduced mod 4096. Also, ISEED(4) must
-* be odd. The random number generator uses a linear
-* congruential sequence limited to small integers, and so
-* should produce machine independent random numbers. The
-* values of ISEED are changed on exit, and can be used in the
-* next call to DLAROR to continue the same random number
-* sequence.
-*
-* X (workspace) DOUBLE PRECISION array, dimension (3*MAX( M, N ))
-* Workspace of length
-* 2*M + N if SIDE = 'L',
-* 2*N + M if SIDE = 'R',
-* 3*N if SIDE = 'C' or 'T'.
-*
-* INFO (output) INTEGER
-* An error flag. It is set to:
-* = 0: normal return
-* < 0: if INFO = -k, the k-th argument had an illegal value
-* = 1: if the random numbers generated by DLARND are bad.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlarot.f b/TESTING/MATGEN/dlarot.f
index 319ab1a8..aa899b2a 100644
--- a/TESTING/MATGEN/dlarot.f
+++ b/TESTING/MATGEN/dlarot.f
@@ -1,202 +1,254 @@
- SUBROUTINE DLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
- $ XRIGHT )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- LOGICAL LLEFT, LRIGHT, LROWS
- INTEGER LDA, NL
- DOUBLE PRECISION C, S, XLEFT, XRIGHT
-* ..
-* .. Array Arguments ..
- DOUBLE PRECISION A( * )
-* ..
-*
+*> \brief \b DLAROT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+* XRIGHT )
+*
+* .. Scalar Arguments ..
+* LOGICAL LLEFT, LRIGHT, LROWS
+* INTEGER LDA, NL
+* DOUBLE PRECISION C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( * )
+* ..
+*
* Purpose
* =======
*
-* DLAROT applies a (Givens) rotation to two adjacent rows or
-* columns, where one element of the first and/or last column/row
-* for use on matrices stored in some format other than GE, so
-* that elements of the matrix may be used or modified for which
-* no array element is provided.
-*
-* One example is a symmetric matrix in SB format (bandwidth=4), for
-* which UPLO='L': Two adjacent rows will have the format:
-*
-* row j: * * * * * . . . .
-* row j+1: * * * * * . . . .
-*
-* '*' indicates elements for which storage is provided,
-* '.' indicates elements for which no storage is provided, but
-* are not necessarily zero; their values are determined by
-* symmetry. ' ' indicates elements which are necessarily zero,
-* and have no storage provided.
-*
-* Those columns which have two '*'s can be handled by DROT.
-* Those columns which have no '*'s can be ignored, since as long
-* as the Givens rotations are carefully applied to preserve
-* symmetry, their values are determined.
-* Those columns which have one '*' have to be handled separately,
-* by using separate variables "p" and "q":
-*
-* row j: * * * * * p . . .
-* row j+1: q * * * * * . . . .
-*
-* The element p would have to be set correctly, then that column
-* is rotated, setting p to its new value. The next call to
-* DLAROT would rotate columns j and j+1, using p, and restore
-* symmetry. The element q would start out being zero, and be
-* made non-zero by the rotation. Later, rotations would presumably
-* be chosen to zero q out.
-*
-* Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
-* ------- ------- ---------
-*
-* General dense matrix:
-*
-* CALL DLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
-* A(i,1),LDA, DUMMY, DUMMY)
-*
-* General banded matrix in GB format:
-*
-* j = MAX(1, i-KL )
-* NL = MIN( N, i+KU+1 ) + 1-j
-* CALL DLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
-* A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,KL+1) ]
-*
-* Symmetric banded matrix in SY format, bandwidth K,
-* lower triangle only:
-*
-* j = MAX(1, i-K )
-* NL = MIN( K+1, i ) + 1
-* CALL DLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
-* A(i,j), LDA, XLEFT, XRIGHT )
-*
-* Same, but upper triangle only:
-*
-* NL = MIN( K+1, N-i ) + 1
-* CALL DLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
-* A(i,i), LDA, XLEFT, XRIGHT )
-*
-* Symmetric banded matrix in SB format, bandwidth K,
-* lower triangle only:
-*
-* [ same as for SY, except:]
-* . . . .
-* A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,K+1) ]
-*
-* Same, but upper triangle only:
-* . . .
-* A(K+1,i), LDA-1, XLEFT, XRIGHT )
-*
-* Rotating columns is just the transpose of rotating rows, except
-* for GB and SB: (rotating columns i and i+1)
-*
-* GB:
-* j = MAX(1, i-KU )
-* NL = MIN( N, i+KL+1 ) + 1-j
-* CALL DLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
-* A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* [note that KU+j+1-i is just MAX(1,KU+2-i)]
-*
-* SB: (upper triangle)
-*
-* . . . . . .
-* A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* SB: (lower triangle)
-*
-* . . . . . .
-* A(1,i),LDA-1, XTOP, XBOTTM )
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLAROT applies a (Givens) rotation to two adjacent rows or
+*> columns, where one element of the first and/or last column/row
+*> for use on matrices stored in some format other than GE, so
+*> that elements of the matrix may be used or modified for which
+*> no array element is provided.
+*>
+*> One example is a symmetric matrix in SB format (bandwidth=4), for
+*> which UPLO='L': Two adjacent rows will have the format:
+*>
+*> row j: C> C> C> C> C> . . . .
+*> row j+1: C> C> C> C> C> . . . .
+*>
+*> '*' indicates elements for which storage is provided,
+*> '.' indicates elements for which no storage is provided, but
+*> are not necessarily zero; their values are determined by
+*> symmetry. ' ' indicates elements which are necessarily zero,
+*> and have no storage provided.
+*>
+*> Those columns which have two '*'s can be handled by DROT.
+*> Those columns which have no '*'s can be ignored, since as long
+*> as the Givens rotations are carefully applied to preserve
+*> symmetry, their values are determined.
+*> Those columns which have one '*' have to be handled separately,
+*> by using separate variables "p" and "q":
+*>
+*> row j: C> C> C> C> C> p . . .
+*> row j+1: q C> C> C> C> C> . . . .
+*>
+*> The element p would have to be set correctly, then that column
+*> is rotated, setting p to its new value. The next call to
+*> DLAROT would rotate columns j and j+1, using p, and restore
+*> symmetry. The element q would start out being zero, and be
+*> made non-zero by the rotation. Later, rotations would presumably
+*> be chosen to zero q out.
+*>
+*> Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
+*> ------- ------- ---------
+*>
+*> General dense matrix:
+*>
+*> CALL DLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
+*> A(i,1),LDA, DUMMY, DUMMY)
+*>
+*> General banded matrix in GB format:
+*>
+*> j = MAX(1, i-KL )
+*> NL = MIN( N, i+KU+1 ) + 1-j
+*> CALL DLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
+*> A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,KL+1) ]
+*>
+*> Symmetric banded matrix in SY format, bandwidth K,
+*> lower triangle only:
+*>
+*> j = MAX(1, i-K )
+*> NL = MIN( K+1, i ) + 1
+*> CALL DLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
+*> A(i,j), LDA, XLEFT, XRIGHT )
+*>
+*> Same, but upper triangle only:
+*>
+*> NL = MIN( K+1, N-i ) + 1
+*> CALL DLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
+*> A(i,i), LDA, XLEFT, XRIGHT )
+*>
+*> Symmetric banded matrix in SB format, bandwidth K,
+*> lower triangle only:
+*>
+*> [ same as for SY, except:]
+*> . . . .
+*> A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,K+1) ]
+*>
+*> Same, but upper triangle only:
+*> . . .
+*> A(K+1,i), LDA-1, XLEFT, XRIGHT )
+*>
+*> Rotating columns is just the transpose of rotating rows, except
+*> for GB and SB: (rotating columns i and i+1)
+*>
+*> GB:
+*> j = MAX(1, i-KU )
+*> NL = MIN( N, i+KL+1 ) + 1-j
+*> CALL DLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
+*> A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> [note that KU+j+1-i is just MAX(1,KU+2-i)]
+*>
+*> SB: (upper triangle)
+*>
+*> . . . . . .
+*> A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> SB: (lower triangle)
+*>
+*> . . . . . .
+*> A(1,i),LDA-1, XTOP, XBOTTM )
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* LROWS - LOGICAL
-* If .TRUE., then DLAROT will rotate two rows. If .FALSE.,
-* then it will rotate two columns.
-* Not modified.
-*
-* LLEFT - LOGICAL
-* If .TRUE., then XLEFT will be used instead of the
-* corresponding element of A for the first element in the
-* second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
-* If .FALSE., then the corresponding element of A will be
-* used.
-* Not modified.
-*
-* LRIGHT - LOGICAL
-* If .TRUE., then XRIGHT will be used instead of the
-* corresponding element of A for the last element in the
-* first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
-* .FALSE., then the corresponding element of A will be used.
-* Not modified.
+*> \verbatim
+*> LROWS - LOGICAL
+*> If .TRUE., then DLAROT will rotate two rows. If .FALSE.,
+*> then it will rotate two columns.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LLEFT - LOGICAL
+*> If .TRUE., then XLEFT will be used instead of the
+*> corresponding element of A for the first element in the
+*> second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
+*> If .FALSE., then the corresponding element of A will be
+*> used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LRIGHT - LOGICAL
+*> If .TRUE., then XRIGHT will be used instead of the
+*> corresponding element of A for the last element in the
+*> first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
+*> .FALSE., then the corresponding element of A will be used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> NL - INTEGER
+*> The length of the rows (if LROWS=.TRUE.) or columns (if
+*> LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
+*> used, the columns/rows they are in should be included in
+*> NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
+*> least 2. The number of rows/columns to be rotated
+*> exclusive of those involving XLEFT and/or XRIGHT may
+*> not be negative, i.e., NL minus how many of LLEFT and
+*> LRIGHT are .TRUE. must be at least zero; if not, XERBLA
+*> will be called.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> C, S - DOUBLE PRECISION
+*> Specify the Givens rotation to be applied. If LROWS is
+*> true, then the matrix ( c s )
+*> (-s c ) is applied from the left;
+*> if false, then the transpose thereof is applied from the
+*> right. For a Givens rotation, C**2 + S**2 should be 1,
+*> but this is not checked.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> A - DOUBLE PRECISION array.
+*> The array containing the rows/columns to be rotated. The
+*> first element of A should be the upper left element to
+*> be rotated.
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> LDA - INTEGER
+*> The "effective" leading dimension of A. If A contains
+*> a matrix stored in GE or SY format, then this is just
+*> the leading dimension of A as dimensioned in the calling
+*> routine. If A contains a matrix stored in band (GB or SB)
+*> format, then this should be *one less* than the leading
+*> dimension used in the calling routine. Thus, if
+*> A were dimensioned A(LDA,*) in DLAROT, then A(1,j) would
+*> be the j-th element in the first of the two rows
+*> to be rotated, and A(2,j) would be the j-th in the second,
+*> regardless of how the array may be stored in the calling
+*> routine. [A cannot, however, actually be dimensioned thus,
+*> since for band format, the row number may exceed LDA, which
+*> is not legal FORTRAN.]
+*> If LROWS=.TRUE., then LDA must be at least 1, otherwise
+*> it must be at least NL minus the number of .TRUE. values
+*> in XLEFT and XRIGHT.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> XLEFT - DOUBLE PRECISION
+*> If LLEFT is .TRUE., then XLEFT will be used and modified
+*> instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> XRIGHT - DOUBLE PRECISION
+*> If LRIGHT is .TRUE., then XRIGHT will be used and modified
+*> instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* NL - INTEGER
-* The length of the rows (if LROWS=.TRUE.) or columns (if
-* LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
-* used, the columns/rows they are in should be included in
-* NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
-* least 2. The number of rows/columns to be rotated
-* exclusive of those involving XLEFT and/or XRIGHT may
-* not be negative, i.e., NL minus how many of LLEFT and
-* LRIGHT are .TRUE. must be at least zero; if not, XERBLA
-* will be called.
-* Not modified.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* C, S - DOUBLE PRECISION
-* Specify the Givens rotation to be applied. If LROWS is
-* true, then the matrix ( c s )
-* (-s c ) is applied from the left;
-* if false, then the transpose thereof is applied from the
-* right. For a Givens rotation, C**2 + S**2 should be 1,
-* but this is not checked.
-* Not modified.
+*> \date November 2011
*
-* A - DOUBLE PRECISION array.
-* The array containing the rows/columns to be rotated. The
-* first element of A should be the upper left element to
-* be rotated.
-* Read and modified.
+*> \ingroup double_matgen
*
-* LDA - INTEGER
-* The "effective" leading dimension of A. If A contains
-* a matrix stored in GE or SY format, then this is just
-* the leading dimension of A as dimensioned in the calling
-* routine. If A contains a matrix stored in band (GB or SB)
-* format, then this should be *one less* than the leading
-* dimension used in the calling routine. Thus, if
-* A were dimensioned A(LDA,*) in DLAROT, then A(1,j) would
-* be the j-th element in the first of the two rows
-* to be rotated, and A(2,j) would be the j-th in the second,
-* regardless of how the array may be stored in the calling
-* routine. [A cannot, however, actually be dimensioned thus,
-* since for band format, the row number may exceed LDA, which
-* is not legal FORTRAN.]
-* If LROWS=.TRUE., then LDA must be at least 1, otherwise
-* it must be at least NL minus the number of .TRUE. values
-* in XLEFT and XRIGHT.
-* Not modified.
+* =====================================================================
+ SUBROUTINE DLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+ $ XRIGHT )
*
-* XLEFT - DOUBLE PRECISION
-* If LLEFT is .TRUE., then XLEFT will be used and modified
-* instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
-* (if LROWS=.FALSE.).
-* Read and modified.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* XRIGHT - DOUBLE PRECISION
-* If LRIGHT is .TRUE., then XRIGHT will be used and modified
-* instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
-* (if LROWS=.FALSE.).
-* Read and modified.
+* .. Scalar Arguments ..
+ LOGICAL LLEFT, LRIGHT, LROWS
+ INTEGER LDA, NL
+ DOUBLE PRECISION C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+ DOUBLE PRECISION A( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlatm1.f b/TESTING/MATGEN/dlatm1.f
index e113e985..f8cbb9c9 100644
--- a/TESTING/MATGEN/dlatm1.f
+++ b/TESTING/MATGEN/dlatm1.f
@@ -1,8 +1,146 @@
+*> \brief \b DLATM1
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST, INFO, IRSIGN, MODE, N
+* DOUBLE PRECISION COND
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION D( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM1 computes the entries of D(1..N) as specified by
+*> MODE, COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. DLATM1 is called by SLATMR to generate
+*> random test matrices for LAPACK programs.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IRSIGN
+*> \verbatim
+*> IRSIGN is INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by 1 or -1 with probability .5
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATM1
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
INTEGER IDIST, INFO, IRSIGN, MODE, N
@@ -13,79 +151,6 @@
DOUBLE PRECISION D( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATM1 computes the entries of D(1..N) as specified by
-* MODE, COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. DLATM1 is called by SLATMR to generate
-* random test matrices for LAPACK programs.
-*
-* Arguments
-* =========
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN (input) INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by 1 or -1 with probability .5
-*
-* IDIST (input) CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATM1
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N (input) INTEGER
-* Number of entries of D. Not modified.
-*
-* INFO (output) INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatm2.f b/TESTING/MATGEN/dlatm2.f
index d803608d..1f3eaf38 100644
--- a/TESTING/MATGEN/dlatm2.f
+++ b/TESTING/MATGEN/dlatm2.f
@@ -1,9 +1,219 @@
+*> \brief \b DLATM2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* DOUBLE PRECISION FUNCTION DLATM2( M, N, I, J, KL, KU, IDIST,
+* ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, J, KL, KU, M, N
+* DOUBLE PRECISION SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* DOUBLE PRECISION D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM2 returns the (I,J) entry of a random matrix of dimension
+*> (M, N) described by the other paramters. It is called by the
+*> DLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by DLATMR which has already checked the parameters.
+*>
+*> Use of DLATM2 differs from SLATM3 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With DLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With DLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, DLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. DLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*>
+*> The matrix whose (I,J) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If I is outside (1..M) or J is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is DOUBLE PRECISION array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is DOUBLE PRECISION array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) in position K was originally in
+*> position IWORK( K ).
+*> This differs from IWORK for DLATM3. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
DOUBLE PRECISION FUNCTION DLATM2( M, N, I, J, KL, KU, IDIST,
$ ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -17,126 +227,6 @@
DOUBLE PRECISION D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATM2 returns the (I,J) entry of a random matrix of dimension
-* (M, N) described by the other paramters. It is called by the
-* DLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by DLATMR which has already checked the parameters.
-*
-* Use of DLATM2 differs from SLATM3 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With DLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With DLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, DLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. DLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-*
-* The matrix whose (I,J) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If I is outside (1..M) or J is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of entry to be returned. Not modified.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) DOUBLE PRECISION array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) DOUBLE PRECISION array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) DOUBLE PRECISION array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (workspace) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) in position K was originally in
-* position IWORK( K ).
-* This differs from IWORK for DLATM3. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatm3.f b/TESTING/MATGEN/dlatm3.f
index 3b8bb363..10d1b2ba 100644
--- a/TESTING/MATGEN/dlatm3.f
+++ b/TESTING/MATGEN/dlatm3.f
@@ -1,10 +1,237 @@
+*> \brief \b DLATM3
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* DOUBLE PRECISION FUNCTION DLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
+* IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
+* SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, ISUB, J, JSUB, KL,
+* $ KU, M, N
+* DOUBLE PRECISION SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* DOUBLE PRECISION D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM3 returns the (ISUB,JSUB) entry of a random matrix of
+*> dimension (M, N) described by the other paramters. (ISUB,JSUB)
+*> is the final position of the (I,J) entry after pivoting
+*> according to IPVTNG and IWORK. DLATM3 is called by the
+*> DLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by DLATMR which has already checked the parameters.
+*>
+*> Use of DLATM3 differs from SLATM2 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With DLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With DLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, DLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. DLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*> in different orders for different pivot orders).
+*>
+*> The matrix whose (ISUB,JSUB) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISUB
+*> \verbatim
+*> ISUB is INTEGER
+*> Row of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] JSUB
+*> \verbatim
+*> JSUB is INTEGER
+*> Column of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is DOUBLE PRECISION array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is DOUBLE PRECISION array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) originally in position K is in
+*> position IWORK( K ) after pivoting.
+*> This differs from IWORK for DLATM2. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
DOUBLE PRECISION FUNCTION DLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
$ IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
$ SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -19,135 +246,6 @@
DOUBLE PRECISION D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATM3 returns the (ISUB,JSUB) entry of a random matrix of
-* dimension (M, N) described by the other paramters. (ISUB,JSUB)
-* is the final position of the (I,J) entry after pivoting
-* according to IPVTNG and IWORK. DLATM3 is called by the
-* DLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by DLATMR which has already checked the parameters.
-*
-* Use of DLATM3 differs from SLATM2 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With DLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With DLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, DLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. DLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-* in different orders for different pivot orders).
-*
-* The matrix whose (ISUB,JSUB) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of unpivoted entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of unpivoted entry to be returned. Not modified.
-*
-* ISUB (input/output) INTEGER
-* Row of pivoted entry to be returned. Changed on exit.
-*
-* JSUB (input/output) INTEGER
-* Column of pivoted entry to be returned. Changed on exit.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) DOUBLE PRECISION array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) DOUBLE PRECISION array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) DOUBLE PRECISION array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (input) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) originally in position K is in
-* position IWORK( K ) after pivoting.
-* This differs from IWORK for DLATM2. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatm5.f b/TESTING/MATGEN/dlatm5.f
index 3163849c..d3bb66ea 100644
--- a/TESTING/MATGEN/dlatm5.f
+++ b/TESTING/MATGEN/dlatm5.f
@@ -1,177 +1,292 @@
- SUBROUTINE DLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
- $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
- $ QBLCKB )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
- $ PRTYPE, QBLCKA, QBLCKB
- DOUBLE PRECISION ALPHA
-* ..
-* .. Array Arguments ..
- DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ),
- $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
- $ L( LDL, * ), R( LDR, * )
-* ..
-*
+*> \brief \b DLATM5
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+* E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+* QBLCKB )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+* $ PRTYPE, QBLCKA, QBLCKB
+* DOUBLE PRECISION ALPHA
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ),
+* $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+* $ L( LDL, * ), R( LDR, * )
+* ..
+*
* Purpose
* =======
*
-* DLATM5 generates matrices involved in the Generalized Sylvester
-* equation:
-*
-* A * R - L * B = C
-* D * R - L * E = F
-*
-* They also satisfy (the diagonalization condition)
-*
-* [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
-* [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
-*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM5 generates matrices involved in the Generalized Sylvester
+*> equation:
+*>
+*> A * R - L * B = C
+*> D * R - L * E = F
+*>
+*> They also satisfy (the diagonalization condition)
+*>
+*> [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
+*> [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
+*>
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* PRTYPE (input) INTEGER
-* "Points" to a certian type of the matrices to generate
-* (see futher details).
-*
-* M (input) INTEGER
-* Specifies the order of A and D and the number of rows in
-* C, F, R and L.
-*
-* N (input) INTEGER
-* Specifies the order of B and E and the number of columns in
-* C, F, R and L.
-*
-* A (output) DOUBLE PRECISION array, dimension (LDA, M).
-* On exit A M-by-M is initialized according to PRTYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A.
-*
-* B (output) DOUBLE PRECISION array, dimension (LDB, N).
-* On exit B N-by-N is initialized according to PRTYPE.
-*
-* LDB (input) INTEGER
-* The leading dimension of B.
-*
-* C (output) DOUBLE PRECISION array, dimension (LDC, N).
-* On exit C M-by-N is initialized according to PRTYPE.
-*
-* LDC (input) INTEGER
-* The leading dimension of C.
-*
-* D (output) DOUBLE PRECISION array, dimension (LDD, M).
-* On exit D M-by-M is initialized according to PRTYPE.
-*
-* LDD (input) INTEGER
-* The leading dimension of D.
-*
-* E (output) DOUBLE PRECISION array, dimension (LDE, N).
-* On exit E N-by-N is initialized according to PRTYPE.
-*
-* LDE (input) INTEGER
-* The leading dimension of E.
-*
-* F (output) DOUBLE PRECISION array, dimension (LDF, N).
-* On exit F M-by-N is initialized according to PRTYPE.
-*
-* LDF (input) INTEGER
-* The leading dimension of F.
-*
-* R (output) DOUBLE PRECISION array, dimension (LDR, N).
-* On exit R M-by-N is initialized according to PRTYPE.
-*
-* LDR (input) INTEGER
-* The leading dimension of R.
-*
-* L (output) DOUBLE PRECISION array, dimension (LDL, N).
-* On exit L M-by-N is initialized according to PRTYPE.
-*
-* LDL (input) INTEGER
-* The leading dimension of L.
+*> \param[in] PRTYPE
+*> \verbatim
+*> PRTYPE is INTEGER
+*> "Points" to a certian type of the matrices to generate
+*> (see futher details).
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Specifies the order of A and D and the number of rows in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Specifies the order of B and E and the number of columns in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA, M).
+*> On exit A M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is DOUBLE PRECISION array, dimension (LDB, N).
+*> On exit B N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of B.
+*> \endverbatim
+*>
+*> \param[out] C
+*> \verbatim
+*> C is DOUBLE PRECISION array, dimension (LDC, N).
+*> On exit C M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDC
+*> \verbatim
+*> LDC is INTEGER
+*> The leading dimension of C.
+*> \endverbatim
+*>
+*> \param[out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (LDD, M).
+*> On exit D M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDD
+*> \verbatim
+*> LDD is INTEGER
+*> The leading dimension of D.
+*> \endverbatim
+*>
+*> \param[out] E
+*> \verbatim
+*> E is DOUBLE PRECISION array, dimension (LDE, N).
+*> On exit E N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDE
+*> \verbatim
+*> LDE is INTEGER
+*> The leading dimension of E.
+*> \endverbatim
+*>
+*> \param[out] F
+*> \verbatim
+*> F is DOUBLE PRECISION array, dimension (LDF, N).
+*> On exit F M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDF
+*> \verbatim
+*> LDF is INTEGER
+*> The leading dimension of F.
+*> \endverbatim
+*>
+*> \param[out] R
+*> \verbatim
+*> R is DOUBLE PRECISION array, dimension (LDR, N).
+*> On exit R M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDR
+*> \verbatim
+*> LDR is INTEGER
+*> The leading dimension of R.
+*> \endverbatim
+*>
+*> \param[out] L
+*> \verbatim
+*> L is DOUBLE PRECISION array, dimension (LDL, N).
+*> On exit L M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDL
+*> \verbatim
+*> LDL is INTEGER
+*> The leading dimension of L.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is DOUBLE PRECISION
+*> Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \endverbatim
+*>
+*> \param[in] QBLCKA
+*> \verbatim
+*> QBLCKA is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in A. Otherwise, QBLCKA is not
+*> referenced. QBLCKA > 1.
+*> \endverbatim
+*>
+*> \param[in] QBLCKB
+*> \verbatim
+*> QBLCKB is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in B. Otherwise, QBLCKB is not
+*> referenced. QBLCKB > 1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* ALPHA (input) DOUBLE PRECISION
-* Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* QBLCKA (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in A. Otherwise, QBLCKA is not
-* referenced. QBLCKA > 1.
+*> \date November 2011
*
-* QBLCKB (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in B. Otherwise, QBLCKB is not
-* referenced. QBLCKB > 1.
+*> \ingroup double_matgen
*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
+*>
+*> A : if (i == j) then A(i, j) = 1.0
+*> if (j == i + 1) then A(i, j) = -1.0
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> B : if (i == j) then B(i, j) = 1.0 - ALPHA
+*> if (j == i + 1) then B(i, j) = 1.0
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> D : if (i == j) then D(i, j) = 1.0
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*> E : if (i == j) then E(i, j) = 1.0
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L = R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
+*>
+*> A : if (i <= j) then A(i, j) = [-1...1]
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> if (PRTYPE = 3) then
+*> A(k + 1, k + 1) = A(k, k)
+*> A(k + 1, k) = [-1...1]
+*> sign(A(k, k + 1) = -(sin(A(k + 1, k))
+*> k = 1, M - 1, QBLCKA
+*>
+*> B : if (i <= j) then B(i, j) = [-1...1]
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> if (PRTYPE = 3) then
+*> B(k + 1, k + 1) = B(k, k)
+*> B(k + 1, k) = [-1...1]
+*> sign(B(k, k + 1) = -(sign(B(k + 1, k))
+*> k = 1, N - 1, QBLCKB
+*>
+*> D : if (i <= j) then D(i, j) = [-1...1].
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*>
+*> E : if (i <= j) then D(i, j) = [-1...1]
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L, R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 4 Full
+*> A(i, j) = [-10...10]
+*> D(i, j) = [-1...1] i,j = 1...M
+*> B(i, j) = [-10...10]
+*> E(i, j) = [-1...1] i,j = 1...N
+*> R(i, j) = [-10...10]
+*> L(i, j) = [-1...1] i = 1..M ,j = 1...N
+*>
+*> L, R specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 5 special case common and/or close eigs.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ SUBROUTINE DLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+ $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+ $ QBLCKB )
*
-* PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
-*
-* A : if (i == j) then A(i, j) = 1.0
-* if (j == i + 1) then A(i, j) = -1.0
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* B : if (i == j) then B(i, j) = 1.0 - ALPHA
-* if (j == i + 1) then B(i, j) = 1.0
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* D : if (i == j) then D(i, j) = 1.0
-* else D(i, j) = 0.0, i, j = 1...M
-*
-* E : if (i == j) then E(i, j) = 1.0
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L = R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
-*
-* A : if (i <= j) then A(i, j) = [-1...1]
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* if (PRTYPE = 3) then
-* A(k + 1, k + 1) = A(k, k)
-* A(k + 1, k) = [-1...1]
-* sign(A(k, k + 1) = -(sin(A(k + 1, k))
-* k = 1, M - 1, QBLCKA
-*
-* B : if (i <= j) then B(i, j) = [-1...1]
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* if (PRTYPE = 3) then
-* B(k + 1, k + 1) = B(k, k)
-* B(k + 1, k) = [-1...1]
-* sign(B(k, k + 1) = -(sign(B(k + 1, k))
-* k = 1, N - 1, QBLCKB
-*
-* D : if (i <= j) then D(i, j) = [-1...1].
-* else D(i, j) = 0.0, i, j = 1...M
-*
-*
-* E : if (i <= j) then D(i, j) = [-1...1]
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L, R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 4 Full
-* A(i, j) = [-10...10]
-* D(i, j) = [-1...1] i,j = 1...M
-* B(i, j) = [-10...10]
-* E(i, j) = [-1...1] i,j = 1...N
-* R(i, j) = [-10...10]
-* L(i, j) = [-1...1] i = 1..M ,j = 1...N
-*
-* L, R specifies the right hand sides (C, F).
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* PRTYPE = 5 special case common and/or close eigs.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+ $ PRTYPE, QBLCKA, QBLCKB
+ DOUBLE PRECISION ALPHA
+* ..
+* .. Array Arguments ..
+ DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ),
+ $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+ $ L( LDL, * ), R( LDR, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlatm6.f b/TESTING/MATGEN/dlatm6.f
index ddb6e5d0..766cfe18 100644
--- a/TESTING/MATGEN/dlatm6.f
+++ b/TESTING/MATGEN/dlatm6.f
@@ -1,107 +1,197 @@
- SUBROUTINE DLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
- $ BETA, WX, WY, S, DIF )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDX, LDY, N, TYPE
- DOUBLE PRECISION ALPHA, BETA, WX, WY
-* ..
-* .. Array Arguments ..
- DOUBLE PRECISION A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
- $ X( LDX, * ), Y( LDY, * )
-* ..
-*
+*> \brief \b DLATM6
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+* BETA, WX, WY, S, DIF )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDX, LDY, N, TYPE
+* DOUBLE PRECISION ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
+* $ X( LDX, * ), Y( LDY, * )
+* ..
+*
* Purpose
* =======
*
-* DLATM6 generates test matrices for the generalized eigenvalue
-* problem, their corresponding right and left eigenvector matrices,
-* and also reciprocal condition numbers for all eigenvalues and
-* the reciprocal condition numbers of eigenvectors corresponding to
-* the 1th and 5th eigenvalues.
-*
-* Test Matrices
-* =============
-*
-* Two kinds of test matrix pairs
-*
-* (A, B) = inverse(YH) * (Da, Db) * inverse(X)
-*
-* are used in the tests:
-*
-* Type 1:
-* Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
-* 0 2+a 0 0 0 0 1 0 0 0
-* 0 0 3+a 0 0 0 0 1 0 0
-* 0 0 0 4+a 0 0 0 0 1 0
-* 0 0 0 0 5+a , 0 0 0 0 1 , and
-*
-* Type 2:
-* Da = 1 -1 0 0 0 Db = 1 0 0 0 0
-* 1 1 0 0 0 0 1 0 0 0
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1+a 1+b 0 0 0 1 0
-* 0 0 0 -1-b 1+a , 0 0 0 0 1 .
-*
-* In both cases the same inverse(YH) and inverse(X) are used to compute
-* (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
-*
-* YH: = 1 0 -y y -y X = 1 0 -x -x x
-* 0 1 -y y -y 0 1 x -x -x
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1 0 0 0 0 1 0
-* 0 0 0 0 1, 0 0 0 0 1 ,
-*
-* where a, b, x and y will have all values independently of each other.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM6 generates test matrices for the generalized eigenvalue
+*> problem, their corresponding right and left eigenvector matrices,
+*> and also reciprocal condition numbers for all eigenvalues and
+*> the reciprocal condition numbers of eigenvectors corresponding to
+*> the 1th and 5th eigenvalues.
+*>
+*> Test Matrices
+*> =============
+*>
+*> Two kinds of test matrix pairs
+*>
+*> (A, B) = inverse(YH) * (Da, Db) * inverse(X)
+*>
+*> are used in the tests:
+*>
+*> Type 1:
+*> Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
+*> 0 2+a 0 0 0 0 1 0 0 0
+*> 0 0 3+a 0 0 0 0 1 0 0
+*> 0 0 0 4+a 0 0 0 0 1 0
+*> 0 0 0 0 5+a , 0 0 0 0 1 , and
+*>
+*> Type 2:
+*> Da = 1 -1 0 0 0 Db = 1 0 0 0 0
+*> 1 1 0 0 0 0 1 0 0 0
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1+a 1+b 0 0 0 1 0
+*> 0 0 0 -1-b 1+a , 0 0 0 0 1 .
+*>
+*> In both cases the same inverse(YH) and inverse(X) are used to compute
+*> (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
+*>
+*> YH: = 1 0 -y y -y X = 1 0 -x -x x
+*> 0 1 -y y -y 0 1 x -x -x
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1 0 0 0 0 1 0
+*> 0 0 0 0 1, 0 0 0 0 1 ,
+*>
+*> where a, b, x and y will have all values independently of each other.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* TYPE (input) INTEGER
-* Specifies the problem type (see futher details).
-*
-* N (input) INTEGER
-* Size of the matrices A and B.
-*
-* A (output) DOUBLE PRECISION array, dimension (LDA, N).
-* On exit A N-by-N is initialized according to TYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A and of B.
-*
-* B (output) DOUBLE PRECISION array, dimension (LDA, N).
-* On exit B N-by-N is initialized according to TYPE.
-*
-* X (output) DOUBLE PRECISION array, dimension (LDX, N).
-* On exit X is the N-by-N matrix of right eigenvectors.
-*
-* LDX (input) INTEGER
-* The leading dimension of X.
-*
-* Y (output) DOUBLE PRECISION array, dimension (LDY, N).
-* On exit Y is the N-by-N matrix of left eigenvectors.
+*> \param[in] TYPE
+*> \verbatim
+*> TYPE is INTEGER
+*> Specifies the problem type (see futher details).
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of the matrices A and B.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA, N).
+*> On exit A N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A and of B.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is DOUBLE PRECISION array, dimension (LDA, N).
+*> On exit B N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is DOUBLE PRECISION array, dimension (LDX, N).
+*> On exit X is the N-by-N matrix of right eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of X.
+*> \endverbatim
+*>
+*> \param[out] Y
+*> \verbatim
+*> Y is DOUBLE PRECISION array, dimension (LDY, N).
+*> On exit Y is the N-by-N matrix of left eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDY
+*> \verbatim
+*> LDY is INTEGER
+*> The leading dimension of Y.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is DOUBLE PRECISION
+*> \endverbatim
+*>
+*> \param[in] BETA
+*> \verbatim
+*> BETA is DOUBLE PRECISION
+*> \endverbatim
+*> \verbatim
+*> Weighting constants for matrix A.
+*> \endverbatim
+*>
+*> \param[in] WX
+*> \verbatim
+*> WX is DOUBLE PRECISION
+*> Constant for right eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[in] WY
+*> \verbatim
+*> WY is DOUBLE PRECISION
+*> Constant for left eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[out] S
+*> \verbatim
+*> S is DOUBLE PRECISION array, dimension (N)
+*> S(i) is the reciprocal condition number for eigenvalue i.
+*> \endverbatim
+*>
+*> \param[out] DIF
+*> \verbatim
+*> DIF is DOUBLE PRECISION array, dimension (N)
+*> DIF(i) is the reciprocal condition number for eigenvector i.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* LDY (input) INTEGER
-* The leading dimension of Y.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* ALPHA (input) DOUBLE PRECISION
-* BETA (input) DOUBLE PRECISION
-* Weighting constants for matrix A.
+*> \date November 2011
*
-* WX (input) DOUBLE PRECISION
-* Constant for right eigenvector matrix.
+*> \ingroup double_matgen
*
-* WY (input) DOUBLE PRECISION
-* Constant for left eigenvector matrix.
+* =====================================================================
+ SUBROUTINE DLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+ $ BETA, WX, WY, S, DIF )
*
-* S (output) DOUBLE PRECISION array, dimension (N)
-* S(i) is the reciprocal condition number for eigenvalue i.
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* DIF (output) DOUBLE PRECISION array, dimension (N)
-* DIF(i) is the reciprocal condition number for eigenvector i.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDX, LDY, N, TYPE
+ DOUBLE PRECISION ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+ DOUBLE PRECISION A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
+ $ X( LDX, * ), Y( LDY, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/dlatm7.f b/TESTING/MATGEN/dlatm7.f
index 683d46be..4d46cd4b 100644
--- a/TESTING/MATGEN/dlatm7.f
+++ b/TESTING/MATGEN/dlatm7.f
@@ -1,9 +1,143 @@
+*> \brief \b DLATM7
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATM7( MODE, COND, IRSIGN, IDIST, ISEED, D, N,
+* RANK, INFO )
+*
+* .. Scalar Arguments ..
+* DOUBLE PRECISION COND
+* INTEGER IDIST, INFO, IRSIGN, MODE, N, RANK
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION D( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATM7 computes the entries of D as specified by MODE
+*> COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. DLATM7 is called by DLATMT to generate
+*> random test matrices.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \verbatim
+*> MODE - INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> \endverbatim
+*> \verbatim
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1)) I=1:RANK
+*> \endverbatim
+*> \verbatim
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> COND - DOUBLE PRECISION
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*> \verbatim
+*> IRSIGN - INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by 1 or -1 with probability .5
+*> \endverbatim
+*> \verbatim
+*> IDIST - CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> ISEED - INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATM7
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*> \verbatim
+*> D - DOUBLE PRECISION array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*> \verbatim
+*> N - INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*> \verbatim
+*> RANK - INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> INFO - INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATM7( MODE, COND, IRSIGN, IDIST, ISEED, D, N,
$ RANK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
DOUBLE PRECISION COND
@@ -14,86 +148,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* DLATM7 computes the entries of D as specified by MODE
-* COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. DLATM7 is called by DLATMT to generate
-* random test matrices.
-*
-* Arguments
-* =========
-*
-* MODE - INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-*
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1)) I=1:RANK
-*
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND - DOUBLE PRECISION
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN - INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by 1 or -1 with probability .5
-*
-* IDIST - CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED - INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATM7
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D - DOUBLE PRECISION array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N - INTEGER
-* Number of entries of D. Not modified.
-*
-* RANK - INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* INFO - INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatme.f b/TESTING/MATGEN/dlatme.f
index 86bb1f31..9eccb773 100644
--- a/TESTING/MATGEN/dlatme.f
+++ b/TESTING/MATGEN/dlatme.f
@@ -1,12 +1,343 @@
+*> \brief \b DLATME
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATME( N, DIST, ISEED, D, MODE, COND, DMAX, EI,
+* RSIGN,
+* UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
+* A,
+* LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, RSIGN, SIM, UPPER
+* INTEGER INFO, KL, KU, LDA, MODE, MODES, N
+* DOUBLE PRECISION ANORM, COND, CONDS, DMAX
+* ..
+* .. Array Arguments ..
+* CHARACTER EI( * )
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), D( * ), DS( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATME generates random non-symmetric square matrices with
+*> specified eigenvalues for testing LAPACK programs.
+*>
+*> DLATME operates by applying the following sequence of
+*> operations:
+*>
+*> 1. Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and RSIGN
+*> as described below.
+*>
+*> 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R',
+*> or MODE=5), certain pairs of adjacent elements of D are
+*> interpreted as the real and complex parts of a complex
+*> conjugate pair; A thus becomes block diagonal, with 1x1
+*> and 2x2 blocks.
+*>
+*> 3. If UPPER='T', the upper triangle of A is set to random values
+*> out of distribution DIST.
+*>
+*> 4. If SIM='T', A is multiplied on the left by a random matrix
+*> X, whose singular values are specified by DS, MODES, and
+*> CONDS, and on the right by X inverse.
+*>
+*> 5. If KL < N-1, the lower bandwidth is reduced to KL using
+*> Householder transformations. If KU < N-1, the upper
+*> bandwidth is reduced to KU.
+*>
+*> 6. If ANORM is not negative, the matrix is scaled to have
+*> maximum-element-norm ANORM.
+*>
+*> (Note: since the matrix cannot be reduced beyond Hessenberg form,
+*> no packing options are available.)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns (or rows) of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values, and for the
+*> upper triangle (see UPPER).
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATME
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( N )
+*> This array is used to specify the eigenvalues of A. If
+*> MODE=0, then D is assumed to contain the eigenvalues (but
+*> see the description of EI), otherwise they will be
+*> computed according to MODE, COND, DMAX, and RSIGN and
+*> placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D (with EI) as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed. Each odd-even pair
+*> of elements will be either used as two real
+*> eigenvalues or as the real and imaginary part
+*> of a complex conjugate pair of eigenvalues;
+*> the choice of which is done is random, with
+*> 50-50 probability, for each pair.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is between 1 and 4, D has entries ranging
+*> from 1 to 1/COND, if between -1 and -4, D has entries
+*> ranging from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))). Note that DMAX need not be
+*> positive: if DMAX is negative (or zero), D will be
+*> scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] EI
+*> \verbatim
+*> EI is CHARACTER*1 array, dimension ( N )
+*> If MODE is 0, and EI(1) is not ' ' (space character),
+*> this array specifies which elements of D (on input) are
+*> real eigenvalues and which are the real and imaginary parts
+*> of a complex conjugate pair of eigenvalues. The elements
+*> of EI may then only have the values 'R' and 'I'. If
+*> EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is
+*> CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex
+*> conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th
+*> eigenvalue is D(j) (i.e., real). EI(1) may not be 'I',
+*> nor may two adjacent elements of EI both have the value 'I'.
+*> If MODE is not 0, then EI is ignored. If MODE is 0 and
+*> EI(1)=' ', then the eigenvalues will all be real.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE is not 0, 6, or -6, and RSIGN='T', then the
+*> elements of D, as computed according to MODE and COND, will
+*> be multiplied by a random sign (+1 or -1). If RSIGN='F',
+*> they will not be. RSIGN may only have the values 'T' or
+*> 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] UPPER
+*> \verbatim
+*> UPPER is CHARACTER*1
+*> If UPPER='T', then the elements of A above the diagonal
+*> (and above the 2x2 diagonal blocks, if A has complex
+*> eigenvalues) will be set to random numbers out of DIST.
+*> If UPPER='F', they will not. UPPER may only have the
+*> values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] SIM
+*> \verbatim
+*> SIM is CHARACTER*1
+*> If SIM='T', then A will be operated on by a "similarity
+*> transform", i.e., multiplied on the left by a matrix X and
+*> on the right by X inverse. X = U S V, where U and V are
+*> random unitary matrices and S is a (diagonal) matrix of
+*> singular values specified by DS, MODES, and CONDS. If
+*> SIM='F', then A will not be transformed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DS
+*> \verbatim
+*> DS is DOUBLE PRECISION array, dimension ( N )
+*> This array is used to specify the singular values of X,
+*> in the same way that D specifies the eigenvalues of A.
+*> If MODE=0, the DS contains the singular values, which
+*> may not be zero.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODES
+*> \verbatim
+*> MODES is INTEGER
+*> \endverbatim
+*>
+*> \param[in] CONDS
+*> \verbatim
+*> CONDS is DOUBLE PRECISION
+*> Same as MODE and COND, but for specifying the diagonal
+*> of S. MODES=-6 and +6 are not allowed (since they would
+*> result in randomly ill-conditioned eigenvalues.)
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. KL=1
+*> specifies upper Hessenberg form. If KL is at least N-1,
+*> then A will have full lower bandwidth. KL must be at
+*> least 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. KU=1
+*> specifies lower Hessenberg form. If KU is at least N-1,
+*> then A will have full upper bandwidth; if KU and KL
+*> are both at least N-1, then A will be dense. Only one of
+*> KU and KL may be less than N-1. KU must be at least 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is DOUBLE PRECISION
+*> If ANORM is not negative, then A will be scaled by a non-
+*> negative real number to make the maximum-element-norm of A
+*> to be ANORM.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension ( LDA, N )
+*> On exit A is the desired test matrix.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. LDA must be at least N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension ( 3*N )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => N negative
+*> -2 => DIST illegal string
+*> -5 => MODE not in range -6 to 6
+*> -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or
+*> two adjacent elements of EI are 'I'.
+*> -9 => RSIGN is not 'T' or 'F'
+*> -10 => UPPER is not 'T' or 'F'
+*> -11 => SIM is not 'T' or 'F'
+*> -12 => MODES=0 and DS has a zero singular value.
+*> -13 => MODES is not in the range -5 to 5.
+*> -14 => MODES is nonzero and CONDS is less than 1.
+*> -15 => KL is less than 1.
+*> -16 => KU is less than 1, or KL and KU are both less than
+*> N-1.
+*> -19 => LDA is less than N.
+*> 1 => Error return from DLATM1 (computing D)
+*> 2 => Cannot scale to DMAX (max. eigenvalue is 0)
+*> 3 => Error return from DLATM1 (computing DS)
+*> 4 => Error return from DLARGE
+*> 5 => Zero singular value from DLATM1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATME( N, DIST, ISEED, D, MODE, COND, DMAX, EI,
$ RSIGN,
$ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
$ A,
$ LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, RSIGN, SIM, UPPER
@@ -19,227 +350,6 @@
DOUBLE PRECISION A( LDA, * ), D( * ), DS( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATME generates random non-symmetric square matrices with
-* specified eigenvalues for testing LAPACK programs.
-*
-* DLATME operates by applying the following sequence of
-* operations:
-*
-* 1. Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and RSIGN
-* as described below.
-*
-* 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R',
-* or MODE=5), certain pairs of adjacent elements of D are
-* interpreted as the real and complex parts of a complex
-* conjugate pair; A thus becomes block diagonal, with 1x1
-* and 2x2 blocks.
-*
-* 3. If UPPER='T', the upper triangle of A is set to random values
-* out of distribution DIST.
-*
-* 4. If SIM='T', A is multiplied on the left by a random matrix
-* X, whose singular values are specified by DS, MODES, and
-* CONDS, and on the right by X inverse.
-*
-* 5. If KL < N-1, the lower bandwidth is reduced to KL using
-* Householder transformations. If KU < N-1, the upper
-* bandwidth is reduced to KU.
-*
-* 6. If ANORM is not negative, the matrix is scaled to have
-* maximum-element-norm ANORM.
-*
-* (Note: since the matrix cannot be reduced beyond Hessenberg form,
-* no packing options are available.)
-*
-* Arguments
-* =========
-*
-* N (input) INTEGER
-* The number of columns (or rows) of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values, and for the
-* upper triangle (see UPPER).
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATME
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( N )
-* This array is used to specify the eigenvalues of A. If
-* MODE=0, then D is assumed to contain the eigenvalues (but
-* see the description of EI), otherwise they will be
-* computed according to MODE, COND, DMAX, and RSIGN and
-* placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the eigenvalues are to
-* be specified:
-* MODE = 0 means use D (with EI) as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed. Each odd-even pair
-* of elements will be either used as two real
-* eigenvalues or as the real and imaginary part
-* of a complex conjugate pair of eigenvalues;
-* the choice of which is done is random, with
-* 50-50 probability, for each pair.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is between 1 and 4, D has entries ranging
-* from 1 to 1/COND, if between -1 and -4, D has entries
-* ranging from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))). Note that DMAX need not be
-* positive: if DMAX is negative (or zero), D will be
-* scaled by a negative number (or zero).
-* Not modified.
-*
-* EI (input) CHARACTER*1 array, dimension ( N )
-* If MODE is 0, and EI(1) is not ' ' (space character),
-* this array specifies which elements of D (on input) are
-* real eigenvalues and which are the real and imaginary parts
-* of a complex conjugate pair of eigenvalues. The elements
-* of EI may then only have the values 'R' and 'I'. If
-* EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is
-* CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex
-* conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th
-* eigenvalue is D(j) (i.e., real). EI(1) may not be 'I',
-* nor may two adjacent elements of EI both have the value 'I'.
-* If MODE is not 0, then EI is ignored. If MODE is 0 and
-* EI(1)=' ', then the eigenvalues will all be real.
-* Not modified.
-*
-* RSIGN (input) CHARACTER*1
-* If MODE is not 0, 6, or -6, and RSIGN='T', then the
-* elements of D, as computed according to MODE and COND, will
-* be multiplied by a random sign (+1 or -1). If RSIGN='F',
-* they will not be. RSIGN may only have the values 'T' or
-* 'F'.
-* Not modified.
-*
-* UPPER (input) CHARACTER*1
-* If UPPER='T', then the elements of A above the diagonal
-* (and above the 2x2 diagonal blocks, if A has complex
-* eigenvalues) will be set to random numbers out of DIST.
-* If UPPER='F', they will not. UPPER may only have the
-* values 'T' or 'F'.
-* Not modified.
-*
-* SIM (input) CHARACTER*1
-* If SIM='T', then A will be operated on by a "similarity
-* transform", i.e., multiplied on the left by a matrix X and
-* on the right by X inverse. X = U S V, where U and V are
-* random unitary matrices and S is a (diagonal) matrix of
-* singular values specified by DS, MODES, and CONDS. If
-* SIM='F', then A will not be transformed.
-* Not modified.
-*
-* DS (input/output) DOUBLE PRECISION array, dimension ( N )
-* This array is used to specify the singular values of X,
-* in the same way that D specifies the eigenvalues of A.
-* If MODE=0, the DS contains the singular values, which
-* may not be zero.
-* Modified if MODE is nonzero.
-*
-* MODES (input) INTEGER
-*
-* CONDS (input) DOUBLE PRECISION
-* Same as MODE and COND, but for specifying the diagonal
-* of S. MODES=-6 and +6 are not allowed (since they would
-* result in randomly ill-conditioned eigenvalues.)
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. KL=1
-* specifies upper Hessenberg form. If KL is at least N-1,
-* then A will have full lower bandwidth. KL must be at
-* least 1.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. KU=1
-* specifies lower Hessenberg form. If KU is at least N-1,
-* then A will have full upper bandwidth; if KU and KL
-* are both at least N-1, then A will be dense. Only one of
-* KU and KL may be less than N-1. KU must be at least 1.
-* Not modified.
-*
-* ANORM (input) DOUBLE PRECISION
-* If ANORM is not negative, then A will be scaled by a non-
-* negative real number to make the maximum-element-norm of A
-* to be ANORM.
-* Not modified.
-*
-* A (output) DOUBLE PRECISION array, dimension ( LDA, N )
-* On exit A is the desired test matrix.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. LDA must be at least N.
-* Not modified.
-*
-* WORK (workspace) DOUBLE PRECISION array, dimension ( 3*N )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => N negative
-* -2 => DIST illegal string
-* -5 => MODE not in range -6 to 6
-* -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or
-* two adjacent elements of EI are 'I'.
-* -9 => RSIGN is not 'T' or 'F'
-* -10 => UPPER is not 'T' or 'F'
-* -11 => SIM is not 'T' or 'F'
-* -12 => MODES=0 and DS has a zero singular value.
-* -13 => MODES is not in the range -5 to 5.
-* -14 => MODES is nonzero and CONDS is less than 1.
-* -15 => KL is less than 1.
-* -16 => KU is less than 1, or KL and KU are both less than
-* N-1.
-* -19 => LDA is less than N.
-* 1 => Error return from DLATM1 (computing D)
-* 2 => Cannot scale to DMAX (max. eigenvalue is 0)
-* 3 => Error return from DLATM1 (computing DS)
-* 4 => Error return from DLARGE
-* 5 => Zero singular value from DLATM1.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatmr.f b/TESTING/MATGEN/dlatmr.f
index 38b38f58..c484e06e 100644
--- a/TESTING/MATGEN/dlatmr.f
+++ b/TESTING/MATGEN/dlatmr.f
@@ -1,11 +1,485 @@
+*> \brief \b DLATMR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
+* CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
+* PACK, A, LDA, IWORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, MODEL, MODER, N
+* DOUBLE PRECISION ANORM, COND, CONDL, CONDR, DMAX, SPARSE
+* ..
+* .. Array Arguments ..
+* INTEGER IPIVOT( * ), ISEED( 4 ), IWORK( * )
+* DOUBLE PRECISION A( LDA, * ), D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATMR generates random matrices of various types for testing
+*> LAPACK programs.
+*>
+*> DLATMR operates by applying the following sequence of
+*> operations:
+*>
+*> Generate a matrix A with random entries of distribution DIST
+*> which is symmetric if SYM='S', and nonsymmetric
+*> if SYM='N'.
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX and RSIGN
+*> as described below.
+*>
+*> Grade the matrix, if desired, from the left and/or right
+*> as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
+*> MODER and CONDR also determine the grading as described
+*> below.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> PIVTNG and IPIVOT.
+*>
+*> Set random entries to zero, if desired, to get a random sparse
+*> matrix as specified by SPARSE.
+*>
+*> Make A a band matrix, if desired, by zeroing out the matrix
+*> outside a band of lower bandwidth KL and upper bandwidth KU.
+*>
+*> Scale A, if desired, to have maximum entry ANORM.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or
+*> square upper triangular)
+*> store the lower half columnwise (if symmetric or
+*> square lower triangular)
+*> same as upper half rowwise if symmetric
+*> store the lower triangle in banded format (if symmetric)
+*> store the upper triangle in banded format (if symmetric)
+*> store the entire matrix in banded format
+*>
+*> Note: If two calls to DLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*>
+*> If two calls to DLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be and
+*> is not maintained with less than full bandwidth.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate a random matrix .
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATMR
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', generated matrix is symmetric.
+*> If SYM='N', generated matrix is nonsymmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (min(M,N))
+*> On entry this array specifies the diagonal entries
+*> of the diagonal of A. D may either be specified
+*> on entry, or set according to MODE and COND as described
+*> below. May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be used:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE neither -6, 0 nor 6, the diagonal is scaled by
+*> DMAX / max(abs(D(i))), so that maximum absolute entry
+*> of diagonal is abs(DMAX). If DMAX is negative (or zero),
+*> diagonal will be scaled by a negative number (or zero).
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE neither -6, 0 nor 6, specifies sign of diagonal
+*> as follows:
+*> 'T' => diagonal entries are multiplied by 1 or -1
+*> with probability .5
+*> 'F' => diagonal unchanged
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] GRADE
+*> \verbatim
+*> GRADE is CHARACTER*1
+*> Specifies grading of matrix as follows:
+*> 'N' => no grading
+*> 'L' => matrix premultiplied by diag( DL )
+*> (only if matrix nonsymmetric)
+*> 'R' => matrix postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'B' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'S' or 'H' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> ('S' for symmetric, or 'H' for Hermitian)
+*> 'E' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> ( 'E' for eigenvalue invariance)
+*> (only if matrix nonsymmetric)
+*> Note: if GRADE='E', then M must equal N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DL
+*> \verbatim
+*> DL is DOUBLE PRECISION array, dimension (M)
+*> If MODEL=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODEL is not zero, then DL will be set according
+*> to MODEL and CONDL, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DL).
+*> If GRADE='E', then DL cannot have zero entries.
+*> Not referenced if GRADE = 'N' or 'R'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODEL
+*> \verbatim
+*> MODEL is INTEGER
+*> This specifies how the diagonal array DL is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDL
+*> \verbatim
+*> CONDL is DOUBLE PRECISION
+*> When MODEL is not zero, this specifies the condition number
+*> of the computed DL. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DR
+*> \verbatim
+*> DR is DOUBLE PRECISION array, dimension (N)
+*> If MODER=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODER is not zero, then DR will be set according
+*> to MODER and CONDR, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DR).
+*> Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODER
+*> \verbatim
+*> MODER is INTEGER
+*> This specifies how the diagonal array DR is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDR
+*> \verbatim
+*> CONDR is DOUBLE PRECISION
+*> When MODER is not zero, this specifies the condition number
+*> of the computed DR. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PIVTNG
+*> \verbatim
+*> PIVTNG is CHARACTER*1
+*> On entry specifies pivoting permutations as follows:
+*> 'N' or ' ' => none.
+*> 'L' => left or row pivoting (matrix must be nonsymmetric).
+*> 'R' => right or column pivoting (matrix must be
+*> nonsymmetric).
+*> 'B' or 'F' => both or full pivoting, i.e., on both sides.
+*> In this case, M must equal N
+*> \endverbatim
+*> \verbatim
+*> If two calls to DLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be
+*> maintained with less than full bandwidth.
+*> \endverbatim
+*>
+*> \param[in] IPIVOT
+*> \verbatim
+*> IPIVOT is INTEGER array, dimension (N or M)
+*> This array specifies the permutation used. After the
+*> basic matrix is generated, the rows, columns, or both
+*> are permuted. If, say, row pivoting is selected, DLATMR
+*> starts with the *last* row and interchanges the M-th and
+*> IPIVOT(M)-th rows, then moves to the next-to-last row,
+*> interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
+*> and so on. In terms of "2-cycles", the permutation is
+*> (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
+*> where the rightmost cycle is applied first. This is the
+*> *inverse* of the effect of pivoting in LINPACK. The idea
+*> is that factoring (with pivoting) an identity matrix
+*> which has been inverse-pivoted in this way should
+*> result in a pivot vector identical to IPIVOT.
+*> Not referenced if PIVTNG = 'N'. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION
+*> On entry specifies the sparsity of the matrix if a sparse
+*> matrix is to be generated. SPARSE should lie between
+*> 0 and 1. To generate a sparse matrix, for each matrix entry
+*> a uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> On entry specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL at least M-1 implies the matrix is not
+*> banded. Must equal KU if matrix is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> On entry specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU at least N-1 implies the matrix is not
+*> banded. Must equal KL if matrix is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is DOUBLE PRECISION
+*> On entry specifies maximum entry of output matrix
+*> (output matrix will by multiplied by a constant so that
+*> its largest absolute entry equal ANORM)
+*> if ANORM is nonnegative. If ANORM is negative no scaling
+*> is done. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> On entry specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if matrix symmetric or square upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if matrix symmetric or square lower triangular)
+*> (same as upper half rowwise if symmetric)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to DLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA,N)
+*> On exit A is the desired test matrix. Only those
+*> entries of A which are significant on output
+*> will be referenced (even if A is in packed or band
+*> storage format). The 'unoccupied corners' of A in
+*> band format will be zeroed out.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> on entry LDA specifies the first dimension of A as
+*> declared in the calling program.
+*> If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
+*> If PACK='C' or 'R', LDA must be at least 1.
+*> If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
+*> If PACK='Z', LDA must be at least KUU+KLL+1, where
+*> KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array, dimension ( N or M)
+*> Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error parameter on exit:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S' or 'H'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
+*> -11 => GRADE illegal string, or GRADE='E' and
+*> M not equal to N, or GRADE='L', 'R', 'B' or 'E' and
+*> SYM = 'S' or 'H'
+*> -12 => GRADE = 'E' and DL contains zero
+*> -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
+*> 'S' or 'E'
+*> -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
+*> and MODEL neither -6, 0 nor 6
+*> -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
+*> -17 => CONDR less than 1.0, GRADE='R' or 'B', and
+*> MODER neither -6, 0 nor 6
+*> -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
+*> M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
+*> or 'H'
+*> -19 => IPIVOT contains out of range number and
+*> PIVTNG not equal to 'N'
+*> -20 => KL negative
+*> -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -22 => SPARSE not in range 0. to 1.
+*> -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
+*> and SYM='N', or PACK='C' and SYM='N' and either KL
+*> not equal to 0 or N not equal to M, or PACK='R' and
+*> SYM='N', and either KU not equal to 0 or N not equal
+*> to M
+*> -26 => LDA too small
+*> 1 => Error return from DLATM1 (computing D)
+*> 2 => Cannot scale diagonal to DMAX (max. entry is 0)
+*> 3 => Error return from DLATM1 (computing DL)
+*> 4 => Error return from DLATM1 (computing DR)
+*> 5 => ANORM is positive, but matrix constructed prior to
+*> attempting to scale it to have norm ANORM, is zero
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
$ CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
$ PACK, A, LDA, IWORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
@@ -17,348 +491,6 @@
DOUBLE PRECISION A( LDA, * ), D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATMR generates random matrices of various types for testing
-* LAPACK programs.
-*
-* DLATMR operates by applying the following sequence of
-* operations:
-*
-* Generate a matrix A with random entries of distribution DIST
-* which is symmetric if SYM='S', and nonsymmetric
-* if SYM='N'.
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX and RSIGN
-* as described below.
-*
-* Grade the matrix, if desired, from the left and/or right
-* as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
-* MODER and CONDR also determine the grading as described
-* below.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* PIVTNG and IPIVOT.
-*
-* Set random entries to zero, if desired, to get a random sparse
-* matrix as specified by SPARSE.
-*
-* Make A a band matrix, if desired, by zeroing out the matrix
-* outside a band of lower bandwidth KL and upper bandwidth KU.
-*
-* Scale A, if desired, to have maximum entry ANORM.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or
-* square upper triangular)
-* store the lower half columnwise (if symmetric or
-* square lower triangular)
-* same as upper half rowwise if symmetric
-* store the lower triangle in banded format (if symmetric)
-* store the upper triangle in banded format (if symmetric)
-* store the entire matrix in banded format
-*
-* Note: If two calls to DLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-*
-* If two calls to DLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be and
-* is not maintained with less than full bandwidth.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate a random matrix .
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATMR
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', generated matrix is symmetric.
-* If SYM='N', generated matrix is nonsymmetric.
-* Not modified.
-*
-* D (input/output) DOUBLE PRECISION array, dimension (min(M,N))
-* On entry this array specifies the diagonal entries
-* of the diagonal of A. D may either be specified
-* on entry, or set according to MODE and COND as described
-* below. May be changed on exit if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be used:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE neither -6, 0 nor 6, the diagonal is scaled by
-* DMAX / max(abs(D(i))), so that maximum absolute entry
-* of diagonal is abs(DMAX). If DMAX is negative (or zero),
-* diagonal will be scaled by a negative number (or zero).
-*
-* RSIGN (input) CHARACTER*1
-* If MODE neither -6, 0 nor 6, specifies sign of diagonal
-* as follows:
-* 'T' => diagonal entries are multiplied by 1 or -1
-* with probability .5
-* 'F' => diagonal unchanged
-* Not modified.
-*
-* GRADE (input) CHARACTER*1
-* Specifies grading of matrix as follows:
-* 'N' => no grading
-* 'L' => matrix premultiplied by diag( DL )
-* (only if matrix nonsymmetric)
-* 'R' => matrix postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'B' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'S' or 'H' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* ('S' for symmetric, or 'H' for Hermitian)
-* 'E' => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* ( 'E' for eigenvalue invariance)
-* (only if matrix nonsymmetric)
-* Note: if GRADE='E', then M must equal N.
-* Not modified.
-*
-* DL (input/output) DOUBLE PRECISION array, dimension (M)
-* If MODEL=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODEL is not zero, then DL will be set according
-* to MODEL and CONDL, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DL).
-* If GRADE='E', then DL cannot have zero entries.
-* Not referenced if GRADE = 'N' or 'R'. Changed on exit.
-*
-* MODEL (input) INTEGER
-* This specifies how the diagonal array DL is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDL (input) DOUBLE PRECISION
-* When MODEL is not zero, this specifies the condition number
-* of the computed DL. Not modified.
-*
-* DR (input/output) DOUBLE PRECISION array, dimension (N)
-* If MODER=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODER is not zero, then DR will be set according
-* to MODER and CONDR, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DR).
-* Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'.
-* Changed on exit.
-*
-* MODER (input) INTEGER
-* This specifies how the diagonal array DR is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDR (input) DOUBLE PRECISION
-* When MODER is not zero, this specifies the condition number
-* of the computed DR. Not modified.
-*
-* PIVTNG (input) CHARACTER*1
-* On entry specifies pivoting permutations as follows:
-* 'N' or ' ' => none.
-* 'L' => left or row pivoting (matrix must be nonsymmetric).
-* 'R' => right or column pivoting (matrix must be
-* nonsymmetric).
-* 'B' or 'F' => both or full pivoting, i.e., on both sides.
-* In this case, M must equal N
-*
-* If two calls to DLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be
-* maintained with less than full bandwidth.
-*
-* IPIVOT (input) INTEGER array, dimension (N or M)
-* This array specifies the permutation used. After the
-* basic matrix is generated, the rows, columns, or both
-* are permuted. If, say, row pivoting is selected, DLATMR
-* starts with the *last* row and interchanges the M-th and
-* IPIVOT(M)-th rows, then moves to the next-to-last row,
-* interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
-* and so on. In terms of "2-cycles", the permutation is
-* (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
-* where the rightmost cycle is applied first. This is the
-* *inverse* of the effect of pivoting in LINPACK. The idea
-* is that factoring (with pivoting) an identity matrix
-* which has been inverse-pivoted in this way should
-* result in a pivot vector identical to IPIVOT.
-* Not referenced if PIVTNG = 'N'. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION
-* On entry specifies the sparsity of the matrix if a sparse
-* matrix is to be generated. SPARSE should lie between
-* 0 and 1. To generate a sparse matrix, for each matrix entry
-* a uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
-* KL (input) INTEGER
-* On entry specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL at least M-1 implies the matrix is not
-* banded. Must equal KU if matrix is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* On entry specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU at least N-1 implies the matrix is not
-* banded. Must equal KL if matrix is symmetric.
-* Not modified.
-*
-* ANORM (input) DOUBLE PRECISION
-* On entry specifies maximum entry of output matrix
-* (output matrix will by multiplied by a constant so that
-* its largest absolute entry equal ANORM)
-* if ANORM is nonnegative. If ANORM is negative no scaling
-* is done. Not modified.
-*
-* PACK (input) CHARACTER*1
-* On entry specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if matrix symmetric or square upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if matrix symmetric or square lower triangular)
-* (same as upper half rowwise if symmetric)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to DLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (output) DOUBLE PRECISION array, dimension (LDA,N)
-* On exit A is the desired test matrix. Only those
-* entries of A which are significant on output
-* will be referenced (even if A is in packed or band
-* storage format). The 'unoccupied corners' of A in
-* band format will be zeroed out.
-*
-* LDA (input) INTEGER
-* on entry LDA specifies the first dimension of A as
-* declared in the calling program.
-* If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
-* If PACK='C' or 'R', LDA must be at least 1.
-* If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
-* If PACK='Z', LDA must be at least KUU+KLL+1, where
-* KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
-* Not modified.
-*
-* IWORK (workspace) INTEGER array, dimension ( N or M)
-* Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
-*
-* INFO (output) INTEGER
-* Error parameter on exit:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S' or 'H'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
-* -11 => GRADE illegal string, or GRADE='E' and
-* M not equal to N, or GRADE='L', 'R', 'B' or 'E' and
-* SYM = 'S' or 'H'
-* -12 => GRADE = 'E' and DL contains zero
-* -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
-* 'S' or 'E'
-* -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
-* and MODEL neither -6, 0 nor 6
-* -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
-* -17 => CONDR less than 1.0, GRADE='R' or 'B', and
-* MODER neither -6, 0 nor 6
-* -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
-* M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
-* or 'H'
-* -19 => IPIVOT contains out of range number and
-* PIVTNG not equal to 'N'
-* -20 => KL negative
-* -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -22 => SPARSE not in range 0. to 1.
-* -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
-* and SYM='N', or PACK='C' and SYM='N' and either KL
-* not equal to 0 or N not equal to M, or PACK='R' and
-* SYM='N', and either KU not equal to 0 or N not equal
-* to M
-* -26 => LDA too small
-* 1 => Error return from DLATM1 (computing D)
-* 2 => Cannot scale diagonal to DMAX (max. entry is 0)
-* 3 => Error return from DLATM1 (computing DL)
-* 4 => Error return from DLATM1 (computing DR)
-* 5 => ANORM is positive, but matrix constructed prior to
-* attempting to scale it to have norm ANORM, is zero
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatms.f b/TESTING/MATGEN/dlatms.f
index 9d36d677..a10f5fa7 100644
--- a/TESTING/MATGEN/dlatms.f
+++ b/TESTING/MATGEN/dlatms.f
@@ -1,9 +1,334 @@
+*> \brief \b DLATMS
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, PACK, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, N
+* DOUBLE PRECISION COND, DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATMS generates random matrices with specified singular values
+*> (or symmetric/hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> DLATMS operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then
+*> convert the bandwidth-1 to a bandwidth-2 matrix, etc.
+*> Note that for reasonably small bandwidths (relative to
+*> M and N) this requires less storage, as a dense matrix
+*> is not generated. Also, for symmetric matrices, only
+*> one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or upper
+*> triangular)
+*> store the lower half columnwise (if symmetric or lower
+*> triangular)
+*> store the lower triangle in banded format (if symmetric
+*> or lower triangular)
+*> store the upper triangle in banded format (if symmetric
+*> or upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATMS
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', the generated matrix is symmetric, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is symmetric, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( MIN( M , N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if the matrix is symmetric or upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if the matrix is symmetric or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to DLATMS differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension ( 3*MAX( N , M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from DLATM1
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from DLAGGE or SLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, PACK, SYM
@@ -15,238 +340,6 @@
DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* DLATMS generates random matrices with specified singular values
-* (or symmetric/hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* DLATMS operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then
-* convert the bandwidth-1 to a bandwidth-2 matrix, etc.
-* Note that for reasonably small bandwidths (relative to
-* M and N) this requires less storage, as a dense matrix
-* is not generated. Also, for symmetric matrices, only
-* one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or upper
-* triangular)
-* store the lower half columnwise (if symmetric or lower
-* triangular)
-* store the lower triangle in banded format (if symmetric
-* or lower triangular)
-* store the upper triangle in banded format (if symmetric
-* or upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATMS
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', the generated matrix is symmetric, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is symmetric, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* Not modified.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( MIN( M , N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if the matrix is symmetric or upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if the matrix is symmetric or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to DLATMS differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) DOUBLE PRECISION array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) DOUBLE PRECISION array, dimension ( 3*MAX( N , M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from DLATM1
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from DLAGGE or SLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/dlatmt.f b/TESTING/MATGEN/dlatmt.f
index 90a0001d..04b80dfb 100644
--- a/TESTING/MATGEN/dlatmt.f
+++ b/TESTING/MATGEN/dlatmt.f
@@ -1,9 +1,346 @@
+*> \brief \b DLATMT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE DLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RANK, KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* DOUBLE PRECISION COND, DMAX
+* INTEGER INFO, KL, KU, LDA, M, MODE, N, RANK
+* CHARACTER DIST, PACK, SYM
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> DLATMT generates random matrices with specified singular values
+*> (or symmetric/hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> DLATMT operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then
+*> convert the bandwidth-1 to a bandwidth-2 matrix, etc.
+*> Note that for reasonably small bandwidths (relative to
+*> M and N) this requires less storage, as a dense matrix
+*> is not generated. Also, for symmetric matrices, only
+*> one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or upper
+*> triangular)
+*> store the lower half columnwise (if symmetric or lower
+*> triangular)
+*> store the lower triangle in banded format (if symmetric
+*> or lower triangular)
+*> store the upper triangle in banded format (if symmetric
+*> or upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to DLATMT
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', the generated matrix is symmetric, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is symmetric, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( MIN( M , N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> \endverbatim
+*> \verbatim
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
+*> \endverbatim
+*> \verbatim
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RANK
+*> \verbatim
+*> RANK is INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if the matrix is symmetric or upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if the matrix is symmetric or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to DLATMT differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is DOUBLE PRECISION array, dimension ( 3*MAX( N , M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from DLATM7
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from DLAGGE or DLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup double_matgen
+*
+* =====================================================================
SUBROUTINE DLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RANK, KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
DOUBLE PRECISION COND, DMAX
@@ -15,245 +352,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* DLATMT generates random matrices with specified singular values
-* (or symmetric/hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* DLATMT operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then
-* convert the bandwidth-1 to a bandwidth-2 matrix, etc.
-* Note that for reasonably small bandwidths (relative to
-* M and N) this requires less storage, as a dense matrix
-* is not generated. Also, for symmetric matrices, only
-* one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or upper
-* triangular)
-* store the lower half columnwise (if symmetric or lower
-* triangular)
-* store the lower triangle in banded format (if symmetric
-* or lower triangular)
-* store the upper triangle in banded format (if symmetric
-* or upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to DLATMT
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', the generated matrix is symmetric, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is symmetric, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* Not modified.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( MIN( M , N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-*
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
-*
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* RANK (input) INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if the matrix is symmetric or upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if the matrix is symmetric or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to DLATMT differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) DOUBLE PRECISION array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) DOUBLE PRECISION array, dimension ( 3*MAX( N , M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from DLATM7
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from DLAGGE or DLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slagge.f b/TESTING/MATGEN/slagge.f
index f2f7d7aa..e551eee5 100644
--- a/TESTING/MATGEN/slagge.f
+++ b/TESTING/MATGEN/slagge.f
@@ -1,62 +1,132 @@
- SUBROUTINE SLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, KL, KU, LDA, M, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL A( LDA, * ), D( * ), WORK( * )
-* ..
-*
+*> \brief \b SLAGGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), D( * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* SLAGGE generates a real general m by n matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with random orthogonal matrices:
-* A = U*D*V. The lower and upper bandwidths may then be reduced to
-* kl and ku by additional orthogonal transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLAGGE generates a real general m by n matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with random orthogonal matrices:
+*> A = U*D*V. The lower and upper bandwidths may then be reduced to
+*> kl and ku by additional orthogonal transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* The number of rows of the matrix A. M >= 0.
-*
-* N (input) INTEGER
-* The number of columns of the matrix A. N >= 0.
-*
-* KL (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= KL <= M-1.
-*
-* KU (input) INTEGER
-* The number of nonzero superdiagonals within the band of A.
-* 0 <= KU <= N-1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of the matrix A. M >= 0.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= KL <= M-1.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> The number of nonzero superdiagonals within the band of A.
+*> 0 <= KU <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (min(M,N))
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA,N)
+*> The generated m by n matrix A.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= M.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (M+N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) REAL array, dimension (min(M,N))
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) REAL array, dimension (LDA,N)
-* The generated m by n matrix A.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= M.
+*> \ingroup real_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE SLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) REAL array, dimension (M+N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL A( LDA, * ), D( * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slagsy.f b/TESTING/MATGEN/slagsy.f
index 00ff328e..18fdee00 100644
--- a/TESTING/MATGEN/slagsy.f
+++ b/TESTING/MATGEN/slagsy.f
@@ -1,56 +1,120 @@
- SUBROUTINE SLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL A( LDA, * ), D( * ), WORK( * )
-* ..
-*
+*> \brief \b SLAGSY
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), D( * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* SLAGSY generates a real symmetric matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random orthogonal matrix:
-* A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
-* orthogonal transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLAGSY generates a real symmetric matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random orthogonal matrix:
+*> A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
+*> orthogonal transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA,N)
+*> The generated n by n symmetric matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) REAL array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) REAL array, dimension (LDA,N)
-* The generated n by n symmetric matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup real_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE SLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) REAL array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL A( LDA, * ), D( * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slahilb.f b/TESTING/MATGEN/slahilb.f
index 60d6dc8a..ceb9ef25 100644
--- a/TESTING/MATGEN/slahilb.f
+++ b/TESTING/MATGEN/slahilb.f
@@ -1,106 +1,166 @@
+*> \brief \b SLAHILB
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK, INFO)
+*
+* .. Scalar Arguments ..
+* INTEGER N, NRHS, LDA, LDX, LDB, INFO
+* .. Array Arguments ..
+* REAL A(LDA, N), X(LDX, NRHS), B(LDB, NRHS), WORK(N)
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLAHILB generates an N by N scaled Hilbert matrix in A along with
+*> NRHS right-hand sides in B and solutions in X such that A*X=B.
+*>
+*> The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
+*> entries are integers. The right-hand sides are the first NRHS
+*> columns of M * the identity matrix, and the solutions are the
+*> first NRHS columns of the inverse Hilbert matrix.
+*>
+*> The condition number of the Hilbert matrix grows exponentially with
+*> its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
+*> Hilbert matrices beyond a relatively small dimension cannot be
+*> generated exactly without extra precision. Precision is exhausted
+*> when the largest entry in the inverse Hilbert matrix is greater than
+*> 2 to the power of the number of bits in the fraction of the data type
+*> used plus one, which is 24 for single precision.
+*>
+*> In single, the generated solution is exact for N <= 6 and has
+*> small componentwise error for 7 <= N <= 11.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The dimension of the matrix A.
+*> \endverbatim
+*>
+*> \param[in] NRHS
+*> \verbatim
+*> NRHS is INTEGER
+*> The requested number of right-hand sides.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA, N)
+*> The generated scaled Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is REAL array, dimension (LDX, NRHS)
+*> The generated exact solutions. Currently, the first NRHS
+*> columns of the inverse Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of the array X. LDX >= N.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is REAL array, dimension (LDB, NRHS)
+*> The generated right-hand sides. Currently, the first NRHS
+*> columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of the array B. LDB >= N.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> = 1: N is too large; the data is still generated but may not
+*> be not exact.
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK, INFO)
-!
-! -- LAPACK auxiliary test routine (version 3.2.2) --
-! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
-! Courant Institute, Argonne National Lab, and Rice University
-* June 2010
-!
-! David Vu <dtv@cs.berkeley.edu>
-! Yozo Hida <yozo@cs.berkeley.edu>
-! Jason Riedy <ejr@cs.berkeley.edu>
-! D. Halligan <dhalligan@berkeley.edu>
-!
- IMPLICIT NONE
-! .. Scalar Arguments ..
+*
+* -- LAPACK auxiliary routine (version 3.2.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
INTEGER N, NRHS, LDA, LDX, LDB, INFO
-! .. Array Arguments ..
+* .. Array Arguments ..
REAL A(LDA, N), X(LDX, NRHS), B(LDB, NRHS), WORK(N)
-! ..
-!
-! Purpose
-! =======
-!
-! SLAHILB generates an N by N scaled Hilbert matrix in A along with
-! NRHS right-hand sides in B and solutions in X such that A*X=B.
-!
-! The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
-! entries are integers. The right-hand sides are the first NRHS
-! columns of M * the identity matrix, and the solutions are the
-! first NRHS columns of the inverse Hilbert matrix.
-!
-! The condition number of the Hilbert matrix grows exponentially with
-! its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
-! Hilbert matrices beyond a relatively small dimension cannot be
-! generated exactly without extra precision. Precision is exhausted
-! when the largest entry in the inverse Hilbert matrix is greater than
-! 2 to the power of the number of bits in the fraction of the data type
-! used plus one, which is 24 for single precision.
-!
-! In single, the generated solution is exact for N <= 6 and has
-! small componentwise error for 7 <= N <= 11.
-!
-! Arguments
-! =========
-!
-! N (input) INTEGER
-! The dimension of the matrix A.
-!
-! NRHS (input) INTEGER
-! The requested number of right-hand sides.
-!
-! A (output) REAL array, dimension (LDA, N)
-! The generated scaled Hilbert matrix.
-!
-! LDA (input) INTEGER
-! The leading dimension of the array A. LDA >= N.
-!
-! X (output) REAL array, dimension (LDX, NRHS)
-! The generated exact solutions. Currently, the first NRHS
-! columns of the inverse Hilbert matrix.
-!
-! LDX (input) INTEGER
-! The leading dimension of the array X. LDX >= N.
-!
-! B (output) REAL array, dimension (LDB, NRHS)
-! The generated right-hand sides. Currently, the first NRHS
-! columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
-!
-! LDB (input) INTEGER
-! The leading dimension of the array B. LDB >= N.
-!
-! WORK (workspace) REAL array, dimension (N)
-!
-!
-! INFO (output) INTEGER
-! = 0: successful exit
-! = 1: N is too large; the data is still generated but may not
-! be not exact.
-! < 0: if INFO = -i, the i-th argument had an illegal value
-!
-! =====================================================================
+* ..
+*
+* =====================================================================
-! .. Local Scalars ..
+* .. Local Scalars ..
INTEGER TM, TI, R
INTEGER M
INTEGER I, J
-! .. Parameters ..
-! NMAX_EXACT the largest dimension where the generated data is
-! exact.
-! NMAX_APPROX the largest dimension where the generated data has
-! a small componentwise relative error.
+* .. Parameters ..
+* NMAX_EXACT the largest dimension where the generated data is
+* exact.
+* NMAX_APPROX the largest dimension where the generated data has
+* a small componentwise relative error.
INTEGER NMAX_EXACT, NMAX_APPROX
PARAMETER (NMAX_EXACT = 6, NMAX_APPROX = 11)
-! ..
-! .. External Functions
+* ..
+* .. External Functions
EXTERNAL SLASET
INTRINSIC REAL
-! ..
-! .. Executable Statements ..
-!
-! Test the input arguments
-!
+* ..
+* .. Executable Statements ..
+*
+* Test the input arguments
+*
INFO = 0
IF (N .LT. 0 .OR. N .GT. NMAX_APPROX) THEN
INFO = -1
@@ -121,8 +181,8 @@
INFO = 1
END IF
-! Compute M = the LCM of the integers [1, 2*N-1]. The largest
-! reasonable N is small enough that integers suffice (up to N = 11).
+* Compute M = the LCM of the integers [1, 2*N-1]. The largest
+* reasonable N is small enough that integers suffice (up to N = 11).
M = 1
DO I = 2, (2*N-1)
TM = M
@@ -136,20 +196,20 @@
M = (M / TI) * I
END DO
-! Generate the scaled Hilbert matrix in A
+* Generate the scaled Hilbert matrix in A
DO J = 1, N
DO I = 1, N
A(I, J) = REAL(M) / (I + J - 1)
END DO
END DO
-! Generate matrix B as simply the first NRHS columns of M * the
-! identity.
+* Generate matrix B as simply the first NRHS columns of M * the
+* identity.
CALL SLASET('Full', N, NRHS, 0.0, REAL(M), B, LDB)
-! Generate the true solutions in X. Because B = the first NRHS
-! columns of M*I, the true solutions are just the first NRHS columns
-! of the inverse Hilbert matrix.
+* Generate the true solutions in X. Because B = the first NRHS
+* columns of M*I, the true solutions are just the first NRHS columns
+* of the inverse Hilbert matrix.
WORK(1) = N
DO J = 2, N
WORK(J) = ( ( (WORK(J-1)/(J-1)) * (J-1 - N) ) /(J-1) )
diff --git a/TESTING/MATGEN/slakf2.f b/TESTING/MATGEN/slakf2.f
index ef0d38f9..a5bbdad3 100644
--- a/TESTING/MATGEN/slakf2.f
+++ b/TESTING/MATGEN/slakf2.f
@@ -1,54 +1,125 @@
- SUBROUTINE SLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDZ, M, N
-* ..
-* .. Array Arguments ..
- REAL A( LDA, * ), B( LDA, * ), D( LDA, * ),
- $ E( LDA, * ), Z( LDZ, * )
-* ..
-*
+*> \brief \b SLAKF2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+* REAL A( LDA, * ), B( LDA, * ), D( LDA, * ),
+* $ E( LDA, * ), Z( LDZ, * )
+* ..
+*
* Purpose
* =======
*
-* Form the 2*M*N by 2*M*N matrix
-*
-* Z = [ kron(In, A) -kron(B', Im) ]
-* [ kron(In, D) -kron(E', Im) ],
-*
-* where In is the identity matrix of size n and X' is the transpose
-* of X. kron(X, Y) is the Kronecker product between the matrices X
-* and Y.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> Form the 2*M*N by 2*M*N matrix
+*>
+*> Z = [ kron(In, A) -kron(B', Im) ]
+*> [ kron(In, D) -kron(E', Im) ],
+*>
+*> where In is the identity matrix of size n and X' is the transpose
+*> of X. kron(X, Y) is the Kronecker product between the matrices X
+*> and Y.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] A
+*> \verbatim
+*> A is REAL, dimension ( LDA, M )
+*> The matrix A in the output matrix Z.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \endverbatim
+*>
+*> \param[in] B
+*> \verbatim
+*> B is REAL, dimension ( LDA, N )
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL, dimension ( LDA, M )
+*> \endverbatim
+*>
+*> \param[in] E
+*> \verbatim
+*> E is REAL, dimension ( LDA, N )
+*> \endverbatim
+*> \verbatim
+*> The matrices used in forming the output matrix Z.
+*> \endverbatim
+*>
+*> \param[out] Z
+*> \verbatim
+*> Z is REAL, dimension ( LDZ, 2*M*N )
+*> The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+*> \endverbatim
+*>
+*> \param[in] LDZ
+*> \verbatim
+*> LDZ is INTEGER
+*> The leading dimension of Z. ( LDZ >= 2*M*N )
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* N (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input) REAL, dimension ( LDA, M )
-* The matrix A in the output matrix Z.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \ingroup real_matgen
*
-* B (input) REAL, dimension ( LDA, N )
-* D (input) REAL, dimension ( LDA, M )
-* E (input) REAL, dimension ( LDA, N )
-* The matrices used in forming the output matrix Z.
+* =====================================================================
+ SUBROUTINE SLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
*
-* Z (output) REAL, dimension ( LDZ, 2*M*N )
-* The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* LDZ (input) INTEGER
-* The leading dimension of Z. ( LDZ >= 2*M*N )
+* .. Scalar Arguments ..
+ INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+ REAL A( LDA, * ), B( LDA, * ), D( LDA, * ),
+ $ E( LDA, * ), Z( LDZ, * )
+* ..
*
* ====================================================================
*
diff --git a/TESTING/MATGEN/slaran.f b/TESTING/MATGEN/slaran.f
index 97ae5be9..079aa349 100644
--- a/TESTING/MATGEN/slaran.f
+++ b/TESTING/MATGEN/slaran.f
@@ -1,40 +1,84 @@
- REAL FUNCTION SLARAN( ISEED )
+*> \brief \b SLARAN
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
*
+* Definition
+* ==========
+*
+* REAL FUNCTION SLARAN( ISEED )
+*
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* SLARAN returns a random real number from a uniform (0,1)
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLARAN returns a random real number from a uniform (0,1)
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine uses a multiplicative congruential method with modulus
+*> 2**48 and multiplier 33952834046453 (see G.S.Fishman,
+*> 'Multiplicative congruential random number generators with modulus
+*> 2**b: an exhaustive analysis for b = 32 and a partial analysis for
+*> b = 48', Math. Comp. 189, pp 331-344, 1990).
+*>
+*> 48-bit integers are stored in 4 integer array elements with 12 bits
+*> per element. Hence the routine is portable across machines with
+*> integers of 32 bits or more.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ REAL FUNCTION SLARAN( ISEED )
*
-* This routine uses a multiplicative congruential method with modulus
-* 2**48 and multiplier 33952834046453 (see G.S.Fishman,
-* 'Multiplicative congruential random number generators with modulus
-* 2**b: an exhaustive analysis for b = 32 and a partial analysis for
-* b = 48', Math. Comp. 189, pp 331-344, 1990).
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* 48-bit integers are stored in 4 integer array elements with 12 bits
-* per element. Hence the routine is portable across machines with
-* integers of 32 bits or more.
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slarge.f b/TESTING/MATGEN/slarge.f
index 7ee18ba6..8293c289 100644
--- a/TESTING/MATGEN/slarge.f
+++ b/TESTING/MATGEN/slarge.f
@@ -1,48 +1,106 @@
- SUBROUTINE SLARGE( N, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1)
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- REAL A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b SLARGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLARGE( N, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* SLARGE pre- and post-multiplies a real general n by n matrix A
-* with a random orthogonal matrix: A = U*D*U'.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLARGE pre- and post-multiplies a real general n by n matrix A
+*> with a random orthogonal matrix: A = U*D*U'.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA,N)
+*> On entry, the original n by n matrix A.
+*> On exit, A is overwritten by U*A*U' for some random
+*> orthogonal matrix U.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input/output) REAL array, dimension (LDA,N)
-* On entry, the original n by n matrix A.
-* On exit, A is overwritten by U*A*U' for some random
-* orthogonal matrix U.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup real_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE SLARGE( N, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) REAL array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ REAL A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slarnd.f b/TESTING/MATGEN/slarnd.f
index 9386d6d6..3868af38 100644
--- a/TESTING/MATGEN/slarnd.f
+++ b/TESTING/MATGEN/slarnd.f
@@ -1,43 +1,93 @@
- REAL FUNCTION SLARND( IDIST, ISEED )
+*> \brief \b SLARND
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Scalar Arguments ..
- INTEGER IDIST
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
*
+* REAL FUNCTION SLARND( IDIST, ISEED )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* SLARND returns a random real number from a uniform or normal
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLARND returns a random real number from a uniform or normal
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* IDIST (input) INTEGER
-* Specifies the distribution of the random numbers:
-* = 1: uniform (0,1)
-* = 2: uniform (-1,1)
-* = 3: normal (0,1)
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> Specifies the distribution of the random numbers:
+*> = 1: uniform (0,1)
+*> = 2: uniform (-1,1)
+*> = 3: normal (0,1)
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine calls the auxiliary routine SLARAN to generate a random
+*> real number from a uniform (0,1) distribution. The Box-Muller method
+*> is used to transform numbers from a uniform to a normal distribution.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ REAL FUNCTION SLARND( IDIST, ISEED )
*
-* This routine calls the auxiliary routine SLARAN to generate a random
-* real number from a uniform (0,1) distribution. The Box-Muller method
-* is used to transform numbers from a uniform to a normal distribution.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
+ INTEGER IDIST
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slaror.f b/TESTING/MATGEN/slaror.f
index 4e5bef53..b1711e1e 100644
--- a/TESTING/MATGEN/slaror.f
+++ b/TESTING/MATGEN/slaror.f
@@ -1,8 +1,161 @@
+*> \brief \b SLAROR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER INIT, SIDE
+* INTEGER INFO, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), X( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLAROR pre- or post-multiplies an M by N matrix A by a random
+*> orthogonal matrix U, overwriting A. A may optionally be initialized
+*> to the identity matrix before multiplying by U. U is generated using
+*> the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409).
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] SIDE
+*> \verbatim
+*> SIDE is CHARACTER*1
+*> Specifies whether A is multiplied on the left or right by U.
+*> = 'L': Multiply A on the left (premultiply) by U
+*> = 'R': Multiply A on the right (postmultiply) by U'
+*> = 'C' or 'T': Multiply A on the left by U and the right
+*> by U' (Here, U' means U-transpose.)
+*> \endverbatim
+*>
+*> \param[in] INIT
+*> \verbatim
+*> INIT is CHARACTER*1
+*> Specifies whether or not A should be initialized to the
+*> identity matrix.
+*> = 'I': Initialize A to (a section of) the identity matrix
+*> before applying U.
+*> = 'N': No initialization. Apply U to the input matrix A.
+*> \endverbatim
+*> \verbatim
+*> INIT = 'I' may be used to generate square or rectangular
+*> orthogonal matrices:
+*> \endverbatim
+*> \verbatim
+*> For M = N and SIDE = 'L' or 'R', the rows will be orthogonal
+*> to each other, as will the columns.
+*> \endverbatim
+*> \verbatim
+*> If M < N, SIDE = 'R' produces a dense matrix whose rows are
+*> orthogonal and whose columns are not, while SIDE = 'L'
+*> produces a matrix whose rows are orthogonal, and whose first
+*> M columns are orthogonal, and whose remaining columns are
+*> zero.
+*> \endverbatim
+*> \verbatim
+*> If M > N, SIDE = 'L' produces a dense matrix whose columns
+*> are orthogonal and whose rows are not, while SIDE = 'R'
+*> produces a matrix whose columns are orthogonal, and whose
+*> first M rows are orthogonal, and whose remaining rows are
+*> zero.
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA, N)
+*> On entry, the array A.
+*> On exit, overwritten by U A ( if SIDE = 'L' ),
+*> or by A U ( if SIDE = 'R' ),
+*> or by U A U' ( if SIDE = 'C' or 'T').
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= max(1,M).
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. The array elements should be between 0 and 4095;
+*> if not they will be reduced mod 4096. Also, ISEED(4) must
+*> be odd. The random number generator uses a linear
+*> congruential sequence limited to small integers, and so
+*> should produce machine independent random numbers. The
+*> values of ISEED are changed on exit, and can be used in the
+*> next call to SLAROR to continue the same random number
+*> sequence.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is REAL array, dimension (3*MAX( M, N ))
+*> Workspace of length
+*> 2*M + N if SIDE = 'L',
+*> 2*N + M if SIDE = 'R',
+*> 3*N if SIDE = 'C' or 'T'.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> An error flag. It is set to:
+*> = 0: normal return
+*> < 0: if INFO = -k, the k-th argument had an illegal value
+*> = 1: if the random numbers generated by SLARND are bad.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER INIT, SIDE
@@ -13,87 +166,6 @@
REAL A( LDA, * ), X( * )
* ..
*
-* Purpose
-* =======
-*
-* SLAROR pre- or post-multiplies an M by N matrix A by a random
-* orthogonal matrix U, overwriting A. A may optionally be initialized
-* to the identity matrix before multiplying by U. U is generated using
-* the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409).
-*
-* Arguments
-* =========
-*
-* SIDE (input) CHARACTER*1
-* Specifies whether A is multiplied on the left or right by U.
-* = 'L': Multiply A on the left (premultiply) by U
-* = 'R': Multiply A on the right (postmultiply) by U'
-* = 'C' or 'T': Multiply A on the left by U and the right
-* by U' (Here, U' means U-transpose.)
-*
-* INIT (input) CHARACTER*1
-* Specifies whether or not A should be initialized to the
-* identity matrix.
-* = 'I': Initialize A to (a section of) the identity matrix
-* before applying U.
-* = 'N': No initialization. Apply U to the input matrix A.
-*
-* INIT = 'I' may be used to generate square or rectangular
-* orthogonal matrices:
-*
-* For M = N and SIDE = 'L' or 'R', the rows will be orthogonal
-* to each other, as will the columns.
-*
-* If M < N, SIDE = 'R' produces a dense matrix whose rows are
-* orthogonal and whose columns are not, while SIDE = 'L'
-* produces a matrix whose rows are orthogonal, and whose first
-* M columns are orthogonal, and whose remaining columns are
-* zero.
-*
-* If M > N, SIDE = 'L' produces a dense matrix whose columns
-* are orthogonal and whose rows are not, while SIDE = 'R'
-* produces a matrix whose columns are orthogonal, and whose
-* first M rows are orthogonal, and whose remaining rows are
-* zero.
-*
-* M (input) INTEGER
-* The number of rows of A.
-*
-* N (input) INTEGER
-* The number of columns of A.
-*
-* A (input/output) REAL array, dimension (LDA, N)
-* On entry, the array A.
-* On exit, overwritten by U A ( if SIDE = 'L' ),
-* or by A U ( if SIDE = 'R' ),
-* or by U A U' ( if SIDE = 'C' or 'T').
-*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= max(1,M).
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. The array elements should be between 0 and 4095;
-* if not they will be reduced mod 4096. Also, ISEED(4) must
-* be odd. The random number generator uses a linear
-* congruential sequence limited to small integers, and so
-* should produce machine independent random numbers. The
-* values of ISEED are changed on exit, and can be used in the
-* next call to SLAROR to continue the same random number
-* sequence.
-*
-* X (workspace) REAL array, dimension (3*MAX( M, N ))
-* Workspace of length
-* 2*M + N if SIDE = 'L',
-* 2*N + M if SIDE = 'R',
-* 3*N if SIDE = 'C' or 'T'.
-*
-* INFO (output) INTEGER
-* An error flag. It is set to:
-* = 0: normal return
-* < 0: if INFO = -k, the k-th argument had an illegal value
-* = 1: if the random numbers generated by SLARND are bad.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slarot.f b/TESTING/MATGEN/slarot.f
index 466cb29f..0bf495be 100644
--- a/TESTING/MATGEN/slarot.f
+++ b/TESTING/MATGEN/slarot.f
@@ -1,202 +1,254 @@
- SUBROUTINE SLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
- $ XRIGHT )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- LOGICAL LLEFT, LRIGHT, LROWS
- INTEGER LDA, NL
- REAL C, S, XLEFT, XRIGHT
-* ..
-* .. Array Arguments ..
- REAL A( * )
-* ..
-*
+*> \brief \b SLAROT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+* XRIGHT )
+*
+* .. Scalar Arguments ..
+* LOGICAL LLEFT, LRIGHT, LROWS
+* INTEGER LDA, NL
+* REAL C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+* REAL A( * )
+* ..
+*
* Purpose
* =======
*
-* SLAROT applies a (Givens) rotation to two adjacent rows or
-* columns, where one element of the first and/or last column/row
-* for use on matrices stored in some format other than GE, so
-* that elements of the matrix may be used or modified for which
-* no array element is provided.
-*
-* One example is a symmetric matrix in SB format (bandwidth=4), for
-* which UPLO='L': Two adjacent rows will have the format:
-*
-* row j: * * * * * . . . .
-* row j+1: * * * * * . . . .
-*
-* '*' indicates elements for which storage is provided,
-* '.' indicates elements for which no storage is provided, but
-* are not necessarily zero; their values are determined by
-* symmetry. ' ' indicates elements which are necessarily zero,
-* and have no storage provided.
-*
-* Those columns which have two '*'s can be handled by SROT.
-* Those columns which have no '*'s can be ignored, since as long
-* as the Givens rotations are carefully applied to preserve
-* symmetry, their values are determined.
-* Those columns which have one '*' have to be handled separately,
-* by using separate variables "p" and "q":
-*
-* row j: * * * * * p . . .
-* row j+1: q * * * * * . . . .
-*
-* The element p would have to be set correctly, then that column
-* is rotated, setting p to its new value. The next call to
-* SLAROT would rotate columns j and j+1, using p, and restore
-* symmetry. The element q would start out being zero, and be
-* made non-zero by the rotation. Later, rotations would presumably
-* be chosen to zero q out.
-*
-* Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
-* ------- ------- ---------
-*
-* General dense matrix:
-*
-* CALL SLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
-* A(i,1),LDA, DUMMY, DUMMY)
-*
-* General banded matrix in GB format:
-*
-* j = MAX(1, i-KL )
-* NL = MIN( N, i+KU+1 ) + 1-j
-* CALL SLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
-* A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,KL+1) ]
-*
-* Symmetric banded matrix in SY format, bandwidth K,
-* lower triangle only:
-*
-* j = MAX(1, i-K )
-* NL = MIN( K+1, i ) + 1
-* CALL SLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
-* A(i,j), LDA, XLEFT, XRIGHT )
-*
-* Same, but upper triangle only:
-*
-* NL = MIN( K+1, N-i ) + 1
-* CALL SLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
-* A(i,i), LDA, XLEFT, XRIGHT )
-*
-* Symmetric banded matrix in SB format, bandwidth K,
-* lower triangle only:
-*
-* [ same as for SY, except:]
-* . . . .
-* A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,K+1) ]
-*
-* Same, but upper triangle only:
-* . . .
-* A(K+1,i), LDA-1, XLEFT, XRIGHT )
-*
-* Rotating columns is just the transpose of rotating rows, except
-* for GB and SB: (rotating columns i and i+1)
-*
-* GB:
-* j = MAX(1, i-KU )
-* NL = MIN( N, i+KL+1 ) + 1-j
-* CALL SLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
-* A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* [note that KU+j+1-i is just MAX(1,KU+2-i)]
-*
-* SB: (upper triangle)
-*
-* . . . . . .
-* A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* SB: (lower triangle)
-*
-* . . . . . .
-* A(1,i),LDA-1, XTOP, XBOTTM )
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLAROT applies a (Givens) rotation to two adjacent rows or
+*> columns, where one element of the first and/or last column/row
+*> for use on matrices stored in some format other than GE, so
+*> that elements of the matrix may be used or modified for which
+*> no array element is provided.
+*>
+*> One example is a symmetric matrix in SB format (bandwidth=4), for
+*> which UPLO='L': Two adjacent rows will have the format:
+*>
+*> row j: C> C> C> C> C> . . . .
+*> row j+1: C> C> C> C> C> . . . .
+*>
+*> '*' indicates elements for which storage is provided,
+*> '.' indicates elements for which no storage is provided, but
+*> are not necessarily zero; their values are determined by
+*> symmetry. ' ' indicates elements which are necessarily zero,
+*> and have no storage provided.
+*>
+*> Those columns which have two '*'s can be handled by SROT.
+*> Those columns which have no '*'s can be ignored, since as long
+*> as the Givens rotations are carefully applied to preserve
+*> symmetry, their values are determined.
+*> Those columns which have one '*' have to be handled separately,
+*> by using separate variables "p" and "q":
+*>
+*> row j: C> C> C> C> C> p . . .
+*> row j+1: q C> C> C> C> C> . . . .
+*>
+*> The element p would have to be set correctly, then that column
+*> is rotated, setting p to its new value. The next call to
+*> SLAROT would rotate columns j and j+1, using p, and restore
+*> symmetry. The element q would start out being zero, and be
+*> made non-zero by the rotation. Later, rotations would presumably
+*> be chosen to zero q out.
+*>
+*> Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
+*> ------- ------- ---------
+*>
+*> General dense matrix:
+*>
+*> CALL SLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
+*> A(i,1),LDA, DUMMY, DUMMY)
+*>
+*> General banded matrix in GB format:
+*>
+*> j = MAX(1, i-KL )
+*> NL = MIN( N, i+KU+1 ) + 1-j
+*> CALL SLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
+*> A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,KL+1) ]
+*>
+*> Symmetric banded matrix in SY format, bandwidth K,
+*> lower triangle only:
+*>
+*> j = MAX(1, i-K )
+*> NL = MIN( K+1, i ) + 1
+*> CALL SLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
+*> A(i,j), LDA, XLEFT, XRIGHT )
+*>
+*> Same, but upper triangle only:
+*>
+*> NL = MIN( K+1, N-i ) + 1
+*> CALL SLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
+*> A(i,i), LDA, XLEFT, XRIGHT )
+*>
+*> Symmetric banded matrix in SB format, bandwidth K,
+*> lower triangle only:
+*>
+*> [ same as for SY, except:]
+*> . . . .
+*> A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,K+1) ]
+*>
+*> Same, but upper triangle only:
+*> . . .
+*> A(K+1,i), LDA-1, XLEFT, XRIGHT )
+*>
+*> Rotating columns is just the transpose of rotating rows, except
+*> for GB and SB: (rotating columns i and i+1)
+*>
+*> GB:
+*> j = MAX(1, i-KU )
+*> NL = MIN( N, i+KL+1 ) + 1-j
+*> CALL SLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
+*> A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> [note that KU+j+1-i is just MAX(1,KU+2-i)]
+*>
+*> SB: (upper triangle)
+*>
+*> . . . . . .
+*> A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> SB: (lower triangle)
+*>
+*> . . . . . .
+*> A(1,i),LDA-1, XTOP, XBOTTM )
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* LROWS - LOGICAL
-* If .TRUE., then SLAROT will rotate two rows. If .FALSE.,
-* then it will rotate two columns.
-* Not modified.
-*
-* LLEFT - LOGICAL
-* If .TRUE., then XLEFT will be used instead of the
-* corresponding element of A for the first element in the
-* second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
-* If .FALSE., then the corresponding element of A will be
-* used.
-* Not modified.
-*
-* LRIGHT - LOGICAL
-* If .TRUE., then XRIGHT will be used instead of the
-* corresponding element of A for the last element in the
-* first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
-* .FALSE., then the corresponding element of A will be used.
-* Not modified.
+*> \verbatim
+*> LROWS - LOGICAL
+*> If .TRUE., then SLAROT will rotate two rows. If .FALSE.,
+*> then it will rotate two columns.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LLEFT - LOGICAL
+*> If .TRUE., then XLEFT will be used instead of the
+*> corresponding element of A for the first element in the
+*> second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
+*> If .FALSE., then the corresponding element of A will be
+*> used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LRIGHT - LOGICAL
+*> If .TRUE., then XRIGHT will be used instead of the
+*> corresponding element of A for the last element in the
+*> first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
+*> .FALSE., then the corresponding element of A will be used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> NL - INTEGER
+*> The length of the rows (if LROWS=.TRUE.) or columns (if
+*> LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
+*> used, the columns/rows they are in should be included in
+*> NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
+*> least 2. The number of rows/columns to be rotated
+*> exclusive of those involving XLEFT and/or XRIGHT may
+*> not be negative, i.e., NL minus how many of LLEFT and
+*> LRIGHT are .TRUE. must be at least zero; if not, XERBLA
+*> will be called.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> C, S - REAL
+*> Specify the Givens rotation to be applied. If LROWS is
+*> true, then the matrix ( c s )
+*> (-s c ) is applied from the left;
+*> if false, then the transpose thereof is applied from the
+*> right. For a Givens rotation, C**2 + S**2 should be 1,
+*> but this is not checked.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> A - REAL array.
+*> The array containing the rows/columns to be rotated. The
+*> first element of A should be the upper left element to
+*> be rotated.
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> LDA - INTEGER
+*> The "effective" leading dimension of A. If A contains
+*> a matrix stored in GE or SY format, then this is just
+*> the leading dimension of A as dimensioned in the calling
+*> routine. If A contains a matrix stored in band (GB or SB)
+*> format, then this should be *one less* than the leading
+*> dimension used in the calling routine. Thus, if
+*> A were dimensioned A(LDA,*) in SLAROT, then A(1,j) would
+*> be the j-th element in the first of the two rows
+*> to be rotated, and A(2,j) would be the j-th in the second,
+*> regardless of how the array may be stored in the calling
+*> routine. [A cannot, however, actually be dimensioned thus,
+*> since for band format, the row number may exceed LDA, which
+*> is not legal FORTRAN.]
+*> If LROWS=.TRUE., then LDA must be at least 1, otherwise
+*> it must be at least NL minus the number of .TRUE. values
+*> in XLEFT and XRIGHT.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> XLEFT - REAL
+*> If LLEFT is .TRUE., then XLEFT will be used and modified
+*> instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> XRIGHT - REAL
+*> If LRIGHT is .TRUE., then XRIGHT will be used and modified
+*> instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* NL - INTEGER
-* The length of the rows (if LROWS=.TRUE.) or columns (if
-* LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
-* used, the columns/rows they are in should be included in
-* NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
-* least 2. The number of rows/columns to be rotated
-* exclusive of those involving XLEFT and/or XRIGHT may
-* not be negative, i.e., NL minus how many of LLEFT and
-* LRIGHT are .TRUE. must be at least zero; if not, XERBLA
-* will be called.
-* Not modified.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* C, S - REAL
-* Specify the Givens rotation to be applied. If LROWS is
-* true, then the matrix ( c s )
-* (-s c ) is applied from the left;
-* if false, then the transpose thereof is applied from the
-* right. For a Givens rotation, C**2 + S**2 should be 1,
-* but this is not checked.
-* Not modified.
+*> \date November 2011
*
-* A - REAL array.
-* The array containing the rows/columns to be rotated. The
-* first element of A should be the upper left element to
-* be rotated.
-* Read and modified.
+*> \ingroup real_matgen
*
-* LDA - INTEGER
-* The "effective" leading dimension of A. If A contains
-* a matrix stored in GE or SY format, then this is just
-* the leading dimension of A as dimensioned in the calling
-* routine. If A contains a matrix stored in band (GB or SB)
-* format, then this should be *one less* than the leading
-* dimension used in the calling routine. Thus, if
-* A were dimensioned A(LDA,*) in SLAROT, then A(1,j) would
-* be the j-th element in the first of the two rows
-* to be rotated, and A(2,j) would be the j-th in the second,
-* regardless of how the array may be stored in the calling
-* routine. [A cannot, however, actually be dimensioned thus,
-* since for band format, the row number may exceed LDA, which
-* is not legal FORTRAN.]
-* If LROWS=.TRUE., then LDA must be at least 1, otherwise
-* it must be at least NL minus the number of .TRUE. values
-* in XLEFT and XRIGHT.
-* Not modified.
+* =====================================================================
+ SUBROUTINE SLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+ $ XRIGHT )
*
-* XLEFT - REAL
-* If LLEFT is .TRUE., then XLEFT will be used and modified
-* instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
-* (if LROWS=.FALSE.).
-* Read and modified.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* XRIGHT - REAL
-* If LRIGHT is .TRUE., then XRIGHT will be used and modified
-* instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
-* (if LROWS=.FALSE.).
-* Read and modified.
+* .. Scalar Arguments ..
+ LOGICAL LLEFT, LRIGHT, LROWS
+ INTEGER LDA, NL
+ REAL C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+ REAL A( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slatm1.f b/TESTING/MATGEN/slatm1.f
index 507b9df0..55415420 100644
--- a/TESTING/MATGEN/slatm1.f
+++ b/TESTING/MATGEN/slatm1.f
@@ -1,8 +1,146 @@
+*> \brief \b SLATM1
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST, INFO, IRSIGN, MODE, N
+* REAL COND
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL D( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM1 computes the entries of D(1..N) as specified by
+*> MODE, COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. SLATM1 is called by SLATMR to generate
+*> random test matrices for LAPACK programs.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IRSIGN
+*> \verbatim
+*> IRSIGN is INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by 1 or -1 with probability .5
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATM1
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
INTEGER IDIST, INFO, IRSIGN, MODE, N
@@ -13,79 +151,6 @@
REAL D( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATM1 computes the entries of D(1..N) as specified by
-* MODE, COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. SLATM1 is called by SLATMR to generate
-* random test matrices for LAPACK programs.
-*
-* Arguments
-* =========
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN (input) INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by 1 or -1 with probability .5
-*
-* IDIST (input) CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATM1
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) REAL array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N (input) INTEGER
-* Number of entries of D. Not modified.
-*
-* INFO (output) INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatm2.f b/TESTING/MATGEN/slatm2.f
index 3320e249..81fa969b 100644
--- a/TESTING/MATGEN/slatm2.f
+++ b/TESTING/MATGEN/slatm2.f
@@ -1,9 +1,219 @@
+*> \brief \b SLATM2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* REAL FUNCTION SLATM2( M, N, I, J, KL, KU, IDIST,
+* ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, J, KL, KU, M, N
+* REAL SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* REAL D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM2 returns the (I,J) entry of a random matrix of dimension
+*> (M, N) described by the other paramters. It is called by the
+*> SLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by SLATMR which has already checked the parameters.
+*>
+*> Use of SLATM2 differs from SLATM3 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With SLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With SLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, SLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. SLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*>
+*> The matrix whose (I,J) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If I is outside (1..M) or J is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is REAL array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is REAL array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) in position K was originally in
+*> position IWORK( K ).
+*> This differs from IWORK for SLATM3. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
REAL FUNCTION SLATM2( M, N, I, J, KL, KU, IDIST,
$ ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -17,126 +227,6 @@
REAL D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATM2 returns the (I,J) entry of a random matrix of dimension
-* (M, N) described by the other paramters. It is called by the
-* SLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by SLATMR which has already checked the parameters.
-*
-* Use of SLATM2 differs from SLATM3 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With SLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With SLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, SLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. SLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-*
-* The matrix whose (I,J) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If I is outside (1..M) or J is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of entry to be returned. Not modified.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) REAL array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) REAL array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) REAL array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (workspace) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) in position K was originally in
-* position IWORK( K ).
-* This differs from IWORK for SLATM3. Not modified.
-*
-* SPARSE (input) REAL between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatm3.f b/TESTING/MATGEN/slatm3.f
index 5dc4e29b..3c639920 100644
--- a/TESTING/MATGEN/slatm3.f
+++ b/TESTING/MATGEN/slatm3.f
@@ -1,10 +1,237 @@
+*> \brief \b SLATM3
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* REAL FUNCTION SLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
+* IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
+* SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, ISUB, J, JSUB, KL,
+* $ KU, M, N
+* REAL SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* REAL D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM3 returns the (ISUB,JSUB) entry of a random matrix of
+*> dimension (M, N) described by the other paramters. (ISUB,JSUB)
+*> is the final position of the (I,J) entry after pivoting
+*> according to IPVTNG and IWORK. SLATM3 is called by the
+*> SLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by SLATMR which has already checked the parameters.
+*>
+*> Use of SLATM3 differs from SLATM2 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With SLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With SLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, SLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. SLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*> in different orders for different pivot orders).
+*>
+*> The matrix whose (ISUB,JSUB) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISUB
+*> \verbatim
+*> ISUB is INTEGER
+*> Row of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] JSUB
+*> \verbatim
+*> JSUB is INTEGER
+*> Column of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is REAL array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is REAL array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) originally in position K is in
+*> position IWORK( K ) after pivoting.
+*> This differs from IWORK for SLATM2. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
REAL FUNCTION SLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
$ IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
$ SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -19,135 +246,6 @@
REAL D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATM3 returns the (ISUB,JSUB) entry of a random matrix of
-* dimension (M, N) described by the other paramters. (ISUB,JSUB)
-* is the final position of the (I,J) entry after pivoting
-* according to IPVTNG and IWORK. SLATM3 is called by the
-* SLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by SLATMR which has already checked the parameters.
-*
-* Use of SLATM3 differs from SLATM2 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With SLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With SLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, SLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. SLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-* in different orders for different pivot orders).
-*
-* The matrix whose (ISUB,JSUB) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of unpivoted entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of unpivoted entry to be returned. Not modified.
-*
-* ISUB (input/output) INTEGER
-* Row of pivoted entry to be returned. Changed on exit.
-*
-* JSUB (input/output) INTEGER
-* Column of pivoted entry to be returned. Changed on exit.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) REAL array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) REAL array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) REAL array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (input) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) originally in position K is in
-* position IWORK( K ) after pivoting.
-* This differs from IWORK for SLATM2. Not modified.
-*
-* SPARSE (input) REAL between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatm5.f b/TESTING/MATGEN/slatm5.f
index 1239ec64..ef49ad8e 100644
--- a/TESTING/MATGEN/slatm5.f
+++ b/TESTING/MATGEN/slatm5.f
@@ -1,177 +1,292 @@
- SUBROUTINE SLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
- $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
- $ QBLCKB )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
- $ PRTYPE, QBLCKA, QBLCKB
- REAL ALPHA
-* ..
-* .. Array Arguments ..
- REAL A( LDA, * ), B( LDB, * ), C( LDC, * ),
- $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
- $ L( LDL, * ), R( LDR, * )
-* ..
-*
+*> \brief \b SLATM5
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+* E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+* QBLCKB )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+* $ PRTYPE, QBLCKA, QBLCKB
+* REAL ALPHA
+* ..
+* .. Array Arguments ..
+* REAL A( LDA, * ), B( LDB, * ), C( LDC, * ),
+* $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+* $ L( LDL, * ), R( LDR, * )
+* ..
+*
* Purpose
* =======
*
-* SLATM5 generates matrices involved in the Generalized Sylvester
-* equation:
-*
-* A * R - L * B = C
-* D * R - L * E = F
-*
-* They also satisfy (the diagonalization condition)
-*
-* [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
-* [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
-*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM5 generates matrices involved in the Generalized Sylvester
+*> equation:
+*>
+*> A * R - L * B = C
+*> D * R - L * E = F
+*>
+*> They also satisfy (the diagonalization condition)
+*>
+*> [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
+*> [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
+*>
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* PRTYPE (input) INTEGER
-* "Points" to a certian type of the matrices to generate
-* (see futher details).
-*
-* M (input) INTEGER
-* Specifies the order of A and D and the number of rows in
-* C, F, R and L.
-*
-* N (input) INTEGER
-* Specifies the order of B and E and the number of columns in
-* C, F, R and L.
-*
-* A (output) REAL array, dimension (LDA, M).
-* On exit A M-by-M is initialized according to PRTYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A.
-*
-* B (output) REAL array, dimension (LDB, N).
-* On exit B N-by-N is initialized according to PRTYPE.
-*
-* LDB (input) INTEGER
-* The leading dimension of B.
-*
-* C (output) REAL array, dimension (LDC, N).
-* On exit C M-by-N is initialized according to PRTYPE.
-*
-* LDC (input) INTEGER
-* The leading dimension of C.
-*
-* D (output) REAL array, dimension (LDD, M).
-* On exit D M-by-M is initialized according to PRTYPE.
-*
-* LDD (input) INTEGER
-* The leading dimension of D.
-*
-* E (output) REAL array, dimension (LDE, N).
-* On exit E N-by-N is initialized according to PRTYPE.
-*
-* LDE (input) INTEGER
-* The leading dimension of E.
-*
-* F (output) REAL array, dimension (LDF, N).
-* On exit F M-by-N is initialized according to PRTYPE.
-*
-* LDF (input) INTEGER
-* The leading dimension of F.
-*
-* R (output) REAL array, dimension (LDR, N).
-* On exit R M-by-N is initialized according to PRTYPE.
-*
-* LDR (input) INTEGER
-* The leading dimension of R.
-*
-* L (output) REAL array, dimension (LDL, N).
-* On exit L M-by-N is initialized according to PRTYPE.
-*
-* LDL (input) INTEGER
-* The leading dimension of L.
+*> \param[in] PRTYPE
+*> \verbatim
+*> PRTYPE is INTEGER
+*> "Points" to a certian type of the matrices to generate
+*> (see futher details).
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Specifies the order of A and D and the number of rows in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Specifies the order of B and E and the number of columns in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA, M).
+*> On exit A M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is REAL array, dimension (LDB, N).
+*> On exit B N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of B.
+*> \endverbatim
+*>
+*> \param[out] C
+*> \verbatim
+*> C is REAL array, dimension (LDC, N).
+*> On exit C M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDC
+*> \verbatim
+*> LDC is INTEGER
+*> The leading dimension of C.
+*> \endverbatim
+*>
+*> \param[out] D
+*> \verbatim
+*> D is REAL array, dimension (LDD, M).
+*> On exit D M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDD
+*> \verbatim
+*> LDD is INTEGER
+*> The leading dimension of D.
+*> \endverbatim
+*>
+*> \param[out] E
+*> \verbatim
+*> E is REAL array, dimension (LDE, N).
+*> On exit E N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDE
+*> \verbatim
+*> LDE is INTEGER
+*> The leading dimension of E.
+*> \endverbatim
+*>
+*> \param[out] F
+*> \verbatim
+*> F is REAL array, dimension (LDF, N).
+*> On exit F M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDF
+*> \verbatim
+*> LDF is INTEGER
+*> The leading dimension of F.
+*> \endverbatim
+*>
+*> \param[out] R
+*> \verbatim
+*> R is REAL array, dimension (LDR, N).
+*> On exit R M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDR
+*> \verbatim
+*> LDR is INTEGER
+*> The leading dimension of R.
+*> \endverbatim
+*>
+*> \param[out] L
+*> \verbatim
+*> L is REAL array, dimension (LDL, N).
+*> On exit L M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDL
+*> \verbatim
+*> LDL is INTEGER
+*> The leading dimension of L.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is REAL
+*> Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \endverbatim
+*>
+*> \param[in] QBLCKA
+*> \verbatim
+*> QBLCKA is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in A. Otherwise, QBLCKA is not
+*> referenced. QBLCKA > 1.
+*> \endverbatim
+*>
+*> \param[in] QBLCKB
+*> \verbatim
+*> QBLCKB is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in B. Otherwise, QBLCKB is not
+*> referenced. QBLCKB > 1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* ALPHA (input) REAL
-* Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* QBLCKA (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in A. Otherwise, QBLCKA is not
-* referenced. QBLCKA > 1.
+*> \date November 2011
*
-* QBLCKB (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in B. Otherwise, QBLCKB is not
-* referenced. QBLCKB > 1.
+*> \ingroup real_matgen
*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
+*>
+*> A : if (i == j) then A(i, j) = 1.0
+*> if (j == i + 1) then A(i, j) = -1.0
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> B : if (i == j) then B(i, j) = 1.0 - ALPHA
+*> if (j == i + 1) then B(i, j) = 1.0
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> D : if (i == j) then D(i, j) = 1.0
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*> E : if (i == j) then E(i, j) = 1.0
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L = R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
+*>
+*> A : if (i <= j) then A(i, j) = [-1...1]
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> if (PRTYPE = 3) then
+*> A(k + 1, k + 1) = A(k, k)
+*> A(k + 1, k) = [-1...1]
+*> sign(A(k, k + 1) = -(sin(A(k + 1, k))
+*> k = 1, M - 1, QBLCKA
+*>
+*> B : if (i <= j) then B(i, j) = [-1...1]
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> if (PRTYPE = 3) then
+*> B(k + 1, k + 1) = B(k, k)
+*> B(k + 1, k) = [-1...1]
+*> sign(B(k, k + 1) = -(sign(B(k + 1, k))
+*> k = 1, N - 1, QBLCKB
+*>
+*> D : if (i <= j) then D(i, j) = [-1...1].
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*>
+*> E : if (i <= j) then D(i, j) = [-1...1]
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L, R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 4 Full
+*> A(i, j) = [-10...10]
+*> D(i, j) = [-1...1] i,j = 1...M
+*> B(i, j) = [-10...10]
+*> E(i, j) = [-1...1] i,j = 1...N
+*> R(i, j) = [-10...10]
+*> L(i, j) = [-1...1] i = 1..M ,j = 1...N
+*>
+*> L, R specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 5 special case common and/or close eigs.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ SUBROUTINE SLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+ $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+ $ QBLCKB )
*
-* PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
-*
-* A : if (i == j) then A(i, j) = 1.0
-* if (j == i + 1) then A(i, j) = -1.0
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* B : if (i == j) then B(i, j) = 1.0 - ALPHA
-* if (j == i + 1) then B(i, j) = 1.0
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* D : if (i == j) then D(i, j) = 1.0
-* else D(i, j) = 0.0, i, j = 1...M
-*
-* E : if (i == j) then E(i, j) = 1.0
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L = R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
-*
-* A : if (i <= j) then A(i, j) = [-1...1]
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* if (PRTYPE = 3) then
-* A(k + 1, k + 1) = A(k, k)
-* A(k + 1, k) = [-1...1]
-* sign(A(k, k + 1) = -(sin(A(k + 1, k))
-* k = 1, M - 1, QBLCKA
-*
-* B : if (i <= j) then B(i, j) = [-1...1]
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* if (PRTYPE = 3) then
-* B(k + 1, k + 1) = B(k, k)
-* B(k + 1, k) = [-1...1]
-* sign(B(k, k + 1) = -(sign(B(k + 1, k))
-* k = 1, N - 1, QBLCKB
-*
-* D : if (i <= j) then D(i, j) = [-1...1].
-* else D(i, j) = 0.0, i, j = 1...M
-*
-*
-* E : if (i <= j) then D(i, j) = [-1...1]
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L, R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 4 Full
-* A(i, j) = [-10...10]
-* D(i, j) = [-1...1] i,j = 1...M
-* B(i, j) = [-10...10]
-* E(i, j) = [-1...1] i,j = 1...N
-* R(i, j) = [-10...10]
-* L(i, j) = [-1...1] i = 1..M ,j = 1...N
-*
-* L, R specifies the right hand sides (C, F).
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* PRTYPE = 5 special case common and/or close eigs.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+ $ PRTYPE, QBLCKA, QBLCKB
+ REAL ALPHA
+* ..
+* .. Array Arguments ..
+ REAL A( LDA, * ), B( LDB, * ), C( LDC, * ),
+ $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+ $ L( LDL, * ), R( LDR, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slatm6.f b/TESTING/MATGEN/slatm6.f
index 093c955b..f209b335 100644
--- a/TESTING/MATGEN/slatm6.f
+++ b/TESTING/MATGEN/slatm6.f
@@ -1,107 +1,197 @@
- SUBROUTINE SLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
- $ BETA, WX, WY, S, DIF )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDX, LDY, N, TYPE
- REAL ALPHA, BETA, WX, WY
-* ..
-* .. Array Arguments ..
- REAL A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
- $ X( LDX, * ), Y( LDY, * )
-* ..
-*
+*> \brief \b SLATM6
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+* BETA, WX, WY, S, DIF )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDX, LDY, N, TYPE
+* REAL ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+* REAL A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
+* $ X( LDX, * ), Y( LDY, * )
+* ..
+*
* Purpose
* =======
*
-* SLATM6 generates test matrices for the generalized eigenvalue
-* problem, their corresponding right and left eigenvector matrices,
-* and also reciprocal condition numbers for all eigenvalues and
-* the reciprocal condition numbers of eigenvectors corresponding to
-* the 1th and 5th eigenvalues.
-*
-* Test Matrices
-* =============
-*
-* Two kinds of test matrix pairs
-*
-* (A, B) = inverse(YH) * (Da, Db) * inverse(X)
-*
-* are used in the tests:
-*
-* Type 1:
-* Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
-* 0 2+a 0 0 0 0 1 0 0 0
-* 0 0 3+a 0 0 0 0 1 0 0
-* 0 0 0 4+a 0 0 0 0 1 0
-* 0 0 0 0 5+a , 0 0 0 0 1 , and
-*
-* Type 2:
-* Da = 1 -1 0 0 0 Db = 1 0 0 0 0
-* 1 1 0 0 0 0 1 0 0 0
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1+a 1+b 0 0 0 1 0
-* 0 0 0 -1-b 1+a , 0 0 0 0 1 .
-*
-* In both cases the same inverse(YH) and inverse(X) are used to compute
-* (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
-*
-* YH: = 1 0 -y y -y X = 1 0 -x -x x
-* 0 1 -y y -y 0 1 x -x -x
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1 0 0 0 0 1 0
-* 0 0 0 0 1, 0 0 0 0 1 ,
-*
-* where a, b, x and y will have all values independently of each other.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM6 generates test matrices for the generalized eigenvalue
+*> problem, their corresponding right and left eigenvector matrices,
+*> and also reciprocal condition numbers for all eigenvalues and
+*> the reciprocal condition numbers of eigenvectors corresponding to
+*> the 1th and 5th eigenvalues.
+*>
+*> Test Matrices
+*> =============
+*>
+*> Two kinds of test matrix pairs
+*>
+*> (A, B) = inverse(YH) * (Da, Db) * inverse(X)
+*>
+*> are used in the tests:
+*>
+*> Type 1:
+*> Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
+*> 0 2+a 0 0 0 0 1 0 0 0
+*> 0 0 3+a 0 0 0 0 1 0 0
+*> 0 0 0 4+a 0 0 0 0 1 0
+*> 0 0 0 0 5+a , 0 0 0 0 1 , and
+*>
+*> Type 2:
+*> Da = 1 -1 0 0 0 Db = 1 0 0 0 0
+*> 1 1 0 0 0 0 1 0 0 0
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1+a 1+b 0 0 0 1 0
+*> 0 0 0 -1-b 1+a , 0 0 0 0 1 .
+*>
+*> In both cases the same inverse(YH) and inverse(X) are used to compute
+*> (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
+*>
+*> YH: = 1 0 -y y -y X = 1 0 -x -x x
+*> 0 1 -y y -y 0 1 x -x -x
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1 0 0 0 0 1 0
+*> 0 0 0 0 1, 0 0 0 0 1 ,
+*>
+*> where a, b, x and y will have all values independently of each other.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* TYPE (input) INTEGER
-* Specifies the problem type (see futher details).
-*
-* N (input) INTEGER
-* Size of the matrices A and B.
-*
-* A (output) REAL array, dimension (LDA, N).
-* On exit A N-by-N is initialized according to TYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A and of B.
-*
-* B (output) REAL array, dimension (LDA, N).
-* On exit B N-by-N is initialized according to TYPE.
-*
-* X (output) REAL array, dimension (LDX, N).
-* On exit X is the N-by-N matrix of right eigenvectors.
-*
-* LDX (input) INTEGER
-* The leading dimension of X.
-*
-* Y (output) REAL array, dimension (LDY, N).
-* On exit Y is the N-by-N matrix of left eigenvectors.
+*> \param[in] TYPE
+*> \verbatim
+*> TYPE is INTEGER
+*> Specifies the problem type (see futher details).
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of the matrices A and B.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA, N).
+*> On exit A N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A and of B.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is REAL array, dimension (LDA, N).
+*> On exit B N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is REAL array, dimension (LDX, N).
+*> On exit X is the N-by-N matrix of right eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of X.
+*> \endverbatim
+*>
+*> \param[out] Y
+*> \verbatim
+*> Y is REAL array, dimension (LDY, N).
+*> On exit Y is the N-by-N matrix of left eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDY
+*> \verbatim
+*> LDY is INTEGER
+*> The leading dimension of Y.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is REAL
+*> \endverbatim
+*>
+*> \param[in] BETA
+*> \verbatim
+*> BETA is REAL
+*> \endverbatim
+*> \verbatim
+*> Weighting constants for matrix A.
+*> \endverbatim
+*>
+*> \param[in] WX
+*> \verbatim
+*> WX is REAL
+*> Constant for right eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[in] WY
+*> \verbatim
+*> WY is REAL
+*> Constant for left eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[out] S
+*> \verbatim
+*> S is REAL array, dimension (N)
+*> S(i) is the reciprocal condition number for eigenvalue i.
+*> \endverbatim
+*>
+*> \param[out] DIF
+*> \verbatim
+*> DIF is REAL array, dimension (N)
+*> DIF(i) is the reciprocal condition number for eigenvector i.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* LDY (input) INTEGER
-* The leading dimension of Y.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* ALPHA (input) REAL
-* BETA (input) REAL
-* Weighting constants for matrix A.
+*> \date November 2011
*
-* WX (input) REAL
-* Constant for right eigenvector matrix.
+*> \ingroup real_matgen
*
-* WY (input) REAL
-* Constant for left eigenvector matrix.
+* =====================================================================
+ SUBROUTINE SLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+ $ BETA, WX, WY, S, DIF )
*
-* S (output) REAL array, dimension (N)
-* S(i) is the reciprocal condition number for eigenvalue i.
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* DIF (output) REAL array, dimension (N)
-* DIF(i) is the reciprocal condition number for eigenvector i.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDX, LDY, N, TYPE
+ REAL ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+ REAL A( LDA, * ), B( LDA, * ), DIF( * ), S( * ),
+ $ X( LDX, * ), Y( LDY, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/slatm7.f b/TESTING/MATGEN/slatm7.f
index 8fa977f6..a45d1611 100644
--- a/TESTING/MATGEN/slatm7.f
+++ b/TESTING/MATGEN/slatm7.f
@@ -1,9 +1,143 @@
+*> \brief \b SLATM7
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATM7( MODE, COND, IRSIGN, IDIST, ISEED, D, N,
+* RANK, INFO )
+*
+* .. Scalar Arguments ..
+* REAL COND
+* INTEGER IDIST, INFO, IRSIGN, MODE, N, RANK
+* ..
+* .. Array Arguments ..
+* REAL D( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATM7 computes the entries of D as specified by MODE
+*> COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. SLATM7 is called by SLATMT to generate
+*> random test matrices.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \verbatim
+*> MODE - INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> \endverbatim
+*> \verbatim
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1)) I=1:RANK
+*> \endverbatim
+*> \verbatim
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> COND - REAL
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*> \verbatim
+*> IRSIGN - INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by 1 or -1 with probability .5
+*> \endverbatim
+*> \verbatim
+*> IDIST - CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => UNIFORM( 0, 1 )
+*> 2 => UNIFORM( -1, 1 )
+*> 3 => NORMAL( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> ISEED - INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATM7
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*> \verbatim
+*> D - REAL array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*> \verbatim
+*> N - INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*> \verbatim
+*> RANK - INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> INFO - INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATM7( MODE, COND, IRSIGN, IDIST, ISEED, D, N,
$ RANK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
REAL COND
@@ -14,86 +148,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* SLATM7 computes the entries of D as specified by MODE
-* COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. SLATM7 is called by SLATMT to generate
-* random test matrices.
-*
-* Arguments
-* =========
-*
-* MODE - INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-*
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1)) I=1:RANK
-*
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND - REAL
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN - INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by 1 or -1 with probability .5
-*
-* IDIST - CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => UNIFORM( 0, 1 )
-* 2 => UNIFORM( -1, 1 )
-* 3 => NORMAL( 0, 1 )
-* Not modified.
-*
-* ISEED - INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATM7
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D - REAL array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N - INTEGER
-* Number of entries of D. Not modified.
-*
-* RANK - INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* INFO - INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatme.f b/TESTING/MATGEN/slatme.f
index 60a32068..3deff329 100644
--- a/TESTING/MATGEN/slatme.f
+++ b/TESTING/MATGEN/slatme.f
@@ -1,12 +1,343 @@
+*> \brief \b SLATME
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATME( N, DIST, ISEED, D, MODE, COND, DMAX, EI,
+* RSIGN,
+* UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
+* A,
+* LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, RSIGN, SIM, UPPER
+* INTEGER INFO, KL, KU, LDA, MODE, MODES, N
+* REAL ANORM, COND, CONDS, DMAX
+* ..
+* .. Array Arguments ..
+* CHARACTER EI( * )
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), D( * ), DS( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATME generates random non-symmetric square matrices with
+*> specified eigenvalues for testing LAPACK programs.
+*>
+*> SLATME operates by applying the following sequence of
+*> operations:
+*>
+*> 1. Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and RSIGN
+*> as described below.
+*>
+*> 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R',
+*> or MODE=5), certain pairs of adjacent elements of D are
+*> interpreted as the real and complex parts of a complex
+*> conjugate pair; A thus becomes block diagonal, with 1x1
+*> and 2x2 blocks.
+*>
+*> 3. If UPPER='T', the upper triangle of A is set to random values
+*> out of distribution DIST.
+*>
+*> 4. If SIM='T', A is multiplied on the left by a random matrix
+*> X, whose singular values are specified by DS, MODES, and
+*> CONDS, and on the right by X inverse.
+*>
+*> 5. If KL < N-1, the lower bandwidth is reduced to KL using
+*> Householder transformations. If KU < N-1, the upper
+*> bandwidth is reduced to KU.
+*>
+*> 6. If ANORM is not negative, the matrix is scaled to have
+*> maximum-element-norm ANORM.
+*>
+*> (Note: since the matrix cannot be reduced beyond Hessenberg form,
+*> no packing options are available.)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns (or rows) of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values, and for the
+*> upper triangle (see UPPER).
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATME
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( N )
+*> This array is used to specify the eigenvalues of A. If
+*> MODE=0, then D is assumed to contain the eigenvalues (but
+*> see the description of EI), otherwise they will be
+*> computed according to MODE, COND, DMAX, and RSIGN and
+*> placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D (with EI) as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed. Each odd-even pair
+*> of elements will be either used as two real
+*> eigenvalues or as the real and imaginary part
+*> of a complex conjugate pair of eigenvalues;
+*> the choice of which is done is random, with
+*> 50-50 probability, for each pair.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is between 1 and 4, D has entries ranging
+*> from 1 to 1/COND, if between -1 and -4, D has entries
+*> ranging from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))). Note that DMAX need not be
+*> positive: if DMAX is negative (or zero), D will be
+*> scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] EI
+*> \verbatim
+*> EI is CHARACTER*1 array, dimension ( N )
+*> If MODE is 0, and EI(1) is not ' ' (space character),
+*> this array specifies which elements of D (on input) are
+*> real eigenvalues and which are the real and imaginary parts
+*> of a complex conjugate pair of eigenvalues. The elements
+*> of EI may then only have the values 'R' and 'I'. If
+*> EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is
+*> CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex
+*> conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th
+*> eigenvalue is D(j) (i.e., real). EI(1) may not be 'I',
+*> nor may two adjacent elements of EI both have the value 'I'.
+*> If MODE is not 0, then EI is ignored. If MODE is 0 and
+*> EI(1)=' ', then the eigenvalues will all be real.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE is not 0, 6, or -6, and RSIGN='T', then the
+*> elements of D, as computed according to MODE and COND, will
+*> be multiplied by a random sign (+1 or -1). If RSIGN='F',
+*> they will not be. RSIGN may only have the values 'T' or
+*> 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] UPPER
+*> \verbatim
+*> UPPER is CHARACTER*1
+*> If UPPER='T', then the elements of A above the diagonal
+*> (and above the 2x2 diagonal blocks, if A has complex
+*> eigenvalues) will be set to random numbers out of DIST.
+*> If UPPER='F', they will not. UPPER may only have the
+*> values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] SIM
+*> \verbatim
+*> SIM is CHARACTER*1
+*> If SIM='T', then A will be operated on by a "similarity
+*> transform", i.e., multiplied on the left by a matrix X and
+*> on the right by X inverse. X = U S V, where U and V are
+*> random unitary matrices and S is a (diagonal) matrix of
+*> singular values specified by DS, MODES, and CONDS. If
+*> SIM='F', then A will not be transformed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DS
+*> \verbatim
+*> DS is REAL array, dimension ( N )
+*> This array is used to specify the singular values of X,
+*> in the same way that D specifies the eigenvalues of A.
+*> If MODE=0, the DS contains the singular values, which
+*> may not be zero.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODES
+*> \verbatim
+*> MODES is INTEGER
+*> \endverbatim
+*>
+*> \param[in] CONDS
+*> \verbatim
+*> CONDS is REAL
+*> Same as MODE and COND, but for specifying the diagonal
+*> of S. MODES=-6 and +6 are not allowed (since they would
+*> result in randomly ill-conditioned eigenvalues.)
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. KL=1
+*> specifies upper Hessenberg form. If KL is at least N-1,
+*> then A will have full lower bandwidth. KL must be at
+*> least 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. KU=1
+*> specifies lower Hessenberg form. If KU is at least N-1,
+*> then A will have full upper bandwidth; if KU and KL
+*> are both at least N-1, then A will be dense. Only one of
+*> KU and KL may be less than N-1. KU must be at least 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is REAL
+*> If ANORM is not negative, then A will be scaled by a non-
+*> negative real number to make the maximum-element-norm of A
+*> to be ANORM.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is REAL array, dimension ( LDA, N )
+*> On exit A is the desired test matrix.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. LDA must be at least N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension ( 3*N )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => N negative
+*> -2 => DIST illegal string
+*> -5 => MODE not in range -6 to 6
+*> -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or
+*> two adjacent elements of EI are 'I'.
+*> -9 => RSIGN is not 'T' or 'F'
+*> -10 => UPPER is not 'T' or 'F'
+*> -11 => SIM is not 'T' or 'F'
+*> -12 => MODES=0 and DS has a zero singular value.
+*> -13 => MODES is not in the range -5 to 5.
+*> -14 => MODES is nonzero and CONDS is less than 1.
+*> -15 => KL is less than 1.
+*> -16 => KU is less than 1, or KL and KU are both less than
+*> N-1.
+*> -19 => LDA is less than N.
+*> 1 => Error return from SLATM1 (computing D)
+*> 2 => Cannot scale to DMAX (max. eigenvalue is 0)
+*> 3 => Error return from SLATM1 (computing DS)
+*> 4 => Error return from SLARGE
+*> 5 => Zero singular value from SLATM1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATME( N, DIST, ISEED, D, MODE, COND, DMAX, EI,
$ RSIGN,
$ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
$ A,
$ LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, RSIGN, SIM, UPPER
@@ -19,227 +350,6 @@
REAL A( LDA, * ), D( * ), DS( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATME generates random non-symmetric square matrices with
-* specified eigenvalues for testing LAPACK programs.
-*
-* SLATME operates by applying the following sequence of
-* operations:
-*
-* 1. Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and RSIGN
-* as described below.
-*
-* 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R',
-* or MODE=5), certain pairs of adjacent elements of D are
-* interpreted as the real and complex parts of a complex
-* conjugate pair; A thus becomes block diagonal, with 1x1
-* and 2x2 blocks.
-*
-* 3. If UPPER='T', the upper triangle of A is set to random values
-* out of distribution DIST.
-*
-* 4. If SIM='T', A is multiplied on the left by a random matrix
-* X, whose singular values are specified by DS, MODES, and
-* CONDS, and on the right by X inverse.
-*
-* 5. If KL < N-1, the lower bandwidth is reduced to KL using
-* Householder transformations. If KU < N-1, the upper
-* bandwidth is reduced to KU.
-*
-* 6. If ANORM is not negative, the matrix is scaled to have
-* maximum-element-norm ANORM.
-*
-* (Note: since the matrix cannot be reduced beyond Hessenberg form,
-* no packing options are available.)
-*
-* Arguments
-* =========
-*
-* N (input) INTEGER
-* The number of columns (or rows) of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values, and for the
-* upper triangle (see UPPER).
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATME
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) REAL array, dimension ( N )
-* This array is used to specify the eigenvalues of A. If
-* MODE=0, then D is assumed to contain the eigenvalues (but
-* see the description of EI), otherwise they will be
-* computed according to MODE, COND, DMAX, and RSIGN and
-* placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the eigenvalues are to
-* be specified:
-* MODE = 0 means use D (with EI) as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed. Each odd-even pair
-* of elements will be either used as two real
-* eigenvalues or as the real and imaginary part
-* of a complex conjugate pair of eigenvalues;
-* the choice of which is done is random, with
-* 50-50 probability, for each pair.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is between 1 and 4, D has entries ranging
-* from 1 to 1/COND, if between -1 and -4, D has entries
-* ranging from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))). Note that DMAX need not be
-* positive: if DMAX is negative (or zero), D will be
-* scaled by a negative number (or zero).
-* Not modified.
-*
-* EI (input) CHARACTER*1 array, dimension ( N )
-* If MODE is 0, and EI(1) is not ' ' (space character),
-* this array specifies which elements of D (on input) are
-* real eigenvalues and which are the real and imaginary parts
-* of a complex conjugate pair of eigenvalues. The elements
-* of EI may then only have the values 'R' and 'I'. If
-* EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is
-* CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex
-* conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th
-* eigenvalue is D(j) (i.e., real). EI(1) may not be 'I',
-* nor may two adjacent elements of EI both have the value 'I'.
-* If MODE is not 0, then EI is ignored. If MODE is 0 and
-* EI(1)=' ', then the eigenvalues will all be real.
-* Not modified.
-*
-* RSIGN (input) CHARACTER*1
-* If MODE is not 0, 6, or -6, and RSIGN='T', then the
-* elements of D, as computed according to MODE and COND, will
-* be multiplied by a random sign (+1 or -1). If RSIGN='F',
-* they will not be. RSIGN may only have the values 'T' or
-* 'F'.
-* Not modified.
-*
-* UPPER (input) CHARACTER*1
-* If UPPER='T', then the elements of A above the diagonal
-* (and above the 2x2 diagonal blocks, if A has complex
-* eigenvalues) will be set to random numbers out of DIST.
-* If UPPER='F', they will not. UPPER may only have the
-* values 'T' or 'F'.
-* Not modified.
-*
-* SIM (input) CHARACTER*1
-* If SIM='T', then A will be operated on by a "similarity
-* transform", i.e., multiplied on the left by a matrix X and
-* on the right by X inverse. X = U S V, where U and V are
-* random unitary matrices and S is a (diagonal) matrix of
-* singular values specified by DS, MODES, and CONDS. If
-* SIM='F', then A will not be transformed.
-* Not modified.
-*
-* DS (input/output) REAL array, dimension ( N )
-* This array is used to specify the singular values of X,
-* in the same way that D specifies the eigenvalues of A.
-* If MODE=0, the DS contains the singular values, which
-* may not be zero.
-* Modified if MODE is nonzero.
-*
-* MODES (input) INTEGER
-*
-* CONDS (input) REAL
-* Same as MODE and COND, but for specifying the diagonal
-* of S. MODES=-6 and +6 are not allowed (since they would
-* result in randomly ill-conditioned eigenvalues.)
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. KL=1
-* specifies upper Hessenberg form. If KL is at least N-1,
-* then A will have full lower bandwidth. KL must be at
-* least 1.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. KU=1
-* specifies lower Hessenberg form. If KU is at least N-1,
-* then A will have full upper bandwidth; if KU and KL
-* are both at least N-1, then A will be dense. Only one of
-* KU and KL may be less than N-1. KU must be at least 1.
-* Not modified.
-*
-* ANORM (input) REAL
-* If ANORM is not negative, then A will be scaled by a non-
-* negative real number to make the maximum-element-norm of A
-* to be ANORM.
-* Not modified.
-*
-* A (output) REAL array, dimension ( LDA, N )
-* On exit A is the desired test matrix.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. LDA must be at least N.
-* Not modified.
-*
-* WORK (workspace) REAL array, dimension ( 3*N )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => N negative
-* -2 => DIST illegal string
-* -5 => MODE not in range -6 to 6
-* -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or
-* two adjacent elements of EI are 'I'.
-* -9 => RSIGN is not 'T' or 'F'
-* -10 => UPPER is not 'T' or 'F'
-* -11 => SIM is not 'T' or 'F'
-* -12 => MODES=0 and DS has a zero singular value.
-* -13 => MODES is not in the range -5 to 5.
-* -14 => MODES is nonzero and CONDS is less than 1.
-* -15 => KL is less than 1.
-* -16 => KU is less than 1, or KL and KU are both less than
-* N-1.
-* -19 => LDA is less than N.
-* 1 => Error return from SLATM1 (computing D)
-* 2 => Cannot scale to DMAX (max. eigenvalue is 0)
-* 3 => Error return from SLATM1 (computing DS)
-* 4 => Error return from SLARGE
-* 5 => Zero singular value from SLATM1.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatmr.f b/TESTING/MATGEN/slatmr.f
index 0506ca9f..bf9adcc5 100644
--- a/TESTING/MATGEN/slatmr.f
+++ b/TESTING/MATGEN/slatmr.f
@@ -1,11 +1,485 @@
+*> \brief \b SLATMR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
+* CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
+* PACK, A, LDA, IWORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, MODEL, MODER, N
+* REAL ANORM, COND, CONDL, CONDR, DMAX, SPARSE
+* ..
+* .. Array Arguments ..
+* INTEGER IPIVOT( * ), ISEED( 4 ), IWORK( * )
+* REAL A( LDA, * ), D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATMR generates random matrices of various types for testing
+*> LAPACK programs.
+*>
+*> SLATMR operates by applying the following sequence of
+*> operations:
+*>
+*> Generate a matrix A with random entries of distribution DIST
+*> which is symmetric if SYM='S', and nonsymmetric
+*> if SYM='N'.
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX and RSIGN
+*> as described below.
+*>
+*> Grade the matrix, if desired, from the left and/or right
+*> as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
+*> MODER and CONDR also determine the grading as described
+*> below.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> PIVTNG and IPIVOT.
+*>
+*> Set random entries to zero, if desired, to get a random sparse
+*> matrix as specified by SPARSE.
+*>
+*> Make A a band matrix, if desired, by zeroing out the matrix
+*> outside a band of lower bandwidth KL and upper bandwidth KU.
+*>
+*> Scale A, if desired, to have maximum entry ANORM.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or
+*> square upper triangular)
+*> store the lower half columnwise (if symmetric or
+*> square lower triangular)
+*> same as upper half rowwise if symmetric
+*> store the lower triangle in banded format (if symmetric)
+*> store the upper triangle in banded format (if symmetric)
+*> store the entire matrix in banded format
+*>
+*> Note: If two calls to SLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*>
+*> If two calls to SLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be and
+*> is not maintained with less than full bandwidth.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate a random matrix .
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATMR
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', generated matrix is symmetric.
+*> If SYM='N', generated matrix is nonsymmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is REAL array, dimension (min(M,N))
+*> On entry this array specifies the diagonal entries
+*> of the diagonal of A. D may either be specified
+*> on entry, or set according to MODE and COND as described
+*> below. May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be used:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE neither -6, 0 nor 6, the diagonal is scaled by
+*> DMAX / max(abs(D(i))), so that maximum absolute entry
+*> of diagonal is abs(DMAX). If DMAX is negative (or zero),
+*> diagonal will be scaled by a negative number (or zero).
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE neither -6, 0 nor 6, specifies sign of diagonal
+*> as follows:
+*> 'T' => diagonal entries are multiplied by 1 or -1
+*> with probability .5
+*> 'F' => diagonal unchanged
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] GRADE
+*> \verbatim
+*> GRADE is CHARACTER*1
+*> Specifies grading of matrix as follows:
+*> 'N' => no grading
+*> 'L' => matrix premultiplied by diag( DL )
+*> (only if matrix nonsymmetric)
+*> 'R' => matrix postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'B' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'S' or 'H' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> ('S' for symmetric, or 'H' for Hermitian)
+*> 'E' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> ( 'E' for eigenvalue invariance)
+*> (only if matrix nonsymmetric)
+*> Note: if GRADE='E', then M must equal N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DL
+*> \verbatim
+*> DL is REAL array, dimension (M)
+*> If MODEL=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODEL is not zero, then DL will be set according
+*> to MODEL and CONDL, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DL).
+*> If GRADE='E', then DL cannot have zero entries.
+*> Not referenced if GRADE = 'N' or 'R'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODEL
+*> \verbatim
+*> MODEL is INTEGER
+*> This specifies how the diagonal array DL is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDL
+*> \verbatim
+*> CONDL is REAL
+*> When MODEL is not zero, this specifies the condition number
+*> of the computed DL. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DR
+*> \verbatim
+*> DR is REAL array, dimension (N)
+*> If MODER=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODER is not zero, then DR will be set according
+*> to MODER and CONDR, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DR).
+*> Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODER
+*> \verbatim
+*> MODER is INTEGER
+*> This specifies how the diagonal array DR is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDR
+*> \verbatim
+*> CONDR is REAL
+*> When MODER is not zero, this specifies the condition number
+*> of the computed DR. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PIVTNG
+*> \verbatim
+*> PIVTNG is CHARACTER*1
+*> On entry specifies pivoting permutations as follows:
+*> 'N' or ' ' => none.
+*> 'L' => left or row pivoting (matrix must be nonsymmetric).
+*> 'R' => right or column pivoting (matrix must be
+*> nonsymmetric).
+*> 'B' or 'F' => both or full pivoting, i.e., on both sides.
+*> In this case, M must equal N
+*> \endverbatim
+*> \verbatim
+*> If two calls to SLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be
+*> maintained with less than full bandwidth.
+*> \endverbatim
+*>
+*> \param[in] IPIVOT
+*> \verbatim
+*> IPIVOT is INTEGER array, dimension (N or M)
+*> This array specifies the permutation used. After the
+*> basic matrix is generated, the rows, columns, or both
+*> are permuted. If, say, row pivoting is selected, SLATMR
+*> starts with the *last* row and interchanges the M-th and
+*> IPIVOT(M)-th rows, then moves to the next-to-last row,
+*> interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
+*> and so on. In terms of "2-cycles", the permutation is
+*> (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
+*> where the rightmost cycle is applied first. This is the
+*> *inverse* of the effect of pivoting in LINPACK. The idea
+*> is that factoring (with pivoting) an identity matrix
+*> which has been inverse-pivoted in this way should
+*> result in a pivot vector identical to IPIVOT.
+*> Not referenced if PIVTNG = 'N'. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is REAL
+*> On entry specifies the sparsity of the matrix if a sparse
+*> matrix is to be generated. SPARSE should lie between
+*> 0 and 1. To generate a sparse matrix, for each matrix entry
+*> a uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> On entry specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL at least M-1 implies the matrix is not
+*> banded. Must equal KU if matrix is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> On entry specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU at least N-1 implies the matrix is not
+*> banded. Must equal KL if matrix is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is REAL
+*> On entry specifies maximum entry of output matrix
+*> (output matrix will by multiplied by a constant so that
+*> its largest absolute entry equal ANORM)
+*> if ANORM is nonnegative. If ANORM is negative no scaling
+*> is done. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> On entry specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if matrix symmetric or square upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if matrix symmetric or square lower triangular)
+*> (same as upper half rowwise if symmetric)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to SLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is REAL array, dimension (LDA,N)
+*> On exit A is the desired test matrix. Only those
+*> entries of A which are significant on output
+*> will be referenced (even if A is in packed or band
+*> storage format). The 'unoccupied corners' of A in
+*> band format will be zeroed out.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> on entry LDA specifies the first dimension of A as
+*> declared in the calling program.
+*> If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
+*> If PACK='C' or 'R', LDA must be at least 1.
+*> If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
+*> If PACK='Z', LDA must be at least KUU+KLL+1, where
+*> KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array, dimension ( N or M)
+*> Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error parameter on exit:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S' or 'H'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
+*> -11 => GRADE illegal string, or GRADE='E' and
+*> M not equal to N, or GRADE='L', 'R', 'B' or 'E' and
+*> SYM = 'S' or 'H'
+*> -12 => GRADE = 'E' and DL contains zero
+*> -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
+*> 'S' or 'E'
+*> -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
+*> and MODEL neither -6, 0 nor 6
+*> -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
+*> -17 => CONDR less than 1.0, GRADE='R' or 'B', and
+*> MODER neither -6, 0 nor 6
+*> -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
+*> M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
+*> or 'H'
+*> -19 => IPIVOT contains out of range number and
+*> PIVTNG not equal to 'N'
+*> -20 => KL negative
+*> -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -22 => SPARSE not in range 0. to 1.
+*> -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
+*> and SYM='N', or PACK='C' and SYM='N' and either KL
+*> not equal to 0 or N not equal to M, or PACK='R' and
+*> SYM='N', and either KU not equal to 0 or N not equal
+*> to M
+*> -26 => LDA too small
+*> 1 => Error return from SLATM1 (computing D)
+*> 2 => Cannot scale diagonal to DMAX (max. entry is 0)
+*> 3 => Error return from SLATM1 (computing DL)
+*> 4 => Error return from SLATM1 (computing DR)
+*> 5 => ANORM is positive, but matrix constructed prior to
+*> attempting to scale it to have norm ANORM, is zero
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
$ CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
$ PACK, A, LDA, IWORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
@@ -17,348 +491,6 @@
REAL A( LDA, * ), D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATMR generates random matrices of various types for testing
-* LAPACK programs.
-*
-* SLATMR operates by applying the following sequence of
-* operations:
-*
-* Generate a matrix A with random entries of distribution DIST
-* which is symmetric if SYM='S', and nonsymmetric
-* if SYM='N'.
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX and RSIGN
-* as described below.
-*
-* Grade the matrix, if desired, from the left and/or right
-* as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
-* MODER and CONDR also determine the grading as described
-* below.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* PIVTNG and IPIVOT.
-*
-* Set random entries to zero, if desired, to get a random sparse
-* matrix as specified by SPARSE.
-*
-* Make A a band matrix, if desired, by zeroing out the matrix
-* outside a band of lower bandwidth KL and upper bandwidth KU.
-*
-* Scale A, if desired, to have maximum entry ANORM.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or
-* square upper triangular)
-* store the lower half columnwise (if symmetric or
-* square lower triangular)
-* same as upper half rowwise if symmetric
-* store the lower triangle in banded format (if symmetric)
-* store the upper triangle in banded format (if symmetric)
-* store the entire matrix in banded format
-*
-* Note: If two calls to SLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-*
-* If two calls to SLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be and
-* is not maintained with less than full bandwidth.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate a random matrix .
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATMR
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', generated matrix is symmetric.
-* If SYM='N', generated matrix is nonsymmetric.
-* Not modified.
-*
-* D (input) REAL array, dimension (min(M,N))
-* On entry this array specifies the diagonal entries
-* of the diagonal of A. D may either be specified
-* on entry, or set according to MODE and COND as described
-* below. May be changed on exit if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be used:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) REAL
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE neither -6, 0 nor 6, the diagonal is scaled by
-* DMAX / max(abs(D(i))), so that maximum absolute entry
-* of diagonal is abs(DMAX). If DMAX is negative (or zero),
-* diagonal will be scaled by a negative number (or zero).
-*
-* RSIGN (input) CHARACTER*1
-* If MODE neither -6, 0 nor 6, specifies sign of diagonal
-* as follows:
-* 'T' => diagonal entries are multiplied by 1 or -1
-* with probability .5
-* 'F' => diagonal unchanged
-* Not modified.
-*
-* GRADE (input) CHARACTER*1
-* Specifies grading of matrix as follows:
-* 'N' => no grading
-* 'L' => matrix premultiplied by diag( DL )
-* (only if matrix nonsymmetric)
-* 'R' => matrix postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'B' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'S' or 'H' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* ('S' for symmetric, or 'H' for Hermitian)
-* 'E' => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* ( 'E' for eigenvalue invariance)
-* (only if matrix nonsymmetric)
-* Note: if GRADE='E', then M must equal N.
-* Not modified.
-*
-* DL (input/output) REAL array, dimension (M)
-* If MODEL=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODEL is not zero, then DL will be set according
-* to MODEL and CONDL, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DL).
-* If GRADE='E', then DL cannot have zero entries.
-* Not referenced if GRADE = 'N' or 'R'. Changed on exit.
-*
-* MODEL (input) INTEGER
-* This specifies how the diagonal array DL is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDL (input) REAL
-* When MODEL is not zero, this specifies the condition number
-* of the computed DL. Not modified.
-*
-* DR (input/output) REAL array, dimension (N)
-* If MODER=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODER is not zero, then DR will be set according
-* to MODER and CONDR, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DR).
-* Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'.
-* Changed on exit.
-*
-* MODER (input) INTEGER
-* This specifies how the diagonal array DR is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDR (input) REAL
-* When MODER is not zero, this specifies the condition number
-* of the computed DR. Not modified.
-*
-* PIVTNG (input) CHARACTER*1
-* On entry specifies pivoting permutations as follows:
-* 'N' or ' ' => none.
-* 'L' => left or row pivoting (matrix must be nonsymmetric).
-* 'R' => right or column pivoting (matrix must be
-* nonsymmetric).
-* 'B' or 'F' => both or full pivoting, i.e., on both sides.
-* In this case, M must equal N
-*
-* If two calls to SLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be
-* maintained with less than full bandwidth.
-*
-* IPIVOT (input) INTEGER array, dimension (N or M)
-* This array specifies the permutation used. After the
-* basic matrix is generated, the rows, columns, or both
-* are permuted. If, say, row pivoting is selected, SLATMR
-* starts with the *last* row and interchanges the M-th and
-* IPIVOT(M)-th rows, then moves to the next-to-last row,
-* interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
-* and so on. In terms of "2-cycles", the permutation is
-* (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
-* where the rightmost cycle is applied first. This is the
-* *inverse* of the effect of pivoting in LINPACK. The idea
-* is that factoring (with pivoting) an identity matrix
-* which has been inverse-pivoted in this way should
-* result in a pivot vector identical to IPIVOT.
-* Not referenced if PIVTNG = 'N'. Not modified.
-*
-* SPARSE (input) REAL
-* On entry specifies the sparsity of the matrix if a sparse
-* matrix is to be generated. SPARSE should lie between
-* 0 and 1. To generate a sparse matrix, for each matrix entry
-* a uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
-* KL (input) INTEGER
-* On entry specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL at least M-1 implies the matrix is not
-* banded. Must equal KU if matrix is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* On entry specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU at least N-1 implies the matrix is not
-* banded. Must equal KL if matrix is symmetric.
-* Not modified.
-*
-* ANORM (input) REAL
-* On entry specifies maximum entry of output matrix
-* (output matrix will by multiplied by a constant so that
-* its largest absolute entry equal ANORM)
-* if ANORM is nonnegative. If ANORM is negative no scaling
-* is done. Not modified.
-*
-* PACK (input) CHARACTER*1
-* On entry specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if matrix symmetric or square upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if matrix symmetric or square lower triangular)
-* (same as upper half rowwise if symmetric)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to SLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) REAL array, dimension (LDA,N)
-* On exit A is the desired test matrix. Only those
-* entries of A which are significant on output
-* will be referenced (even if A is in packed or band
-* storage format). The 'unoccupied corners' of A in
-* band format will be zeroed out.
-*
-* LDA (input) INTEGER
-* on entry LDA specifies the first dimension of A as
-* declared in the calling program.
-* If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
-* If PACK='C' or 'R', LDA must be at least 1.
-* If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
-* If PACK='Z', LDA must be at least KUU+KLL+1, where
-* KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
-* Not modified.
-*
-* IWORK (workspace) INTEGER array, dimension ( N or M)
-* Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
-*
-* INFO (output) INTEGER
-* Error parameter on exit:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S' or 'H'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
-* -11 => GRADE illegal string, or GRADE='E' and
-* M not equal to N, or GRADE='L', 'R', 'B' or 'E' and
-* SYM = 'S' or 'H'
-* -12 => GRADE = 'E' and DL contains zero
-* -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
-* 'S' or 'E'
-* -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
-* and MODEL neither -6, 0 nor 6
-* -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
-* -17 => CONDR less than 1.0, GRADE='R' or 'B', and
-* MODER neither -6, 0 nor 6
-* -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
-* M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
-* or 'H'
-* -19 => IPIVOT contains out of range number and
-* PIVTNG not equal to 'N'
-* -20 => KL negative
-* -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -22 => SPARSE not in range 0. to 1.
-* -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
-* and SYM='N', or PACK='C' and SYM='N' and either KL
-* not equal to 0 or N not equal to M, or PACK='R' and
-* SYM='N', and either KU not equal to 0 or N not equal
-* to M
-* -26 => LDA too small
-* 1 => Error return from SLATM1 (computing D)
-* 2 => Cannot scale diagonal to DMAX (max. entry is 0)
-* 3 => Error return from SLATM1 (computing DL)
-* 4 => Error return from SLATM1 (computing DR)
-* 5 => ANORM is positive, but matrix constructed prior to
-* attempting to scale it to have norm ANORM, is zero
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatms.f b/TESTING/MATGEN/slatms.f
index c914aaca..da71d288 100644
--- a/TESTING/MATGEN/slatms.f
+++ b/TESTING/MATGEN/slatms.f
@@ -1,9 +1,334 @@
+*> \brief \b SLATMS
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, PACK, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, N
+* REAL COND, DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* REAL A( LDA, * ), D( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATMS generates random matrices with specified singular values
+*> (or symmetric/hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> SLATMS operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then
+*> convert the bandwidth-1 to a bandwidth-2 matrix, etc.
+*> Note that for reasonably small bandwidths (relative to
+*> M and N) this requires less storage, as a dense matrix
+*> is not generated. Also, for symmetric matrices, only
+*> one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or upper
+*> triangular)
+*> store the lower half columnwise (if symmetric or lower
+*> triangular)
+*> store the lower triangle in banded format (if symmetric
+*> or lower triangular)
+*> store the upper triangle in banded format (if symmetric
+*> or upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATMS
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', the generated matrix is symmetric, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is symmetric, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( MIN( M , N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if the matrix is symmetric or upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if the matrix is symmetric or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to SLATMS differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is REAL array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension ( 3*MAX( N , M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from SLATM1
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from SLAGGE or SLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, PACK, SYM
@@ -15,238 +340,6 @@
REAL A( LDA, * ), D( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* SLATMS generates random matrices with specified singular values
-* (or symmetric/hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* SLATMS operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then
-* convert the bandwidth-1 to a bandwidth-2 matrix, etc.
-* Note that for reasonably small bandwidths (relative to
-* M and N) this requires less storage, as a dense matrix
-* is not generated. Also, for symmetric matrices, only
-* one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or upper
-* triangular)
-* store the lower half columnwise (if symmetric or lower
-* triangular)
-* store the lower triangle in banded format (if symmetric
-* or lower triangular)
-* store the upper triangle in banded format (if symmetric
-* or upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATMS
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', the generated matrix is symmetric, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is symmetric, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* Not modified.
-*
-* D (input/output) REAL array, dimension ( MIN( M , N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if the matrix is symmetric or upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if the matrix is symmetric or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to SLATMS differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) REAL array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) REAL array, dimension ( 3*MAX( N , M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from SLATM1
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from SLAGGE or SLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/slatmt.f b/TESTING/MATGEN/slatmt.f
index 6e5007c1..5a75b53c 100644
--- a/TESTING/MATGEN/slatmt.f
+++ b/TESTING/MATGEN/slatmt.f
@@ -1,9 +1,346 @@
+*> \brief \b SLATMT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE SLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RANK, KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* REAL COND, DMAX
+* INTEGER INFO, KL, KU, LDA, M, MODE, N, RANK
+* CHARACTER DIST, PACK, SYM
+* ..
+* .. Array Arguments ..
+* REAL A( LDA, * ), D( * ), WORK( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> SLATMT generates random matrices with specified singular values
+*> (or symmetric/hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> SLATMT operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then
+*> convert the bandwidth-1 to a bandwidth-2 matrix, etc.
+*> Note that for reasonably small bandwidths (relative to
+*> M and N) this requires less storage, as a dense matrix
+*> is not generated. Also, for symmetric matrices, only
+*> one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric)
+*> zero out lower half (if symmetric)
+*> store the upper half columnwise (if symmetric or upper
+*> triangular)
+*> store the lower half columnwise (if symmetric or lower
+*> triangular)
+*> store the lower triangle in banded format (if symmetric
+*> or lower triangular)
+*> store the upper triangle in banded format (if symmetric
+*> or upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to SLATMT
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S' or 'H', the generated matrix is symmetric, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is symmetric, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is REAL array, dimension ( MIN( M , N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> \endverbatim
+*> \verbatim
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
+*> \endverbatim
+*> \verbatim
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is REAL
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is REAL
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RANK
+*> \verbatim
+*> RANK is INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric)
+*> 'L' => zero out all superdiagonal entries (if symmetric)
+*> 'C' => store the upper triangle columnwise
+*> (only if the matrix is symmetric or upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if the matrix is symmetric or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB or TB - use 'B' or 'Q'
+*> PP, SP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to SLATMT differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is REAL array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension ( 3*MAX( N , M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from SLATM7
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from SLAGGE or SLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup real_matgen
+*
+* =====================================================================
SUBROUTINE SLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RANK, KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
REAL COND, DMAX
@@ -15,245 +352,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* SLATMT generates random matrices with specified singular values
-* (or symmetric/hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* SLATMT operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then
-* convert the bandwidth-1 to a bandwidth-2 matrix, etc.
-* Note that for reasonably small bandwidths (relative to
-* M and N) this requires less storage, as a dense matrix
-* is not generated. Also, for symmetric matrices, only
-* one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric)
-* zero out lower half (if symmetric)
-* store the upper half columnwise (if symmetric or upper
-* triangular)
-* store the lower half columnwise (if symmetric or lower
-* triangular)
-* store the lower triangle in banded format (if symmetric
-* or lower triangular)
-* store the upper triangle in banded format (if symmetric
-* or upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to SLATMT
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S' or 'H', the generated matrix is symmetric, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is symmetric, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* Not modified.
-*
-* D (input/output) REAL array, dimension ( MIN( M , N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-*
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
-*
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) REAL
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) REAL
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* RANK (input) INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric)
-* 'L' => zero out all superdiagonal entries (if symmetric)
-* 'C' => store the upper triangle columnwise
-* (only if the matrix is symmetric or upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if the matrix is symmetric or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB or TB - use 'B' or 'Q'
-* PP, SP or TP - use 'C' or 'R'
-*
-* If two calls to SLATMT differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) REAL array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) REAL array, dimension ( 3*MAX( N , M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from SLATM7
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from SLAGGE or SLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlagge.f b/TESTING/MATGEN/zlagge.f
index ce5b7358..5963699d 100644
--- a/TESTING/MATGEN/zlagge.f
+++ b/TESTING/MATGEN/zlagge.f
@@ -1,63 +1,134 @@
- SUBROUTINE ZLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, KL, KU, LDA, M, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION D( * )
- COMPLEX*16 A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b ZLAGGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION D( * )
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* ZLAGGE generates a complex general m by n matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with random unitary matrices:
-* A = U*D*V. The lower and upper bandwidths may then be reduced to
-* kl and ku by additional unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAGGE generates a complex general m by n matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with random unitary matrices:
+*> A = U*D*V. The lower and upper bandwidths may then be reduced to
+*> kl and ku by additional unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* The number of rows of the matrix A. M >= 0.
-*
-* N (input) INTEGER
-* The number of columns of the matrix A. N >= 0.
-*
-* KL (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= KL <= M-1.
-*
-* KU (input) INTEGER
-* The number of nonzero superdiagonals within the band of A.
-* 0 <= KU <= N-1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of the matrix A. M >= 0.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= KL <= M-1.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> The number of nonzero superdiagonals within the band of A.
+*> 0 <= KU <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (min(M,N))
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA,N)
+*> The generated m by n matrix A.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= M.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension (M+N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) DOUBLE PRECISION array, dimension (min(M,N))
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX*16 array, dimension (LDA,N)
-* The generated m by n matrix A.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= M.
+*> \ingroup complex16_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE ZLAGGE( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX*16 array, dimension (M+N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, KL, KU, LDA, M, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION D( * )
+ COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlaghe.f b/TESTING/MATGEN/zlaghe.f
index 0e86fc33..8e9c6e3c 100644
--- a/TESTING/MATGEN/zlaghe.f
+++ b/TESTING/MATGEN/zlaghe.f
@@ -1,57 +1,122 @@
- SUBROUTINE ZLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION D( * )
- COMPLEX*16 A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b ZLAGHE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION D( * )
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* ZLAGHE generates a complex hermitian matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random unitary matrix:
-* A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
-* unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAGHE generates a complex hermitian matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random unitary matrix:
+*> A = U*D*U'. The semi-bandwidth may then be reduced to k by additional
+*> unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA,N)
+*> The generated n by n hermitian matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) DOUBLE PRECISION array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX*16 array, dimension (LDA,N)
-* The generated n by n hermitian matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex16_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE ZLAGHE( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX*16 array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION D( * )
+ COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlagsy.f b/TESTING/MATGEN/zlagsy.f
index 7adb609b..317d2489 100644
--- a/TESTING/MATGEN/zlagsy.f
+++ b/TESTING/MATGEN/zlagsy.f
@@ -1,57 +1,122 @@
- SUBROUTINE ZLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, K, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- DOUBLE PRECISION D( * )
- COMPLEX*16 A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b ZLAGSY
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION D( * )
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* ZLAGSY generates a complex symmetric matrix A, by pre- and post-
-* multiplying a real diagonal matrix D with a random unitary matrix:
-* A = U*D*U**T. The semi-bandwidth may then be reduced to k by
-* additional unitary transformations.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAGSY generates a complex symmetric matrix A, by pre- and post-
+*> multiplying a real diagonal matrix D with a random unitary matrix:
+*> A = U*D*U**T. The semi-bandwidth may then be reduced to k by
+*> additional unitary transformations.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
-*
-* K (input) INTEGER
-* The number of nonzero subdiagonals within the band of A.
-* 0 <= K <= N-1.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in] K
+*> \verbatim
+*> K is INTEGER
+*> The number of nonzero subdiagonals within the band of A.
+*> 0 <= K <= N-1.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension (N)
+*> The diagonal elements of the diagonal matrix D.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA,N)
+*> The generated n by n symmetric matrix A (the full matrix is
+*> stored).
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* D (input) DOUBLE PRECISION array, dimension (N)
-* The diagonal elements of the diagonal matrix D.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (output) COMPLEX*16 array, dimension (LDA,N)
-* The generated n by n symmetric matrix A (the full matrix is
-* stored).
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex16_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE ZLAGSY( N, K, D, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX*16 array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, K, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ DOUBLE PRECISION D( * )
+ COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlahilb.f b/TESTING/MATGEN/zlahilb.f
index a9378c4c..53df5089 100644
--- a/TESTING/MATGEN/zlahilb.f
+++ b/TESTING/MATGEN/zlahilb.f
@@ -1,104 +1,167 @@
+*> \brief \b ZLAHILB
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK,
+* INFO, PATH)
+*
+* .. Scalar Arguments ..
+* INTEGER N, NRHS, LDA, LDX, LDB, INFO
+* .. Array Arguments ..
+* DOUBLE PRECISION WORK(N)
+* COMPLEX*16 A(LDA,N), X(LDX, NRHS), B(LDB, NRHS)
+* CHARACTER*3 PATH
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAHILB generates an N by N scaled Hilbert matrix in A along with
+*> NRHS right-hand sides in B and solutions in X such that A*X=B.
+*>
+*> The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
+*> entries are integers. The right-hand sides are the first NRHS
+*> columns of M * the identity matrix, and the solutions are the
+*> first NRHS columns of the inverse Hilbert matrix.
+*>
+*> The condition number of the Hilbert matrix grows exponentially with
+*> its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
+*> Hilbert matrices beyond a relatively small dimension cannot be
+*> generated exactly without extra precision. Precision is exhausted
+*> when the largest entry in the inverse Hilbert matrix is greater than
+*> 2 to the power of the number of bits in the fraction of the data type
+*> used plus one, which is 24 for single precision.
+*>
+*> In single, the generated solution is exact for N <= 6 and has
+*> small componentwise error for 7 <= N <= 11.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The dimension of the matrix A.
+*> \endverbatim
+*>
+*> \param[in] NRHS
+*> \verbatim
+*> NRHS is INTEGER
+*> The requested number of right-hand sides.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX array, dimension (LDA, N)
+*> The generated scaled Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX array, dimension (LDX, NRHS)
+*> The generated exact solutions. Currently, the first NRHS
+*> columns of the inverse Hilbert matrix.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of the array X. LDX >= N.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is REAL array, dimension (LDB, NRHS)
+*> The generated right-hand sides. Currently, the first NRHS
+*> columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of the array B. LDB >= N.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is REAL array, dimension (N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> = 1: N is too large; the data is still generated but may not
+*> be not exact.
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLAHILB( N, NRHS, A, LDA, X, LDX, B, LDB, WORK,
$ INFO, PATH)
-!
-! -- LAPACK auxiliary test routine (version 3.2.2) --
-! Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
-! Courant Institute, Argonne National Lab, and Rice University
-* June 2010
-!
-! David Vu <dtv@cs.berkeley.edu>
-! Yozo Hida <yozo@cs.berkeley.edu>
-! Jason Riedy <ejr@cs.berkeley.edu>
-! D. Halligan <dhalligan@berkeley.edu>
-!
- IMPLICIT NONE
-! .. Scalar Arguments ..
+*
+* -- LAPACK auxiliary routine (version 3.2.2) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
INTEGER N, NRHS, LDA, LDX, LDB, INFO
-! .. Array Arguments ..
+* .. Array Arguments ..
DOUBLE PRECISION WORK(N)
COMPLEX*16 A(LDA,N), X(LDX, NRHS), B(LDB, NRHS)
CHARACTER*3 PATH
-! ..
-!
-! Purpose
-! =======
-!
-! ZLAHILB generates an N by N scaled Hilbert matrix in A along with
-! NRHS right-hand sides in B and solutions in X such that A*X=B.
-!
-! The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
-! entries are integers. The right-hand sides are the first NRHS
-! columns of M * the identity matrix, and the solutions are the
-! first NRHS columns of the inverse Hilbert matrix.
-!
-! The condition number of the Hilbert matrix grows exponentially with
-! its size, roughly as O(e ** (3.5*N)). Additionally, the inverse
-! Hilbert matrices beyond a relatively small dimension cannot be
-! generated exactly without extra precision. Precision is exhausted
-! when the largest entry in the inverse Hilbert matrix is greater than
-! 2 to the power of the number of bits in the fraction of the data type
-! used plus one, which is 24 for single precision.
-!
-! In single, the generated solution is exact for N <= 6 and has
-! small componentwise error for 7 <= N <= 11.
-!
-! Arguments
-! =========
-!
-! N (input) INTEGER
-! The dimension of the matrix A.
-!
-! NRHS (input) INTEGER
-! The requested number of right-hand sides.
-!
-! A (output) COMPLEX array, dimension (LDA, N)
-! The generated scaled Hilbert matrix.
-!
-! LDA (input) INTEGER
-! The leading dimension of the array A. LDA >= N.
-!
-! X (output) COMPLEX array, dimension (LDX, NRHS)
-! The generated exact solutions. Currently, the first NRHS
-! columns of the inverse Hilbert matrix.
-!
-! LDX (input) INTEGER
-! The leading dimension of the array X. LDX >= N.
-!
-! B (output) REAL array, dimension (LDB, NRHS)
-! The generated right-hand sides. Currently, the first NRHS
-! columns of LCM(1, 2, ..., 2*N-1) * the identity matrix.
-!
-! LDB (input) INTEGER
-! The leading dimension of the array B. LDB >= N.
-!
-! WORK (workspace) REAL array, dimension (N)
-!
-!
-! INFO (output) INTEGER
-! = 0: successful exit
-! = 1: N is too large; the data is still generated but may not
-! be not exact.
-! < 0: if INFO = -i, the i-th argument had an illegal value
-!
-! =====================================================================
+* ..
+*
+* =====================================================================
-! .. Local Scalars ..
+* .. Local Scalars ..
INTEGER TM, TI, R
INTEGER M
INTEGER I, J
COMPLEX*16 TMP
CHARACTER*2 C2
-! .. Parameters ..
-! NMAX_EXACT the largest dimension where the generated data is
-! exact.
-! NMAX_APPROX the largest dimension where the generated data has
-! a small componentwise relative error.
-! ??? complex uses how many bits ???
+* .. Parameters ..
+* NMAX_EXACT the largest dimension where the generated data is
+* exact.
+* NMAX_APPROX the largest dimension where the generated data has
+* a small componentwise relative error.
+* ??? complex uses how many bits ???
INTEGER NMAX_EXACT, NMAX_APPROX, SIZE_D
PARAMETER (NMAX_EXACT = 6, NMAX_APPROX = 11, SIZE_D = 8)
-! d's are generated from random permuation of those eight elements.
+* d's are generated from random permuation of those eight elements.
COMPLEX*16 d1(8), d2(8), invd1(8), invd2(8)
DATA D1 /(-1,0),(0,1),(-1,-1),(0,-1),(1,0),(-1,1),(1,1),(1,-1)/
DATA D2 /(-1,0),(0,-1),(-1,1),(0,1),(1,0),(-1,-1),(1,-1),(1,1)/
@@ -107,17 +170,17 @@
$ (-.5,-.5),(.5,-.5),(.5,.5)/
DATA INVD2 /(-1,0),(0,1),(-.5,-.5),(0,-1),(1,0),
$ (-.5,.5),(.5,.5),(.5,-.5)/
-! ..
-! .. External Functions
+* ..
+* .. External Functions
EXTERNAL ZLASET, LSAMEN
INTRINSIC DBLE
LOGICAL LSAMEN
-! ..
-! .. Executable Statements ..
+* ..
+* .. Executable Statements ..
C2 = PATH( 2: 3 )
-!
-! Test the input arguments
-!
+*
+* Test the input arguments
+*
INFO = 0
IF (N .LT. 0 .OR. N .GT. NMAX_APPROX) THEN
INFO = -1
@@ -138,8 +201,8 @@
INFO = 1
END IF
-! Compute M = the LCM of the integers [1, 2*N-1]. The largest
-! reasonable N is small enough that integers suffice (up to N = 11).
+* Compute M = the LCM of the integers [1, 2*N-1]. The largest
+* reasonable N is small enough that integers suffice (up to N = 11).
M = 1
DO I = 2, (2*N-1)
TM = M
@@ -153,9 +216,9 @@
M = (M / TI) * I
END DO
-! Generate the scaled Hilbert matrix in A
-! If we are testing SY routines,
-! take D1_i = D2_i, else, D1_i = D2_i*
+* Generate the scaled Hilbert matrix in A
+* If we are testing SY routines,
+* take D1_i = D2_i, else, D1_i = D2_i*
IF ( LSAMEN( 2, C2, 'SY' ) ) THEN
DO J = 1, N
DO I = 1, N
@@ -172,22 +235,22 @@
END DO
END IF
-! Generate matrix B as simply the first NRHS columns of M * the
-! identity.
+* Generate matrix B as simply the first NRHS columns of M * the
+* identity.
TMP = DBLE(M)
CALL ZLASET('Full', N, NRHS, (0.0D+0,0.0D+0), TMP, B, LDB)
-! Generate the true solutions in X. Because B = the first NRHS
-! columns of M*I, the true solutions are just the first NRHS columns
-! of the inverse Hilbert matrix.
+* Generate the true solutions in X. Because B = the first NRHS
+* columns of M*I, the true solutions are just the first NRHS columns
+* of the inverse Hilbert matrix.
WORK(1) = N
DO J = 2, N
WORK(J) = ( ( (WORK(J-1)/(J-1)) * (J-1 - N) ) /(J-1) )
$ * (N +J -1)
END DO
-! If we are testing SY routines,
-! take D1_i = D2_i, else, D1_i = D2_i*
+* If we are testing SY routines,
+* take D1_i = D2_i, else, D1_i = D2_i*
IF ( LSAMEN( 2, C2, 'SY' ) ) THEN
DO J = 1, NRHS
DO I = 1, N
diff --git a/TESTING/MATGEN/zlakf2.f b/TESTING/MATGEN/zlakf2.f
index 58c7eb27..48afb3f4 100644
--- a/TESTING/MATGEN/zlakf2.f
+++ b/TESTING/MATGEN/zlakf2.f
@@ -1,54 +1,125 @@
- SUBROUTINE ZLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDZ, M, N
-* ..
-* .. Array Arguments ..
- COMPLEX*16 A( LDA, * ), B( LDA, * ), D( LDA, * ),
- $ E( LDA, * ), Z( LDZ, * )
-* ..
-*
+*> \brief \b ZLAKF2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+* COMPLEX*16 A( LDA, * ), B( LDA, * ), D( LDA, * ),
+* $ E( LDA, * ), Z( LDZ, * )
+* ..
+*
* Purpose
* =======
*
-* Form the 2*M*N by 2*M*N matrix
-*
-* Z = [ kron(In, A) -kron(B', Im) ]
-* [ kron(In, D) -kron(E', Im) ],
-*
-* where In is the identity matrix of size n and X' is the transpose
-* of X. kron(X, Y) is the Kronecker product between the matrices X
-* and Y.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> Form the 2*M*N by 2*M*N matrix
+*>
+*> Z = [ kron(In, A) -kron(B', Im) ]
+*> [ kron(In, D) -kron(E', Im) ],
+*>
+*> where In is the identity matrix of size n and X' is the transpose
+*> of X. kron(X, Y) is the Kronecker product between the matrices X
+*> and Y.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* M (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of matrix, must be >= 1.
+*> \endverbatim
+*>
+*> \param[in] A
+*> \verbatim
+*> A is COMPLEX*16, dimension ( LDA, M )
+*> The matrix A in the output matrix Z.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \endverbatim
+*>
+*> \param[in] B
+*> \verbatim
+*> B is COMPLEX*16, dimension ( LDA, N )
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX*16, dimension ( LDA, M )
+*> \endverbatim
+*>
+*> \param[in] E
+*> \verbatim
+*> E is COMPLEX*16, dimension ( LDA, N )
+*> \endverbatim
+*> \verbatim
+*> The matrices used in forming the output matrix Z.
+*> \endverbatim
+*>
+*> \param[out] Z
+*> \verbatim
+*> Z is COMPLEX*16, dimension ( LDZ, 2*M*N )
+*> The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+*> \endverbatim
+*>
+*> \param[in] LDZ
+*> \verbatim
+*> LDZ is INTEGER
+*> The leading dimension of Z. ( LDZ >= 2*M*N )
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* N (input) INTEGER
-* Size of matrix, must be >= 1.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input) COMPLEX*16, dimension ( LDA, M )
-* The matrix A in the output matrix Z.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of A, B, D, and E. ( LDA >= M+N )
+*> \ingroup complex16_matgen
*
-* B (input) COMPLEX*16, dimension ( LDA, N )
-* D (input) COMPLEX*16, dimension ( LDA, M )
-* E (input) COMPLEX*16, dimension ( LDA, N )
-* The matrices used in forming the output matrix Z.
+* =====================================================================
+ SUBROUTINE ZLAKF2( M, N, A, LDA, B, D, E, Z, LDZ )
*
-* Z (output) COMPLEX*16, dimension ( LDZ, 2*M*N )
-* The resultant Kronecker M*N*2 by M*N*2 matrix (see above.)
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* LDZ (input) INTEGER
-* The leading dimension of Z. ( LDZ >= 2*M*N )
+* .. Scalar Arguments ..
+ INTEGER LDA, LDZ, M, N
+* ..
+* .. Array Arguments ..
+ COMPLEX*16 A( LDA, * ), B( LDA, * ), D( LDA, * ),
+ $ E( LDA, * ), Z( LDZ, * )
+* ..
*
* ====================================================================
*
diff --git a/TESTING/MATGEN/zlarge.f b/TESTING/MATGEN/zlarge.f
index 7cb187e5..895afc48 100644
--- a/TESTING/MATGEN/zlarge.f
+++ b/TESTING/MATGEN/zlarge.f
@@ -1,48 +1,106 @@
- SUBROUTINE ZLARGE( N, A, LDA, ISEED, WORK, INFO )
-*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER INFO, LDA, N
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
- COMPLEX*16 A( LDA, * ), WORK( * )
-* ..
-*
+*> \brief \b ZLARGE
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLARGE( N, A, LDA, ISEED, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
+*
* Purpose
* =======
*
-* ZLARGE pre- and post-multiplies a complex general n by n matrix A
-* with a random unitary matrix: A = U*D*U'.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLARGE pre- and post-multiplies a complex general n by n matrix A
+*> with a random unitary matrix: A = U*D*U'.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* N (input) INTEGER
-* The order of the matrix A. N >= 0.
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The order of the matrix A. N >= 0.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA,N)
+*> On entry, the original n by n matrix A.
+*> On exit, A is overwritten by U*A*U' for some random
+*> unitary matrix U.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of the array A. LDA >= N.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension (2*N)
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit
+*> < 0: if INFO = -i, the i-th argument had an illegal value
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* A (input/output) COMPLEX*16 array, dimension (LDA,N)
-* On entry, the original n by n matrix A.
-* On exit, A is overwritten by U*A*U' for some random
-* unitary matrix U.
+*> \date November 2011
*
-* LDA (input) INTEGER
-* The leading dimension of the array A. LDA >= N.
+*> \ingroup complex16_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
+* =====================================================================
+ SUBROUTINE ZLARGE( N, A, LDA, ISEED, WORK, INFO )
*
-* WORK (workspace) COMPLEX*16 array, dimension (2*N)
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* INFO (output) INTEGER
-* = 0: successful exit
-* < 0: if INFO = -i, the i-th argument had an illegal value
+* .. Scalar Arguments ..
+ INTEGER INFO, LDA, N
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+ COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlarnd.f b/TESTING/MATGEN/zlarnd.f
index 09a20c4f..15919f27 100644
--- a/TESTING/MATGEN/zlarnd.f
+++ b/TESTING/MATGEN/zlarnd.f
@@ -1,45 +1,95 @@
- COMPLEX*16 FUNCTION ZLARND( IDIST, ISEED )
+*> \brief \b ZLARND
*
-* -- LAPACK auxiliary routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* =========== DOCUMENTATION ===========
*
-* .. Scalar Arguments ..
- INTEGER IDIST
-* ..
-* .. Array Arguments ..
- INTEGER ISEED( 4 )
-* ..
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
*
+* COMPLEX*16 FUNCTION ZLARND( IDIST, ISEED )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* ..
+*
* Purpose
* =======
*
-* ZLARND returns a random complex number from a uniform or normal
-* distribution.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLARND returns a random complex number from a uniform or normal
+*> distribution.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* IDIST (input) INTEGER
-* Specifies the distribution of the random numbers:
-* = 1: real and imaginary parts each uniform (0,1)
-* = 2: real and imaginary parts each uniform (-1,1)
-* = 3: real and imaginary parts each normal (0,1)
-* = 4: uniformly distributed on the disc abs(z) <= 1
-* = 5: uniformly distributed on the circle abs(z) = 1
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> Specifies the distribution of the random numbers:
+*> = 1: real and imaginary parts each uniform (0,1)
+*> = 2: real and imaginary parts each uniform (-1,1)
+*> = 3: real and imaginary parts each normal (0,1)
+*> = 4: uniformly distributed on the disc abs(z) <= 1
+*> = 5: uniformly distributed on the circle abs(z) = 1
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry, the seed of the random number generator; the array
+*> elements must be between 0 and 4095, and ISEED(4) must be
+*> odd.
+*> On exit, the seed is updated.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry, the seed of the random number generator; the array
-* elements must be between 0 and 4095, and ISEED(4) must be
-* odd.
-* On exit, the seed is updated.
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> This routine calls the auxiliary routine DLARAN to generate a random
+*> real number from a uniform (0,1) distribution. The Box-Muller method
+*> is used to transform numbers from a uniform to a normal distribution.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ COMPLEX*16 FUNCTION ZLARND( IDIST, ISEED )
*
-* This routine calls the auxiliary routine DLARAN to generate a random
-* real number from a uniform (0,1) distribution. The Box-Muller method
-* is used to transform numbers from a uniform to a normal distribution.
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
+*
+* .. Scalar Arguments ..
+ INTEGER IDIST
+* ..
+* .. Array Arguments ..
+ INTEGER ISEED( 4 )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlaror.f b/TESTING/MATGEN/zlaror.f
index 73f75136..34d32223 100644
--- a/TESTING/MATGEN/zlaror.f
+++ b/TESTING/MATGEN/zlaror.f
@@ -1,8 +1,170 @@
+*> \brief \b ZLAROR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER INIT, SIDE
+* INTEGER INFO, LDA, M, N
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX*16 A( LDA, * ), X( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAROR pre- or post-multiplies an M by N matrix A by a random
+*> unitary matrix U, overwriting A. A may optionally be
+*> initialized to the identity matrix before multiplying by U.
+*> U is generated using the method of G.W. Stewart
+*> ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ).
+*> (BLAS-2 version)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] SIDE
+*> \verbatim
+*> SIDE is CHARACTER*1
+*> SIDE specifies whether A is multiplied on the left or right
+*> by U.
+*> SIDE = 'L' Multiply A on the left (premultiply) by U
+*> SIDE = 'R' Multiply A on the right (postmultiply) by UC> SIDE = 'C' Multiply A on the left by U and the right by UC> SIDE = 'T' Multiply A on the left by U and the right by U'
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] INIT
+*> \verbatim
+*> INIT is CHARACTER*1
+*> INIT specifies whether or not A should be initialized to
+*> the identity matrix.
+*> INIT = 'I' Initialize A to (a section of) the
+*> identity matrix before applying U.
+*> INIT = 'N' No initialization. Apply U to the
+*> input matrix A.
+*> \endverbatim
+*> \verbatim
+*> INIT = 'I' may be used to generate square (i.e., unitary)
+*> or rectangular orthogonal matrices (orthogonality being
+*> in the sense of ZDOTC):
+*> \endverbatim
+*> \verbatim
+*> For square matrices, M=N, and SIDE many be either 'L' or
+*> 'R'; the rows will be orthogonal to each other, as will the
+*> columns.
+*> For rectangular matrices where M < N, SIDE = 'R' will
+*> produce a dense matrix whose rows will be orthogonal and
+*> whose columns will not, while SIDE = 'L' will produce a
+*> matrix whose rows will be orthogonal, and whose first M
+*> columns will be orthogonal, the remaining columns being
+*> zero.
+*> For matrices where M > N, just use the previous
+*> explanation, interchanging 'L' and 'R' and "rows" and
+*> "columns".
+*> \endverbatim
+*> \verbatim
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*> \verbatim
+*> A COMPLEX*16 array, dimension ( LDA, N )
+*> Input and output array. Overwritten by U A ( if SIDE = 'L' )
+*> or by A U ( if SIDE = 'R' )
+*> or by U A U* ( if SIDE = 'C')
+*> or by U A U' ( if SIDE = 'T') on exit.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> Leading dimension of A. Must be at least MAX ( 1, M ).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The array elements should be between 0 and 4095;
+*> if not they will be reduced mod 4096. Also, ISEED(4) must
+*> be odd. The random number generator uses a linear
+*> congruential sequence limited to small integers, and so
+*> should produce machine independent random numbers. The
+*> values of ISEED are changed on exit, and can be used in the
+*> next call to ZLAROR to continue the same random number
+*> sequence.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX*16 array, dimension ( 3*MAX( M, N ) )
+*> Workspace. Of length:
+*> 2*M + N if SIDE = 'L',
+*> 2*N + M if SIDE = 'R',
+*> 3*N if SIDE = 'C' or 'T'.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> An error flag. It is set to:
+*> 0 if no error.
+*> 1 if ZLARND returned a bad random number (installation
+*> problem)
+*> -1 if SIDE is not L, R, C, or T.
+*> -3 if M is negative.
+*> -4 if N is negative or if SIDE is C or T and N is not equal
+*> to M.
+*> -6 if LDA is less than M.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLAROR( SIDE, INIT, M, N, A, LDA, ISEED, X, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER INIT, SIDE
@@ -13,101 +175,6 @@
COMPLEX*16 A( LDA, * ), X( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLAROR pre- or post-multiplies an M by N matrix A by a random
-* unitary matrix U, overwriting A. A may optionally be
-* initialized to the identity matrix before multiplying by U.
-* U is generated using the method of G.W. Stewart
-* ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ).
-* (BLAS-2 version)
-*
-* Arguments
-* =========
-*
-* SIDE (input) CHARACTER*1
-* SIDE specifies whether A is multiplied on the left or right
-* by U.
-* SIDE = 'L' Multiply A on the left (premultiply) by U
-* SIDE = 'R' Multiply A on the right (postmultiply) by U*
-* SIDE = 'C' Multiply A on the left by U and the right by U*
-* SIDE = 'T' Multiply A on the left by U and the right by U'
-* Not modified.
-*
-* INIT (input) CHARACTER*1
-* INIT specifies whether or not A should be initialized to
-* the identity matrix.
-* INIT = 'I' Initialize A to (a section of) the
-* identity matrix before applying U.
-* INIT = 'N' No initialization. Apply U to the
-* input matrix A.
-*
-* INIT = 'I' may be used to generate square (i.e., unitary)
-* or rectangular orthogonal matrices (orthogonality being
-* in the sense of ZDOTC):
-*
-* For square matrices, M=N, and SIDE many be either 'L' or
-* 'R'; the rows will be orthogonal to each other, as will the
-* columns.
-* For rectangular matrices where M < N, SIDE = 'R' will
-* produce a dense matrix whose rows will be orthogonal and
-* whose columns will not, while SIDE = 'L' will produce a
-* matrix whose rows will be orthogonal, and whose first M
-* columns will be orthogonal, the remaining columns being
-* zero.
-* For matrices where M > N, just use the previous
-* explanation, interchanging 'L' and 'R' and "rows" and
-* "columns".
-*
-* Not modified.
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* A COMPLEX*16 array, dimension ( LDA, N )
-* Input and output array. Overwritten by U A ( if SIDE = 'L' )
-* or by A U ( if SIDE = 'R' )
-* or by U A U* ( if SIDE = 'C')
-* or by U A U' ( if SIDE = 'T') on exit.
-*
-* LDA (input) INTEGER
-* Leading dimension of A. Must be at least MAX ( 1, M ).
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The array elements should be between 0 and 4095;
-* if not they will be reduced mod 4096. Also, ISEED(4) must
-* be odd. The random number generator uses a linear
-* congruential sequence limited to small integers, and so
-* should produce machine independent random numbers. The
-* values of ISEED are changed on exit, and can be used in the
-* next call to ZLAROR to continue the same random number
-* sequence.
-* Modified.
-*
-* X (workspace) COMPLEX*16 array, dimension ( 3*MAX( M, N ) )
-* Workspace. Of length:
-* 2*M + N if SIDE = 'L',
-* 2*N + M if SIDE = 'R',
-* 3*N if SIDE = 'C' or 'T'.
-* Modified.
-*
-* INFO (output) INTEGER
-* An error flag. It is set to:
-* 0 if no error.
-* 1 if ZLARND returned a bad random number (installation
-* problem)
-* -1 if SIDE is not L, R, C, or T.
-* -3 if M is negative.
-* -4 if N is negative or if SIDE is C or T and N is not equal
-* to M.
-* -6 if LDA is less than M.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlarot.f b/TESTING/MATGEN/zlarot.f
index 106a4d9f..68c986de 100644
--- a/TESTING/MATGEN/zlarot.f
+++ b/TESTING/MATGEN/zlarot.f
@@ -1,9 +1,248 @@
+*> \brief \b ZLAROT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
+* XRIGHT )
+*
+* .. Scalar Arguments ..
+* LOGICAL LLEFT, LRIGHT, LROWS
+* INTEGER LDA, NL
+* COMPLEX*16 C, S, XLEFT, XRIGHT
+* ..
+* .. Array Arguments ..
+* COMPLEX*16 A( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLAROT applies a (Givens) rotation to two adjacent rows or
+*> columns, where one element of the first and/or last column/row
+*> for use on matrices stored in some format other than GE, so
+*> that elements of the matrix may be used or modified for which
+*> no array element is provided.
+*>
+*> One example is a symmetric matrix in SB format (bandwidth=4), for
+*> which UPLO='L': Two adjacent rows will have the format:
+*>
+*> row j: C> C> C> C> C> . . . .
+*> row j+1: C> C> C> C> C> . . . .
+*>
+*> '*' indicates elements for which storage is provided,
+*> '.' indicates elements for which no storage is provided, but
+*> are not necessarily zero; their values are determined by
+*> symmetry. ' ' indicates elements which are necessarily zero,
+*> and have no storage provided.
+*>
+*> Those columns which have two '*'s can be handled by DROT.
+*> Those columns which have no '*'s can be ignored, since as long
+*> as the Givens rotations are carefully applied to preserve
+*> symmetry, their values are determined.
+*> Those columns which have one '*' have to be handled separately,
+*> by using separate variables "p" and "q":
+*>
+*> row j: C> C> C> C> C> p . . .
+*> row j+1: q C> C> C> C> C> . . . .
+*>
+*> The element p would have to be set correctly, then that column
+*> is rotated, setting p to its new value. The next call to
+*> ZLAROT would rotate columns j and j+1, using p, and restore
+*> symmetry. The element q would start out being zero, and be
+*> made non-zero by the rotation. Later, rotations would presumably
+*> be chosen to zero q out.
+*>
+*> Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
+*> ------- ------- ---------
+*>
+*> General dense matrix:
+*>
+*> CALL ZLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
+*> A(i,1),LDA, DUMMY, DUMMY)
+*>
+*> General banded matrix in GB format:
+*>
+*> j = MAX(1, i-KL )
+*> NL = MIN( N, i+KU+1 ) + 1-j
+*> CALL ZLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
+*> A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,KL+1) ]
+*>
+*> Symmetric banded matrix in SY format, bandwidth K,
+*> lower triangle only:
+*>
+*> j = MAX(1, i-K )
+*> NL = MIN( K+1, i ) + 1
+*> CALL ZLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
+*> A(i,j), LDA, XLEFT, XRIGHT )
+*>
+*> Same, but upper triangle only:
+*>
+*> NL = MIN( K+1, N-i ) + 1
+*> CALL ZLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
+*> A(i,i), LDA, XLEFT, XRIGHT )
+*>
+*> Symmetric banded matrix in SB format, bandwidth K,
+*> lower triangle only:
+*>
+*> [ same as for SY, except:]
+*> . . . .
+*> A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
+*>
+*> [ note that i+1-j is just MIN(i,K+1) ]
+*>
+*> Same, but upper triangle only:
+*> . . .
+*> A(K+1,i), LDA-1, XLEFT, XRIGHT )
+*>
+*> Rotating columns is just the transpose of rotating rows, except
+*> for GB and SB: (rotating columns i and i+1)
+*>
+*> GB:
+*> j = MAX(1, i-KU )
+*> NL = MIN( N, i+KL+1 ) + 1-j
+*> CALL ZLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
+*> A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> [note that KU+j+1-i is just MAX(1,KU+2-i)]
+*>
+*> SB: (upper triangle)
+*>
+*> . . . . . .
+*> A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
+*>
+*> SB: (lower triangle)
+*>
+*> . . . . . .
+*> A(1,i),LDA-1, XTOP, XBOTTM )
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \verbatim
+*> LROWS - LOGICAL
+*> If .TRUE., then ZLAROT will rotate two rows. If .FALSE.,
+*> then it will rotate two columns.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LLEFT - LOGICAL
+*> If .TRUE., then XLEFT will be used instead of the
+*> corresponding element of A for the first element in the
+*> second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
+*> If .FALSE., then the corresponding element of A will be
+*> used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> LRIGHT - LOGICAL
+*> If .TRUE., then XRIGHT will be used instead of the
+*> corresponding element of A for the last element in the
+*> first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
+*> .FALSE., then the corresponding element of A will be used.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> NL - INTEGER
+*> The length of the rows (if LROWS=.TRUE.) or columns (if
+*> LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
+*> used, the columns/rows they are in should be included in
+*> NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
+*> least 2. The number of rows/columns to be rotated
+*> exclusive of those involving XLEFT and/or XRIGHT may
+*> not be negative, i.e., NL minus how many of LLEFT and
+*> LRIGHT are .TRUE. must be at least zero; if not, XERBLA
+*> will be called.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> C, S - COMPLEX*16
+*> Specify the Givens rotation to be applied. If LROWS is
+*> true, then the matrix ( c s )
+*> ( _ _ )
+*> (-s c ) is applied from the left;
+*> if false, then the transpose (not conjugated) thereof is
+*> applied from the right. Note that in contrast to the
+*> output of ZROTG or to most versions of ZROT, both C and S
+*> are complex. For a Givens rotation, |C|**2 + |S|**2 should
+*> be 1, but this is not checked.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> A - COMPLEX*16 array.
+*> The array containing the rows/columns to be rotated. The
+*> first element of A should be the upper left element to
+*> be rotated.
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> LDA - INTEGER
+*> The "effective" leading dimension of A. If A contains
+*> a matrix stored in GE, HE, or SY format, then this is just
+*> the leading dimension of A as dimensioned in the calling
+*> routine. If A contains a matrix stored in band (GB, HB, or
+*> SB) format, then this should be *one less* than the leading
+*> dimension used in the calling routine. Thus, if A were
+*> dimensioned A(LDA,*) in ZLAROT, then A(1,j) would be the
+*> j-th element in the first of the two rows to be rotated,
+*> and A(2,j) would be the j-th in the second, regardless of
+*> how the array may be stored in the calling routine. [A
+*> cannot, however, actually be dimensioned thus, since for
+*> band format, the row number may exceed LDA, which is not
+*> legal FORTRAN.]
+*> If LROWS=.TRUE., then LDA must be at least 1, otherwise
+*> it must be at least NL minus the number of .TRUE. values
+*> in XLEFT and XRIGHT.
+*> Not modified.
+*> \endverbatim
+*> \verbatim
+*> XLEFT - COMPLEX*16
+*> If LLEFT is .TRUE., then XLEFT will be used and modified
+*> instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*> \verbatim
+*> XRIGHT - COMPLEX*16
+*> If LRIGHT is .TRUE., then XRIGHT will be used and modified
+*> instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
+*> (if LROWS=.FALSE.).
+*> Read and modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLAROT( LROWS, LLEFT, LRIGHT, NL, C, S, A, LDA, XLEFT,
$ XRIGHT )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
LOGICAL LLEFT, LRIGHT, LROWS
@@ -14,193 +253,6 @@
COMPLEX*16 A( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLAROT applies a (Givens) rotation to two adjacent rows or
-* columns, where one element of the first and/or last column/row
-* for use on matrices stored in some format other than GE, so
-* that elements of the matrix may be used or modified for which
-* no array element is provided.
-*
-* One example is a symmetric matrix in SB format (bandwidth=4), for
-* which UPLO='L': Two adjacent rows will have the format:
-*
-* row j: * * * * * . . . .
-* row j+1: * * * * * . . . .
-*
-* '*' indicates elements for which storage is provided,
-* '.' indicates elements for which no storage is provided, but
-* are not necessarily zero; their values are determined by
-* symmetry. ' ' indicates elements which are necessarily zero,
-* and have no storage provided.
-*
-* Those columns which have two '*'s can be handled by DROT.
-* Those columns which have no '*'s can be ignored, since as long
-* as the Givens rotations are carefully applied to preserve
-* symmetry, their values are determined.
-* Those columns which have one '*' have to be handled separately,
-* by using separate variables "p" and "q":
-*
-* row j: * * * * * p . . .
-* row j+1: q * * * * * . . . .
-*
-* The element p would have to be set correctly, then that column
-* is rotated, setting p to its new value. The next call to
-* ZLAROT would rotate columns j and j+1, using p, and restore
-* symmetry. The element q would start out being zero, and be
-* made non-zero by the rotation. Later, rotations would presumably
-* be chosen to zero q out.
-*
-* Typical Calling Sequences: rotating the i-th and (i+1)-st rows.
-* ------- ------- ---------
-*
-* General dense matrix:
-*
-* CALL ZLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S,
-* A(i,1),LDA, DUMMY, DUMMY)
-*
-* General banded matrix in GB format:
-*
-* j = MAX(1, i-KL )
-* NL = MIN( N, i+KU+1 ) + 1-j
-* CALL ZLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S,
-* A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,KL+1) ]
-*
-* Symmetric banded matrix in SY format, bandwidth K,
-* lower triangle only:
-*
-* j = MAX(1, i-K )
-* NL = MIN( K+1, i ) + 1
-* CALL ZLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S,
-* A(i,j), LDA, XLEFT, XRIGHT )
-*
-* Same, but upper triangle only:
-*
-* NL = MIN( K+1, N-i ) + 1
-* CALL ZLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S,
-* A(i,i), LDA, XLEFT, XRIGHT )
-*
-* Symmetric banded matrix in SB format, bandwidth K,
-* lower triangle only:
-*
-* [ same as for SY, except:]
-* . . . .
-* A(i+1-j,j), LDA-1, XLEFT, XRIGHT )
-*
-* [ note that i+1-j is just MIN(i,K+1) ]
-*
-* Same, but upper triangle only:
-* . . .
-* A(K+1,i), LDA-1, XLEFT, XRIGHT )
-*
-* Rotating columns is just the transpose of rotating rows, except
-* for GB and SB: (rotating columns i and i+1)
-*
-* GB:
-* j = MAX(1, i-KU )
-* NL = MIN( N, i+KL+1 ) + 1-j
-* CALL ZLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S,
-* A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* [note that KU+j+1-i is just MAX(1,KU+2-i)]
-*
-* SB: (upper triangle)
-*
-* . . . . . .
-* A(K+j+1-i,i),LDA-1, XTOP, XBOTTM )
-*
-* SB: (lower triangle)
-*
-* . . . . . .
-* A(1,i),LDA-1, XTOP, XBOTTM )
-*
-* Arguments
-* =========
-*
-* LROWS - LOGICAL
-* If .TRUE., then ZLAROT will rotate two rows. If .FALSE.,
-* then it will rotate two columns.
-* Not modified.
-*
-* LLEFT - LOGICAL
-* If .TRUE., then XLEFT will be used instead of the
-* corresponding element of A for the first element in the
-* second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.)
-* If .FALSE., then the corresponding element of A will be
-* used.
-* Not modified.
-*
-* LRIGHT - LOGICAL
-* If .TRUE., then XRIGHT will be used instead of the
-* corresponding element of A for the last element in the
-* first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If
-* .FALSE., then the corresponding element of A will be used.
-* Not modified.
-*
-* NL - INTEGER
-* The length of the rows (if LROWS=.TRUE.) or columns (if
-* LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are
-* used, the columns/rows they are in should be included in
-* NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at
-* least 2. The number of rows/columns to be rotated
-* exclusive of those involving XLEFT and/or XRIGHT may
-* not be negative, i.e., NL minus how many of LLEFT and
-* LRIGHT are .TRUE. must be at least zero; if not, XERBLA
-* will be called.
-* Not modified.
-*
-* C, S - COMPLEX*16
-* Specify the Givens rotation to be applied. If LROWS is
-* true, then the matrix ( c s )
-* ( _ _ )
-* (-s c ) is applied from the left;
-* if false, then the transpose (not conjugated) thereof is
-* applied from the right. Note that in contrast to the
-* output of ZROTG or to most versions of ZROT, both C and S
-* are complex. For a Givens rotation, |C|**2 + |S|**2 should
-* be 1, but this is not checked.
-* Not modified.
-*
-* A - COMPLEX*16 array.
-* The array containing the rows/columns to be rotated. The
-* first element of A should be the upper left element to
-* be rotated.
-* Read and modified.
-*
-* LDA - INTEGER
-* The "effective" leading dimension of A. If A contains
-* a matrix stored in GE, HE, or SY format, then this is just
-* the leading dimension of A as dimensioned in the calling
-* routine. If A contains a matrix stored in band (GB, HB, or
-* SB) format, then this should be *one less* than the leading
-* dimension used in the calling routine. Thus, if A were
-* dimensioned A(LDA,*) in ZLAROT, then A(1,j) would be the
-* j-th element in the first of the two rows to be rotated,
-* and A(2,j) would be the j-th in the second, regardless of
-* how the array may be stored in the calling routine. [A
-* cannot, however, actually be dimensioned thus, since for
-* band format, the row number may exceed LDA, which is not
-* legal FORTRAN.]
-* If LROWS=.TRUE., then LDA must be at least 1, otherwise
-* it must be at least NL minus the number of .TRUE. values
-* in XLEFT and XRIGHT.
-* Not modified.
-*
-* XLEFT - COMPLEX*16
-* If LLEFT is .TRUE., then XLEFT will be used and modified
-* instead of A(2,1) (if LROWS=.TRUE.) or A(1,2)
-* (if LROWS=.FALSE.).
-* Read and modified.
-*
-* XRIGHT - COMPLEX*16
-* If LRIGHT is .TRUE., then XRIGHT will be used and modified
-* instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1)
-* (if LROWS=.FALSE.).
-* Read and modified.
-*
* =====================================================================
*
* .. Local Scalars ..
diff --git a/TESTING/MATGEN/zlatm1.f b/TESTING/MATGEN/zlatm1.f
index aa0133a1..8e6829bf 100644
--- a/TESTING/MATGEN/zlatm1.f
+++ b/TESTING/MATGEN/zlatm1.f
@@ -1,8 +1,148 @@
+*> \brief \b ZLATM1
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER IDIST, INFO, IRSIGN, MODE, N
+* DOUBLE PRECISION COND
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* COMPLEX*16 D( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATM1 computes the entries of D(1..N) as specified by
+*> MODE, COND and IRSIGN. IDIST and ISEED determine the generation
+*> of random numbers. ZLATM1 is called by CLATMR to generate
+*> random test matrices for LAPACK programs.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be computed:
+*> MODE = 0 means do not change D.
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IRSIGN
+*> \verbatim
+*> IRSIGN is INTEGER
+*> On entry, if MODE neither -6, 0 nor 6, determines sign of
+*> entries of D
+*> 0 => leave entries of D unchanged
+*> 1 => multiply each entry of D by random complex number
+*> uniformly distributed with absolute value 1
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is CHARACTER*1
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0, 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. The random number generator uses a
+*> linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to ZLATM1
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX*16 array, dimension ( MIN( M , N ) )
+*> Array to be computed according to MODE, COND and IRSIGN.
+*> May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of entries of D. Not modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> 0 => normal termination
+*> -1 => if MODE not in range -6 to 6
+*> -2 => if MODE neither -6, 0 nor 6, and
+*> IRSIGN neither 0 nor 1
+*> -3 => if MODE neither -6, 0 nor 6 and COND less than 1
+*> -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 4
+*> -7 => if N negative
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLATM1( MODE, COND, IRSIGN, IDIST, ISEED, D, N, INFO )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
INTEGER IDIST, INFO, IRSIGN, MODE, N
@@ -13,81 +153,6 @@
COMPLEX*16 D( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATM1 computes the entries of D(1..N) as specified by
-* MODE, COND and IRSIGN. IDIST and ISEED determine the generation
-* of random numbers. ZLATM1 is called by CLATMR to generate
-* random test matrices for LAPACK programs.
-*
-* Arguments
-* =========
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be computed:
-* MODE = 0 means do not change D.
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* IRSIGN (input) INTEGER
-* On entry, if MODE neither -6, 0 nor 6, determines sign of
-* entries of D
-* 0 => leave entries of D unchanged
-* 1 => multiply each entry of D by random complex number
-* uniformly distributed with absolute value 1
-*
-* IDIST (input) CHARACTER*1
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0, 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. The random number generator uses a
-* linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to ZLATM1
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) COMPLEX*16 array, dimension ( MIN( M , N ) )
-* Array to be computed according to MODE, COND and IRSIGN.
-* May be changed on exit if MODE is nonzero.
-*
-* N (input) INTEGER
-* Number of entries of D. Not modified.
-*
-* INFO (output) INTEGER
-* 0 => normal termination
-* -1 => if MODE not in range -6 to 6
-* -2 => if MODE neither -6, 0 nor 6, and
-* IRSIGN neither 0 nor 1
-* -3 => if MODE neither -6, 0 nor 6 and COND less than 1
-* -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 4
-* -7 => if N negative
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatm2.f b/TESTING/MATGEN/zlatm2.f
index c5c2d950..76b0152d 100644
--- a/TESTING/MATGEN/zlatm2.f
+++ b/TESTING/MATGEN/zlatm2.f
@@ -1,9 +1,222 @@
+*> \brief \b ZLATM2
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* COMPLEX*16 FUNCTION ZLATM2( M, N, I, J, KL, KU, IDIST,
+* ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, J, KL, KU, M, N
+* DOUBLE PRECISION SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* COMPLEX*16 D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATM2 returns the (I,J) entry of a random matrix of dimension
+*> (M, N) described by the other paramters. It is called by the
+*> ZLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by ZLATMR which has already checked the parameters.
+*>
+*> Use of ZLATM2 differs from CLATM3 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With ZLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With ZLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, ZLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. ZLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*>
+*> The matrix whose (I,J) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If I is outside (1..M) or J is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0 , 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX*16 array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> 6 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is COMPLEX*16 array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is COMPLEX*16 array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) in position K was originally in
+*> position IWORK( K ).
+*> This differs from IWORK for ZLATM3. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
COMPLEX*16 FUNCTION ZLATM2( M, N, I, J, KL, KU, IDIST,
$ ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK, SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -17,129 +230,6 @@
COMPLEX*16 D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATM2 returns the (I,J) entry of a random matrix of dimension
-* (M, N) described by the other paramters. It is called by the
-* ZLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by ZLATMR which has already checked the parameters.
-*
-* Use of ZLATM2 differs from CLATM3 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With ZLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With ZLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, ZLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. ZLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-*
-* The matrix whose (I,J) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If I is outside (1..M) or J is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of entry to be returned. Not modified.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0 , 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) COMPLEX*16 array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* 6 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) COMPLEX*16 array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) COMPLEX*16 array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (workspace) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) in position K was originally in
-* position IWORK( K ).
-* This differs from IWORK for ZLATM3. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatm3.f b/TESTING/MATGEN/zlatm3.f
index e07ae49e..b3aac8ed 100644
--- a/TESTING/MATGEN/zlatm3.f
+++ b/TESTING/MATGEN/zlatm3.f
@@ -1,10 +1,240 @@
+*> \brief \b ZLATM3
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* COMPLEX*16 FUNCTION ZLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
+* IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
+* SPARSE )
+*
+* .. Scalar Arguments ..
+*
+* INTEGER I, IDIST, IGRADE, IPVTNG, ISUB, J, JSUB, KL,
+* $ KU, M, N
+* DOUBLE PRECISION SPARSE
+* ..
+*
+* .. Array Arguments ..
+*
+* INTEGER ISEED( 4 ), IWORK( * )
+* COMPLEX*16 D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATM3 returns the (ISUB,JSUB) entry of a random matrix of
+*> dimension (M, N) described by the other paramters. (ISUB,JSUB)
+*> is the final position of the (I,J) entry after pivoting
+*> according to IPVTNG and IWORK. ZLATM3 is called by the
+*> ZLATMR routine in order to build random test matrices. No error
+*> checking on parameters is done, because this routine is called in
+*> a tight loop by ZLATMR which has already checked the parameters.
+*>
+*> Use of ZLATM3 differs from CLATM2 in the order in which the random
+*> number generator is called to fill in random matrix entries.
+*> With ZLATM2, the generator is called to fill in the pivoted matrix
+*> columnwise. With ZLATM3, the generator is called to fill in the
+*> matrix columnwise, after which it is pivoted. Thus, ZLATM3 can
+*> be used to construct random matrices which differ only in their
+*> order of rows and/or columns. ZLATM2 is used to construct band
+*> matrices while avoiding calling the random number generator for
+*> entries outside the band (and therefore generating random numbers
+*> in different orders for different pivot orders).
+*>
+*> The matrix whose (ISUB,JSUB) entry is returned is constructed as
+*> follows (this routine only computes one entry):
+*>
+*> If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
+*> (this is convenient for generating matrices in band format).
+*>
+*> Generate a matrix A with random entries of distribution IDIST.
+*>
+*> Set the diagonal to D.
+*>
+*> Grade the matrix, if desired, from the left (by DL) and/or
+*> from the right (by DR or DL) as specified by IGRADE.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> IPVTNG and IWORK.
+*>
+*> Band the matrix to have lower bandwidth KL and upper
+*> bandwidth KU.
+*>
+*> Set random entries to zero as specified by SPARSE.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] I
+*> \verbatim
+*> I is INTEGER
+*> Row of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in] J
+*> \verbatim
+*> J is INTEGER
+*> Column of unpivoted entry to be returned. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISUB
+*> \verbatim
+*> ISUB is INTEGER
+*> Row of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] JSUB
+*> \verbatim
+*> JSUB is INTEGER
+*> Column of pivoted entry to be returned. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> Lower bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> Upper bandwidth. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IDIST
+*> \verbatim
+*> IDIST is INTEGER
+*> On entry, IDIST specifies the type of distribution to be
+*> used to generate a random matrix .
+*> 1 => real and imaginary parts each UNIFORM( 0, 1 )
+*> 2 => real and imaginary parts each UNIFORM( -1, 1 )
+*> 3 => real and imaginary parts each NORMAL( 0, 1 )
+*> 4 => complex number uniform in DISK( 0 , 1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array of dimension ( 4 )
+*> Seed for random number generator.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] D
+*> \verbatim
+*> D is COMPLEX*16 array of dimension ( MIN( I , J ) )
+*> Diagonal entries of matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IGRADE
+*> \verbatim
+*> IGRADE is INTEGER
+*> Specifies grading of matrix as follows:
+*> 0 => no grading
+*> 1 => matrix premultiplied by diag( DL )
+*> 2 => matrix postmultiplied by diag( DR )
+*> 3 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> 4 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> 5 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> 6 => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DL
+*> \verbatim
+*> DL is COMPLEX*16 array ( I or J, as appropriate )
+*> Left scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DR
+*> \verbatim
+*> DR is COMPLEX*16 array ( I or J, as appropriate )
+*> Right scale factors for grading matrix. Not modified.
+*> \endverbatim
+*>
+*> \param[in] IPVTNG
+*> \verbatim
+*> IPVTNG is INTEGER
+*> On entry specifies pivoting permutations as follows:
+*> 0 => none.
+*> 1 => row pivoting.
+*> 2 => column pivoting.
+*> 3 => full pivoting, i.e., on both sides.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] IWORK
+*> \verbatim
+*> IWORK is INTEGER array ( I or J, as appropriate )
+*> This array specifies the permutation used. The
+*> row (or column) originally in position K is in
+*> position IWORK( K ) after pivoting.
+*> This differs from IWORK for ZLATM2. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION between 0. and 1.
+*> On entry specifies the sparsity of the matrix
+*> if sparse matix is to be generated.
+*> SPARSE should lie between 0 and 1.
+*> A uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
COMPLEX*16 FUNCTION ZLATM3( M, N, I, J, ISUB, JSUB, KL, KU,
$ IDIST, ISEED, D, IGRADE, DL, DR, IPVTNG, IWORK,
$ SPARSE )
*
-* -- LAPACK auxiliary test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK auxiliary routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
*
@@ -19,138 +249,6 @@
COMPLEX*16 D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATM3 returns the (ISUB,JSUB) entry of a random matrix of
-* dimension (M, N) described by the other paramters. (ISUB,JSUB)
-* is the final position of the (I,J) entry after pivoting
-* according to IPVTNG and IWORK. ZLATM3 is called by the
-* ZLATMR routine in order to build random test matrices. No error
-* checking on parameters is done, because this routine is called in
-* a tight loop by ZLATMR which has already checked the parameters.
-*
-* Use of ZLATM3 differs from CLATM2 in the order in which the random
-* number generator is called to fill in random matrix entries.
-* With ZLATM2, the generator is called to fill in the pivoted matrix
-* columnwise. With ZLATM3, the generator is called to fill in the
-* matrix columnwise, after which it is pivoted. Thus, ZLATM3 can
-* be used to construct random matrices which differ only in their
-* order of rows and/or columns. ZLATM2 is used to construct band
-* matrices while avoiding calling the random number generator for
-* entries outside the band (and therefore generating random numbers
-* in different orders for different pivot orders).
-*
-* The matrix whose (ISUB,JSUB) entry is returned is constructed as
-* follows (this routine only computes one entry):
-*
-* If ISUB is outside (1..M) or JSUB is outside (1..N), return zero
-* (this is convenient for generating matrices in band format).
-*
-* Generate a matrix A with random entries of distribution IDIST.
-*
-* Set the diagonal to D.
-*
-* Grade the matrix, if desired, from the left (by DL) and/or
-* from the right (by DR or DL) as specified by IGRADE.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* IPVTNG and IWORK.
-*
-* Band the matrix to have lower bandwidth KL and upper
-* bandwidth KU.
-*
-* Set random entries to zero as specified by SPARSE.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of matrix. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of matrix. Not modified.
-*
-* I (input) INTEGER
-* Row of unpivoted entry to be returned. Not modified.
-*
-* J (input) INTEGER
-* Column of unpivoted entry to be returned. Not modified.
-*
-* ISUB (input/output) INTEGER
-* Row of pivoted entry to be returned. Changed on exit.
-*
-* JSUB (input/output) INTEGER
-* Column of pivoted entry to be returned. Changed on exit.
-*
-* KL (input) INTEGER
-* Lower bandwidth. Not modified.
-*
-* KU (input) INTEGER
-* Upper bandwidth. Not modified.
-*
-* IDIST (input) INTEGER
-* On entry, IDIST specifies the type of distribution to be
-* used to generate a random matrix .
-* 1 => real and imaginary parts each UNIFORM( 0, 1 )
-* 2 => real and imaginary parts each UNIFORM( -1, 1 )
-* 3 => real and imaginary parts each NORMAL( 0, 1 )
-* 4 => complex number uniform in DISK( 0 , 1 )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array of dimension ( 4 )
-* Seed for random number generator.
-* Changed on exit.
-*
-* D (input) COMPLEX*16 array of dimension ( MIN( I , J ) )
-* Diagonal entries of matrix. Not modified.
-*
-* IGRADE (input) INTEGER
-* Specifies grading of matrix as follows:
-* 0 => no grading
-* 1 => matrix premultiplied by diag( DL )
-* 2 => matrix postmultiplied by diag( DR )
-* 3 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* 4 => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* 5 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* 6 => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* Not modified.
-*
-* DL (input) COMPLEX*16 array ( I or J, as appropriate )
-* Left scale factors for grading matrix. Not modified.
-*
-* DR (input) COMPLEX*16 array ( I or J, as appropriate )
-* Right scale factors for grading matrix. Not modified.
-*
-* IPVTNG (input) INTEGER
-* On entry specifies pivoting permutations as follows:
-* 0 => none.
-* 1 => row pivoting.
-* 2 => column pivoting.
-* 3 => full pivoting, i.e., on both sides.
-* Not modified.
-*
-* IWORK (input) INTEGER array ( I or J, as appropriate )
-* This array specifies the permutation used. The
-* row (or column) originally in position K is in
-* position IWORK( K ) after pivoting.
-* This differs from IWORK for ZLATM2. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION between 0. and 1.
-* On entry specifies the sparsity of the matrix
-* if sparse matix is to be generated.
-* SPARSE should lie between 0 and 1.
-* A uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatm5.f b/TESTING/MATGEN/zlatm5.f
index a1c0a6ca..6e3ce53d 100644
--- a/TESTING/MATGEN/zlatm5.f
+++ b/TESTING/MATGEN/zlatm5.f
@@ -1,177 +1,292 @@
- SUBROUTINE ZLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
- $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
- $ QBLCKB )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
- $ PRTYPE, QBLCKA, QBLCKB
- DOUBLE PRECISION ALPHA
-* ..
-* .. Array Arguments ..
- COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * ),
- $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
- $ L( LDL, * ), R( LDR, * )
-* ..
-*
+*> \brief \b ZLATM5
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+* E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+* QBLCKB )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+* $ PRTYPE, QBLCKA, QBLCKB
+* DOUBLE PRECISION ALPHA
+* ..
+* .. Array Arguments ..
+* COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * ),
+* $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+* $ L( LDL, * ), R( LDR, * )
+* ..
+*
* Purpose
* =======
*
-* ZLATM5 generates matrices involved in the Generalized Sylvester
-* equation:
-*
-* A * R - L * B = C
-* D * R - L * E = F
-*
-* They also satisfy (the diagonalization condition)
-*
-* [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
-* [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
-*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATM5 generates matrices involved in the Generalized Sylvester
+*> equation:
+*>
+*> A * R - L * B = C
+*> D * R - L * E = F
+*>
+*> They also satisfy (the diagonalization condition)
+*>
+*> [ I -L ] ( [ A -C ], [ D -F ] ) [ I R ] = ( [ A ], [ D ] )
+*> [ I ] ( [ B ] [ E ] ) [ I ] ( [ B ] [ E ] )
+*>
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* PRTYPE (input) INTEGER
-* "Points" to a certian type of the matrices to generate
-* (see futher details).
-*
-* M (input) INTEGER
-* Specifies the order of A and D and the number of rows in
-* C, F, R and L.
-*
-* N (input) INTEGER
-* Specifies the order of B and E and the number of columns in
-* C, F, R and L.
-*
-* A (output) COMPLEX*16 array, dimension (LDA, M).
-* On exit A M-by-M is initialized according to PRTYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A.
-*
-* B (output) COMPLEX*16 array, dimension (LDB, N).
-* On exit B N-by-N is initialized according to PRTYPE.
-*
-* LDB (input) INTEGER
-* The leading dimension of B.
-*
-* C (output) COMPLEX*16 array, dimension (LDC, N).
-* On exit C M-by-N is initialized according to PRTYPE.
-*
-* LDC (input) INTEGER
-* The leading dimension of C.
-*
-* D (output) COMPLEX*16 array, dimension (LDD, M).
-* On exit D M-by-M is initialized according to PRTYPE.
-*
-* LDD (input) INTEGER
-* The leading dimension of D.
-*
-* E (output) COMPLEX*16 array, dimension (LDE, N).
-* On exit E N-by-N is initialized according to PRTYPE.
-*
-* LDE (input) INTEGER
-* The leading dimension of E.
-*
-* F (output) COMPLEX*16 array, dimension (LDF, N).
-* On exit F M-by-N is initialized according to PRTYPE.
-*
-* LDF (input) INTEGER
-* The leading dimension of F.
-*
-* R (output) COMPLEX*16 array, dimension (LDR, N).
-* On exit R M-by-N is initialized according to PRTYPE.
-*
-* LDR (input) INTEGER
-* The leading dimension of R.
-*
-* L (output) COMPLEX*16 array, dimension (LDL, N).
-* On exit L M-by-N is initialized according to PRTYPE.
-*
-* LDL (input) INTEGER
-* The leading dimension of L.
+*> \param[in] PRTYPE
+*> \verbatim
+*> PRTYPE is INTEGER
+*> "Points" to a certian type of the matrices to generate
+*> (see futher details).
+*> \endverbatim
+*>
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Specifies the order of A and D and the number of rows in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Specifies the order of B and E and the number of columns in
+*> C, F, R and L.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA, M).
+*> On exit A M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is COMPLEX*16 array, dimension (LDB, N).
+*> On exit B N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> The leading dimension of B.
+*> \endverbatim
+*>
+*> \param[out] C
+*> \verbatim
+*> C is COMPLEX*16 array, dimension (LDC, N).
+*> On exit C M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDC
+*> \verbatim
+*> LDC is INTEGER
+*> The leading dimension of C.
+*> \endverbatim
+*>
+*> \param[out] D
+*> \verbatim
+*> D is COMPLEX*16 array, dimension (LDD, M).
+*> On exit D M-by-M is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDD
+*> \verbatim
+*> LDD is INTEGER
+*> The leading dimension of D.
+*> \endverbatim
+*>
+*> \param[out] E
+*> \verbatim
+*> E is COMPLEX*16 array, dimension (LDE, N).
+*> On exit E N-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDE
+*> \verbatim
+*> LDE is INTEGER
+*> The leading dimension of E.
+*> \endverbatim
+*>
+*> \param[out] F
+*> \verbatim
+*> F is COMPLEX*16 array, dimension (LDF, N).
+*> On exit F M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDF
+*> \verbatim
+*> LDF is INTEGER
+*> The leading dimension of F.
+*> \endverbatim
+*>
+*> \param[out] R
+*> \verbatim
+*> R is COMPLEX*16 array, dimension (LDR, N).
+*> On exit R M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDR
+*> \verbatim
+*> LDR is INTEGER
+*> The leading dimension of R.
+*> \endverbatim
+*>
+*> \param[out] L
+*> \verbatim
+*> L is COMPLEX*16 array, dimension (LDL, N).
+*> On exit L M-by-N is initialized according to PRTYPE.
+*> \endverbatim
+*>
+*> \param[in] LDL
+*> \verbatim
+*> LDL is INTEGER
+*> The leading dimension of L.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is DOUBLE PRECISION
+*> Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \endverbatim
+*>
+*> \param[in] QBLCKA
+*> \verbatim
+*> QBLCKA is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in A. Otherwise, QBLCKA is not
+*> referenced. QBLCKA > 1.
+*> \endverbatim
+*>
+*> \param[in] QBLCKB
+*> \verbatim
+*> QBLCKB is INTEGER
+*> When PRTYPE = 3, specifies the distance between 2-by-2
+*> blocks on the diagonal in B. Otherwise, QBLCKB is not
+*> referenced. QBLCKB > 1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* ALPHA (input) DOUBLE PRECISION
-* Parameter used in generating PRTYPE = 1 and 5 matrices.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* QBLCKA (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in A. Otherwise, QBLCKA is not
-* referenced. QBLCKA > 1.
+*> \date November 2011
*
-* QBLCKB (input) INTEGER
-* When PRTYPE = 3, specifies the distance between 2-by-2
-* blocks on the diagonal in B. Otherwise, QBLCKB is not
-* referenced. QBLCKB > 1.
+*> \ingroup complex16_matgen
*
*
* Further Details
* ===============
+*>\details \b Further \b Details
+*> \verbatim
+*>
+*> PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
+*>
+*> A : if (i == j) then A(i, j) = 1.0
+*> if (j == i + 1) then A(i, j) = -1.0
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> B : if (i == j) then B(i, j) = 1.0 - ALPHA
+*> if (j == i + 1) then B(i, j) = 1.0
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> D : if (i == j) then D(i, j) = 1.0
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*> E : if (i == j) then E(i, j) = 1.0
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L = R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
+*>
+*> A : if (i <= j) then A(i, j) = [-1...1]
+*> else A(i, j) = 0.0, i, j = 1...M
+*>
+*> if (PRTYPE = 3) then
+*> A(k + 1, k + 1) = A(k, k)
+*> A(k + 1, k) = [-1...1]
+*> sign(A(k, k + 1) = -(sin(A(k + 1, k))
+*> k = 1, M - 1, QBLCKA
+*>
+*> B : if (i <= j) then B(i, j) = [-1...1]
+*> else B(i, j) = 0.0, i, j = 1...N
+*>
+*> if (PRTYPE = 3) then
+*> B(k + 1, k + 1) = B(k, k)
+*> B(k + 1, k) = [-1...1]
+*> sign(B(k, k + 1) = -(sign(B(k + 1, k))
+*> k = 1, N - 1, QBLCKB
+*>
+*> D : if (i <= j) then D(i, j) = [-1...1].
+*> else D(i, j) = 0.0, i, j = 1...M
+*>
+*>
+*> E : if (i <= j) then D(i, j) = [-1...1]
+*> else E(i, j) = 0.0, i, j = 1...N
+*>
+*> L, R are chosen from [-10...10],
+*> which specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 4 Full
+*> A(i, j) = [-10...10]
+*> D(i, j) = [-1...1] i,j = 1...M
+*> B(i, j) = [-10...10]
+*> E(i, j) = [-1...1] i,j = 1...N
+*> R(i, j) = [-10...10]
+*> L(i, j) = [-1...1] i = 1..M ,j = 1...N
+*>
+*> L, R specifies the right hand sides (C, F).
+*>
+*> PRTYPE = 5 special case common and/or close eigs.
+*>
+*> \endverbatim
+*>
+* =====================================================================
+ SUBROUTINE ZLATM5( PRTYPE, M, N, A, LDA, B, LDB, C, LDC, D, LDD,
+ $ E, LDE, F, LDF, R, LDR, L, LDL, ALPHA, QBLCKA,
+ $ QBLCKB )
*
-* PRTYPE = 1: A and B are Jordan blocks, D and E are identity matrices
-*
-* A : if (i == j) then A(i, j) = 1.0
-* if (j == i + 1) then A(i, j) = -1.0
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* B : if (i == j) then B(i, j) = 1.0 - ALPHA
-* if (j == i + 1) then B(i, j) = 1.0
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* D : if (i == j) then D(i, j) = 1.0
-* else D(i, j) = 0.0, i, j = 1...M
-*
-* E : if (i == j) then E(i, j) = 1.0
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L = R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 2 or 3: Triangular and/or quasi- triangular.
-*
-* A : if (i <= j) then A(i, j) = [-1...1]
-* else A(i, j) = 0.0, i, j = 1...M
-*
-* if (PRTYPE = 3) then
-* A(k + 1, k + 1) = A(k, k)
-* A(k + 1, k) = [-1...1]
-* sign(A(k, k + 1) = -(sin(A(k + 1, k))
-* k = 1, M - 1, QBLCKA
-*
-* B : if (i <= j) then B(i, j) = [-1...1]
-* else B(i, j) = 0.0, i, j = 1...N
-*
-* if (PRTYPE = 3) then
-* B(k + 1, k + 1) = B(k, k)
-* B(k + 1, k) = [-1...1]
-* sign(B(k, k + 1) = -(sign(B(k + 1, k))
-* k = 1, N - 1, QBLCKB
-*
-* D : if (i <= j) then D(i, j) = [-1...1].
-* else D(i, j) = 0.0, i, j = 1...M
-*
-*
-* E : if (i <= j) then D(i, j) = [-1...1]
-* else E(i, j) = 0.0, i, j = 1...N
-*
-* L, R are chosen from [-10...10],
-* which specifies the right hand sides (C, F).
-*
-* PRTYPE = 4 Full
-* A(i, j) = [-10...10]
-* D(i, j) = [-1...1] i,j = 1...M
-* B(i, j) = [-10...10]
-* E(i, j) = [-1...1] i,j = 1...N
-* R(i, j) = [-10...10]
-* L(i, j) = [-1...1] i = 1..M ,j = 1...N
-*
-* L, R specifies the right hand sides (C, F).
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* PRTYPE = 5 special case common and/or close eigs.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDB, LDC, LDD, LDE, LDF, LDL, LDR, M, N,
+ $ PRTYPE, QBLCKA, QBLCKB
+ DOUBLE PRECISION ALPHA
+* ..
+* .. Array Arguments ..
+ COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * ),
+ $ D( LDD, * ), E( LDE, * ), F( LDF, * ),
+ $ L( LDL, * ), R( LDR, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlatm6.f b/TESTING/MATGEN/zlatm6.f
index 6dd7241d..04a52d8b 100644
--- a/TESTING/MATGEN/zlatm6.f
+++ b/TESTING/MATGEN/zlatm6.f
@@ -1,105 +1,195 @@
- SUBROUTINE ZLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
- $ BETA, WX, WY, S, DIF )
-*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* November 2006
-*
-* .. Scalar Arguments ..
- INTEGER LDA, LDX, LDY, N, TYPE
- COMPLEX*16 ALPHA, BETA, WX, WY
-* ..
-* .. Array Arguments ..
- DOUBLE PRECISION DIF( * ), S( * )
- COMPLEX*16 A( LDA, * ), B( LDA, * ), X( LDX, * ),
- $ Y( LDY, * )
-* ..
-*
+*> \brief \b ZLATM6
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+* BETA, WX, WY, S, DIF )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDX, LDY, N, TYPE
+* COMPLEX*16 ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION DIF( * ), S( * )
+* COMPLEX*16 A( LDA, * ), B( LDA, * ), X( LDX, * ),
+* $ Y( LDY, * )
+* ..
+*
* Purpose
* =======
*
-* ZLATM6 generates test matrices for the generalized eigenvalue
-* problem, their corresponding right and left eigenvector matrices,
-* and also reciprocal condition numbers for all eigenvalues and
-* the reciprocal condition numbers of eigenvectors corresponding to
-* the 1th and 5th eigenvalues.
-*
-* Test Matrices
-* =============
-*
-* Two kinds of test matrix pairs
-* (A, B) = inverse(YH) * (Da, Db) * inverse(X)
-* are used in the tests:
-*
-* Type 1:
-* Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
-* 0 2+a 0 0 0 0 1 0 0 0
-* 0 0 3+a 0 0 0 0 1 0 0
-* 0 0 0 4+a 0 0 0 0 1 0
-* 0 0 0 0 5+a , 0 0 0 0 1
-* and Type 2:
-* Da = 1+i 0 0 0 0 Db = 1 0 0 0 0
-* 0 1-i 0 0 0 0 1 0 0 0
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 (1+a)+(1+b)i 0 0 0 0 1 0
-* 0 0 0 0 (1+a)-(1+b)i, 0 0 0 0 1 .
-*
-* In both cases the same inverse(YH) and inverse(X) are used to compute
-* (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
-*
-* YH: = 1 0 -y y -y X = 1 0 -x -x x
-* 0 1 -y y -y 0 1 x -x -x
-* 0 0 1 0 0 0 0 1 0 0
-* 0 0 0 1 0 0 0 0 1 0
-* 0 0 0 0 1, 0 0 0 0 1 , where
-*
-* a, b, x and y will have all values independently of each other.
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATM6 generates test matrices for the generalized eigenvalue
+*> problem, their corresponding right and left eigenvector matrices,
+*> and also reciprocal condition numbers for all eigenvalues and
+*> the reciprocal condition numbers of eigenvectors corresponding to
+*> the 1th and 5th eigenvalues.
+*>
+*> Test Matrices
+*> =============
+*>
+*> Two kinds of test matrix pairs
+*> (A, B) = inverse(YH) * (Da, Db) * inverse(X)
+*> are used in the tests:
+*>
+*> Type 1:
+*> Da = 1+a 0 0 0 0 Db = 1 0 0 0 0
+*> 0 2+a 0 0 0 0 1 0 0 0
+*> 0 0 3+a 0 0 0 0 1 0 0
+*> 0 0 0 4+a 0 0 0 0 1 0
+*> 0 0 0 0 5+a , 0 0 0 0 1
+*> and Type 2:
+*> Da = 1+i 0 0 0 0 Db = 1 0 0 0 0
+*> 0 1-i 0 0 0 0 1 0 0 0
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 (1+a)+(1+b)i 0 0 0 0 1 0
+*> 0 0 0 0 (1+a)-(1+b)i, 0 0 0 0 1 .
+*>
+*> In both cases the same inverse(YH) and inverse(X) are used to compute
+*> (A, B), giving the exact eigenvectors to (A,B) as (YH, X):
+*>
+*> YH: = 1 0 -y y -y X = 1 0 -x -x x
+*> 0 1 -y y -y 0 1 x -x -x
+*> 0 0 1 0 0 0 0 1 0 0
+*> 0 0 0 1 0 0 0 0 1 0
+*> 0 0 0 0 1, 0 0 0 0 1 , where
+*>
+*> a, b, x and y will have all values independently of each other.
+*>
+*>\endverbatim
*
* Arguments
* =========
*
-* TYPE (input) INTEGER
-* Specifies the problem type (see futher details).
-*
-* N (input) INTEGER
-* Size of the matrices A and B.
-*
-* A (output) COMPLEX*16 array, dimension (LDA, N).
-* On exit A N-by-N is initialized according to TYPE.
-*
-* LDA (input) INTEGER
-* The leading dimension of A and of B.
-*
-* B (output) COMPLEX*16 array, dimension (LDA, N).
-* On exit B N-by-N is initialized according to TYPE.
-*
-* X (output) COMPLEX*16 array, dimension (LDX, N).
-* On exit X is the N-by-N matrix of right eigenvectors.
-*
-* LDX (input) INTEGER
-* The leading dimension of X.
-*
-* Y (output) COMPLEX*16 array, dimension (LDY, N).
-* On exit Y is the N-by-N matrix of left eigenvectors.
+*> \param[in] TYPE
+*> \verbatim
+*> TYPE is INTEGER
+*> Specifies the problem type (see futher details).
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Size of the matrices A and B.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA, N).
+*> On exit A N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> The leading dimension of A and of B.
+*> \endverbatim
+*>
+*> \param[out] B
+*> \verbatim
+*> B is COMPLEX*16 array, dimension (LDA, N).
+*> On exit B N-by-N is initialized according to TYPE.
+*> \endverbatim
+*>
+*> \param[out] X
+*> \verbatim
+*> X is COMPLEX*16 array, dimension (LDX, N).
+*> On exit X is the N-by-N matrix of right eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDX
+*> \verbatim
+*> LDX is INTEGER
+*> The leading dimension of X.
+*> \endverbatim
+*>
+*> \param[out] Y
+*> \verbatim
+*> Y is COMPLEX*16 array, dimension (LDY, N).
+*> On exit Y is the N-by-N matrix of left eigenvectors.
+*> \endverbatim
+*>
+*> \param[in] LDY
+*> \verbatim
+*> LDY is INTEGER
+*> The leading dimension of Y.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is COMPLEX*16
+*> \endverbatim
+*>
+*> \param[in] BETA
+*> \verbatim
+*> BETA is COMPLEX*16
+*> \verbatim
+*> Weighting constants for matrix A.
+*> \endverbatim
+*>
+*> \param[in] WX
+*> \verbatim
+*> WX is COMPLEX*16
+*> Constant for right eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[in] WY
+*> \verbatim
+*> WY is COMPLEX*16
+*> Constant for left eigenvector matrix.
+*> \endverbatim
+*>
+*> \param[out] S
+*> \verbatim
+*> S is DOUBLE PRECISION array, dimension (N)
+*> S(i) is the reciprocal condition number for eigenvalue i.
+*> \endverbatim
+*>
+*> \param[out] DIF
+*> \verbatim
+*> DIF is DOUBLE PRECISION array, dimension (N)
+*> DIF(i) is the reciprocal condition number for eigenvector i.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
*
-* LDY (input) INTEGER
-* The leading dimension of Y.
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
*
-* ALPHA (input) COMPLEX*16
-* BETA (input) COMPLEX*16
-* Weighting constants for matrix A.
+*> \date November 2011
*
-* WX (input) COMPLEX*16
-* Constant for right eigenvector matrix.
+*> \ingroup complex16_matgen
*
-* WY (input) COMPLEX*16
-* Constant for left eigenvector matrix.
+* =====================================================================
+ SUBROUTINE ZLATM6( TYPE, N, A, LDA, B, X, LDX, Y, LDY, ALPHA,
+ $ BETA, WX, WY, S, DIF )
*
-* S (output) DOUBLE PRECISION array, dimension (N)
-* S(i) is the reciprocal condition number for eigenvalue i.
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
-* DIF (output) DOUBLE PRECISION array, dimension (N)
-* DIF(i) is the reciprocal condition number for eigenvector i.
+* .. Scalar Arguments ..
+ INTEGER LDA, LDX, LDY, N, TYPE
+ COMPLEX*16 ALPHA, BETA, WX, WY
+* ..
+* .. Array Arguments ..
+ DOUBLE PRECISION DIF( * ), S( * )
+ COMPLEX*16 A( LDA, * ), B( LDA, * ), X( LDX, * ),
+ $ Y( LDY, * )
+* ..
*
* =====================================================================
*
diff --git a/TESTING/MATGEN/zlatme.f b/TESTING/MATGEN/zlatme.f
index 0063b06c..51dbb2d1 100644
--- a/TESTING/MATGEN/zlatme.f
+++ b/TESTING/MATGEN/zlatme.f
@@ -1,12 +1,312 @@
+*> \brief \b ZLATME
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATME( N, DIST, ISEED, D, MODE, COND, DMAX,
+* RSIGN,
+* UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
+* A,
+* LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, RSIGN, SIM, UPPER
+* INTEGER INFO, KL, KU, LDA, MODE, MODES, N
+* DOUBLE PRECISION ANORM, COND, CONDS
+* COMPLEX*16 DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION DS( * )
+* COMPLEX*16 A( LDA, * ), D( * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATME generates random non-symmetric square matrices with
+*> specified eigenvalues for testing LAPACK programs.
+*>
+*> ZLATME operates by applying the following sequence of
+*> operations:
+*>
+*> 1. Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and RSIGN
+*> as described below.
+*>
+*> 2. If UPPER='T', the upper triangle of A is set to random values
+*> out of distribution DIST.
+*>
+*> 3. If SIM='T', A is multiplied on the left by a random matrix
+*> X, whose singular values are specified by DS, MODES, and
+*> CONDS, and on the right by X inverse.
+*>
+*> 4. If KL < N-1, the lower bandwidth is reduced to KL using
+*> Householder transformations. If KU < N-1, the upper
+*> bandwidth is reduced to KU.
+*>
+*> 5. If ANORM is not negative, the matrix is scaled to have
+*> maximum-element-norm ANORM.
+*>
+*> (Note: since the matrix cannot be reduced beyond Hessenberg form,
+*> no packing options are available.)
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns (or rows) of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values, and on the
+*> upper triangle (see UPPER).
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> 'D' => uniform on the complex disc |z| < 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to ZLATME
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX*16 array, dimension ( N )
+*> This array is used to specify the eigenvalues of A. If
+*> MODE=0, then D is assumed to contain the eigenvalues
+*> otherwise they will be computed according to MODE, COND,
+*> DMAX, and RSIGN and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is between 1 and 4, D has entries ranging
+*> from 1 to 1/COND, if between -1 and -4, D has entries
+*> ranging from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is COMPLEX*16
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))). Note that DMAX need not be
+*> positive or real: if DMAX is negative or complex (or zero),
+*> D will be scaled by a negative or complex number (or zero).
+*> If RSIGN='F' then the largest (absolute) eigenvalue will be
+*> equal to DMAX.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE is not 0, 6, or -6, and RSIGN='T', then the
+*> elements of D, as computed according to MODE and COND, will
+*> be multiplied by a random complex number from the unit
+*> circle |z| = 1. If RSIGN='F', they will not be. RSIGN may
+*> only have the values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] UPPER
+*> \verbatim
+*> UPPER is CHARACTER*1
+*> If UPPER='T', then the elements of A above the diagonal
+*> will be set to random numbers out of DIST. If UPPER='F',
+*> they will not. UPPER may only have the values 'T' or 'F'.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] SIM
+*> \verbatim
+*> SIM is CHARACTER*1
+*> If SIM='T', then A will be operated on by a "similarity
+*> transform", i.e., multiplied on the left by a matrix X and
+*> on the right by X inverse. X = U S V, where U and V are
+*> random unitary matrices and S is a (diagonal) matrix of
+*> singular values specified by DS, MODES, and CONDS. If
+*> SIM='F', then A will not be transformed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DS
+*> \verbatim
+*> DS is DOUBLE PRECISION array, dimension ( N )
+*> This array is used to specify the singular values of X,
+*> in the same way that D specifies the eigenvalues of A.
+*> If MODE=0, the DS contains the singular values, which
+*> may not be zero.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODES
+*> \verbatim
+*> MODES is INTEGER
+*> \endverbatim
+*>
+*> \param[in] CONDS
+*> \verbatim
+*> CONDS is DOUBLE PRECISION
+*> Similar to MODE and COND, but for specifying the diagonal
+*> of S. MODES=-6 and +6 are not allowed (since they would
+*> result in randomly ill-conditioned eigenvalues.)
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. KL=1
+*> specifies upper Hessenberg form. If KL is at least N-1,
+*> then A will have full lower bandwidth.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. KU=1
+*> specifies lower Hessenberg form. If KU is at least N-1,
+*> then A will have full upper bandwidth; if KU and KL
+*> are both at least N-1, then A will be dense. Only one of
+*> KU and KL may be less than N-1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is DOUBLE PRECISION
+*> If ANORM is not negative, then A will be scaled by a non-
+*> negative real number to make the maximum-element-norm of A
+*> to be ANORM.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension ( LDA, N )
+*> On exit A is the desired test matrix.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. LDA must be at least M.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension ( 3*N )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => N negative
+*> -2 => DIST illegal string
+*> -5 => MODE not in range -6 to 6
+*> -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -9 => RSIGN is not 'T' or 'F'
+*> -10 => UPPER is not 'T' or 'F'
+*> -11 => SIM is not 'T' or 'F'
+*> -12 => MODES=0 and DS has a zero singular value.
+*> -13 => MODES is not in the range -5 to 5.
+*> -14 => MODES is nonzero and CONDS is less than 1.
+*> -15 => KL is less than 1.
+*> -16 => KU is less than 1, or KL and KU are both less than
+*> N-1.
+*> -19 => LDA is less than M.
+*> 1 => Error return from ZLATM1 (computing D)
+*> 2 => Cannot scale to DMAX (max. eigenvalue is 0)
+*> 3 => Error return from DLATM1 (computing DS)
+*> 4 => Error return from ZLARGE
+*> 5 => Zero singular value from DLATM1.
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLATME( N, DIST, ISEED, D, MODE, COND, DMAX,
$ RSIGN,
$ UPPER, SIM, DS, MODES, CONDS, KL, KU, ANORM,
$ A,
$ LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, RSIGN, SIM, UPPER
@@ -20,198 +320,6 @@
COMPLEX*16 A( LDA, * ), D( * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATME generates random non-symmetric square matrices with
-* specified eigenvalues for testing LAPACK programs.
-*
-* ZLATME operates by applying the following sequence of
-* operations:
-*
-* 1. Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and RSIGN
-* as described below.
-*
-* 2. If UPPER='T', the upper triangle of A is set to random values
-* out of distribution DIST.
-*
-* 3. If SIM='T', A is multiplied on the left by a random matrix
-* X, whose singular values are specified by DS, MODES, and
-* CONDS, and on the right by X inverse.
-*
-* 4. If KL < N-1, the lower bandwidth is reduced to KL using
-* Householder transformations. If KU < N-1, the upper
-* bandwidth is reduced to KU.
-*
-* 5. If ANORM is not negative, the matrix is scaled to have
-* maximum-element-norm ANORM.
-*
-* (Note: since the matrix cannot be reduced beyond Hessenberg form,
-* no packing options are available.)
-*
-* Arguments
-* =========
-*
-* N (input) INTEGER
-* The number of columns (or rows) of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values, and on the
-* upper triangle (see UPPER).
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* 'D' => uniform on the complex disc |z| < 1.
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to ZLATME
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* D (input/output) COMPLEX*16 array, dimension ( N )
-* This array is used to specify the eigenvalues of A. If
-* MODE=0, then D is assumed to contain the eigenvalues
-* otherwise they will be computed according to MODE, COND,
-* DMAX, and RSIGN and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is between 1 and 4, D has entries ranging
-* from 1 to 1/COND, if between -1 and -4, D has entries
-* ranging from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) COMPLEX*16
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))). Note that DMAX need not be
-* positive or real: if DMAX is negative or complex (or zero),
-* D will be scaled by a negative or complex number (or zero).
-* If RSIGN='F' then the largest (absolute) eigenvalue will be
-* equal to DMAX.
-* Not modified.
-*
-* RSIGN (input) CHARACTER*1
-* If MODE is not 0, 6, or -6, and RSIGN='T', then the
-* elements of D, as computed according to MODE and COND, will
-* be multiplied by a random complex number from the unit
-* circle |z| = 1. If RSIGN='F', they will not be. RSIGN may
-* only have the values 'T' or 'F'.
-* Not modified.
-*
-* UPPER (input) CHARACTER*1
-* If UPPER='T', then the elements of A above the diagonal
-* will be set to random numbers out of DIST. If UPPER='F',
-* they will not. UPPER may only have the values 'T' or 'F'.
-* Not modified.
-*
-* SIM (input) CHARACTER*1
-* If SIM='T', then A will be operated on by a "similarity
-* transform", i.e., multiplied on the left by a matrix X and
-* on the right by X inverse. X = U S V, where U and V are
-* random unitary matrices and S is a (diagonal) matrix of
-* singular values specified by DS, MODES, and CONDS. If
-* SIM='F', then A will not be transformed.
-* Not modified.
-*
-* DS (input/output) DOUBLE PRECISION array, dimension ( N )
-* This array is used to specify the singular values of X,
-* in the same way that D specifies the eigenvalues of A.
-* If MODE=0, the DS contains the singular values, which
-* may not be zero.
-* Modified if MODE is nonzero.
-*
-* MODES (input) INTEGER
-*
-* CONDS (input) DOUBLE PRECISION
-* Similar to MODE and COND, but for specifying the diagonal
-* of S. MODES=-6 and +6 are not allowed (since they would
-* result in randomly ill-conditioned eigenvalues.)
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. KL=1
-* specifies upper Hessenberg form. If KL is at least N-1,
-* then A will have full lower bandwidth.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. KU=1
-* specifies lower Hessenberg form. If KU is at least N-1,
-* then A will have full upper bandwidth; if KU and KL
-* are both at least N-1, then A will be dense. Only one of
-* KU and KL may be less than N-1.
-* Not modified.
-*
-* ANORM (input) DOUBLE PRECISION
-* If ANORM is not negative, then A will be scaled by a non-
-* negative real number to make the maximum-element-norm of A
-* to be ANORM.
-* Not modified.
-*
-* A (output) COMPLEX*16 array, dimension ( LDA, N )
-* On exit A is the desired test matrix.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. LDA must be at least M.
-* Not modified.
-*
-* WORK (workspace) COMPLEX*16 array, dimension ( 3*N )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => N negative
-* -2 => DIST illegal string
-* -5 => MODE not in range -6 to 6
-* -6 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -9 => RSIGN is not 'T' or 'F'
-* -10 => UPPER is not 'T' or 'F'
-* -11 => SIM is not 'T' or 'F'
-* -12 => MODES=0 and DS has a zero singular value.
-* -13 => MODES is not in the range -5 to 5.
-* -14 => MODES is nonzero and CONDS is less than 1.
-* -15 => KL is less than 1.
-* -16 => KU is less than 1, or KL and KU are both less than
-* N-1.
-* -19 => LDA is less than M.
-* 1 => Error return from ZLATM1 (computing D)
-* 2 => Cannot scale to DMAX (max. eigenvalue is 0)
-* 3 => Error return from DLATM1 (computing DS)
-* 4 => Error return from ZLARGE
-* 5 => Zero singular value from DLATM1.
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatmr.f b/TESTING/MATGEN/zlatmr.f
index 5c2e4f34..5fd1accb 100644
--- a/TESTING/MATGEN/zlatmr.f
+++ b/TESTING/MATGEN/zlatmr.f
@@ -1,11 +1,504 @@
+*> \brief \b ZLATMR
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
+* CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
+* PACK, A, LDA, IWORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, MODEL, MODER, N
+* DOUBLE PRECISION ANORM, COND, CONDL, CONDR, SPARSE
+* COMPLEX*16 DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER IPIVOT( * ), ISEED( 4 ), IWORK( * )
+* COMPLEX*16 A( LDA, * ), D( * ), DL( * ), DR( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATMR generates random matrices of various types for testing
+*> LAPACK programs.
+*>
+*> ZLATMR operates by applying the following sequence of
+*> operations:
+*>
+*> Generate a matrix A with random entries of distribution DIST
+*> which is symmetric if SYM='S', Hermitian if SYM='H', and
+*> nonsymmetric if SYM='N'.
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX and RSIGN
+*> as described below.
+*>
+*> Grade the matrix, if desired, from the left and/or right
+*> as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
+*> MODER and CONDR also determine the grading as described
+*> below.
+*>
+*> Permute, if desired, the rows and/or columns as specified by
+*> PIVTNG and IPIVOT.
+*>
+*> Set random entries to zero, if desired, to get a random sparse
+*> matrix as specified by SPARSE.
+*>
+*> Make A a band matrix, if desired, by zeroing out the matrix
+*> outside a band of lower bandwidth KL and upper bandwidth KU.
+*>
+*> Scale A, if desired, to have maximum entry ANORM.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if symmetric or Hermitian)
+*> zero out lower half (if symmetric or Hermitian)
+*> store the upper half columnwise (if symmetric or Hermitian
+*> or square upper triangular)
+*> store the lower half columnwise (if symmetric or Hermitian
+*> or square lower triangular)
+*> same as upper half rowwise if symmetric
+*> same as conjugate upper half rowwise if Hermitian
+*> store the lower triangle in banded format
+*> (if symmetric or Hermitian)
+*> store the upper triangle in banded format
+*> (if symmetric or Hermitian)
+*> store the entire matrix in banded format
+*>
+*> Note: If two calls to ZLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*>
+*> If two calls to ZLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be and
+*> is not maintained with less than full bandwidth.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> Number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> Number of columns of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate a random matrix .
+*> 'U' => real and imaginary parts are independent
+*> UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => real and imaginary parts are independent
+*> UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => real and imaginary parts are independent
+*> NORMAL( 0, 1 ) ( 'N' for normal )
+*> 'D' => uniform on interior of unit disk ( 'D' for disk )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension (4)
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to ZLATMR
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='S', generated matrix is symmetric.
+*> If SYM='H', generated matrix is Hermitian.
+*> If SYM='N', generated matrix is nonsymmetric.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is COMPLEX*16 array, dimension (min(M,N))
+*> On entry this array specifies the diagonal entries
+*> of the diagonal of A. D may either be specified
+*> on entry, or set according to MODE and COND as described
+*> below. If the matrix is Hermitian, the real part of D
+*> will be taken. May be changed on exit if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry describes how D is to be used:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is COMPLEX*16
+*> If MODE neither -6, 0 nor 6, the diagonal is scaled by
+*> DMAX / max(abs(D(i))), so that maximum absolute entry
+*> of diagonal is abs(DMAX). If DMAX is complex (or zero),
+*> diagonal will be scaled by a complex number (or zero).
+*> \endverbatim
+*>
+*> \param[in] RSIGN
+*> \verbatim
+*> RSIGN is CHARACTER*1
+*> If MODE neither -6, 0 nor 6, specifies sign of diagonal
+*> as follows:
+*> 'T' => diagonal entries are multiplied by a random complex
+*> number uniformly distributed with absolute value 1
+*> 'F' => diagonal unchanged
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] GRADE
+*> \verbatim
+*> GRADE is CHARACTER*1
+*> Specifies grading of matrix as follows:
+*> 'N' => no grading
+*> 'L' => matrix premultiplied by diag( DL )
+*> (only if matrix nonsymmetric)
+*> 'R' => matrix postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'B' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DR )
+*> (only if matrix nonsymmetric)
+*> 'H' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( CONJG(DL) )
+*> (only if matrix Hermitian or nonsymmetric)
+*> 'S' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by diag( DL )
+*> (only if matrix symmetric or nonsymmetric)
+*> 'E' => matrix premultiplied by diag( DL ) and
+*> postmultiplied by inv( diag( DL ) )
+*> ( 'S' for similarity )
+*> (only if matrix nonsymmetric)
+*> Note: if GRADE='S', then M must equal N.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DL
+*> \verbatim
+*> DL is COMPLEX*16 array, dimension (M)
+*> If MODEL=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODEL is not zero, then DL will be set according
+*> to MODEL and CONDL, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DL).
+*> If GRADE='E', then DL cannot have zero entries.
+*> Not referenced if GRADE = 'N' or 'R'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODEL
+*> \verbatim
+*> MODEL is INTEGER
+*> This specifies how the diagonal array DL is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDL
+*> \verbatim
+*> CONDL is DOUBLE PRECISION
+*> When MODEL is not zero, this specifies the condition number
+*> of the computed DL. Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] DR
+*> \verbatim
+*> DR is COMPLEX*16 array, dimension (N)
+*> If MODER=0, then on entry this array specifies the diagonal
+*> entries of a diagonal matrix used as described under GRADE
+*> above. If MODER is not zero, then DR will be set according
+*> to MODER and CONDR, analogous to the way D is set according
+*> to MODE and COND (except there is no DMAX parameter for DR).
+*> Not referenced if GRADE = 'N', 'L', 'H' or 'S'.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] MODER
+*> \verbatim
+*> MODER is INTEGER
+*> This specifies how the diagonal array DR is to be computed,
+*> just as MODE specifies how D is to be computed.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] CONDR
+*> \verbatim
+*> CONDR is DOUBLE PRECISION
+*> When MODER is not zero, this specifies the condition number
+*> of the computed DR. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PIVTNG
+*> \verbatim
+*> PIVTNG is CHARACTER*1
+*> On entry specifies pivoting permutations as follows:
+*> 'N' or ' ' => none.
+*> 'L' => left or row pivoting (matrix must be nonsymmetric).
+*> 'R' => right or column pivoting (matrix must be
+*> nonsymmetric).
+*> 'B' or 'F' => both or full pivoting, i.e., on both sides.
+*> In this case, M must equal N
+*> \endverbatim
+*> \verbatim
+*> If two calls to ZLATMR both have full bandwidth (KL = M-1
+*> and KU = N-1), and differ only in the PIVTNG and PACK
+*> parameters, then the matrices generated will differ only
+*> in the order of the rows and/or columns, and otherwise
+*> contain the same data. This consistency cannot be
+*> maintained with less than full bandwidth.
+*> \endverbatim
+*>
+*> \param[in] IPIVOT
+*> \verbatim
+*> IPIVOT is INTEGER array, dimension (N or M)
+*> This array specifies the permutation used. After the
+*> basic matrix is generated, the rows, columns, or both
+*> are permuted. If, say, row pivoting is selected, ZLATMR
+*> starts with the *last* row and interchanges the M-th and
+*> IPIVOT(M)-th rows, then moves to the next-to-last row,
+*> interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
+*> and so on. In terms of "2-cycles", the permutation is
+*> (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
+*> where the rightmost cycle is applied first. This is the
+*> *inverse* of the effect of pivoting in LINPACK. The idea
+*> is that factoring (with pivoting) an identity matrix
+*> which has been inverse-pivoted in this way should
+*> result in a pivot vector identical to IPIVOT.
+*> Not referenced if PIVTNG = 'N'. Not modified.
+*> \endverbatim
+*>
+*> \param[in] SPARSE
+*> \verbatim
+*> SPARSE is DOUBLE PRECISION
+*> On entry specifies the sparsity of the matrix if a sparse
+*> matrix is to be generated. SPARSE should lie between
+*> 0 and 1. To generate a sparse matrix, for each matrix entry
+*> a uniform ( 0, 1 ) random number x is generated and
+*> compared to SPARSE; if x is larger the matrix entry
+*> is unchanged and if x is smaller the entry is set
+*> to zero. Thus on the average a fraction SPARSE of the
+*> entries will be set to zero.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> On entry specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL at least M-1 implies the matrix is not
+*> banded. Must equal KU if matrix is symmetric or Hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> On entry specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU at least N-1 implies the matrix is not
+*> banded. Must equal KL if matrix is symmetric or Hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] ANORM
+*> \verbatim
+*> ANORM is DOUBLE PRECISION
+*> On entry specifies maximum entry of output matrix
+*> (output matrix will by multiplied by a constant so that
+*> its largest absolute entry equal ANORM)
+*> if ANORM is nonnegative. If ANORM is negative no scaling
+*> is done. Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> On entry specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries
+*> (if symmetric or Hermitian)
+*> 'L' => zero out all superdiagonal entries
+*> (if symmetric or Hermitian)
+*> 'C' => store the upper triangle columnwise
+*> (only if matrix symmetric or Hermitian or
+*> square upper triangular)
+*> 'R' => store the lower triangle columnwise
+*> (only if matrix symmetric or Hermitian or
+*> square lower triangular)
+*> (same as upper half rowwise if symmetric)
+*> (same as conjugate upper half rowwise if Hermitian)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if matrix symmetric or Hermitian)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if matrix symmetric or Hermitian)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, HB or TB - use 'B' or 'Q'
+*> PP, HP or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to ZLATMR differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension (LDA,N)
+*> On exit A is the desired test matrix. Only those
+*> entries of A which are significant on output
+*> will be referenced (even if A is in packed or band
+*> storage format). The 'unoccupied corners' of A in
+*> band format will be zeroed out.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> on entry LDA specifies the first dimension of A as
+*> declared in the calling program.
+*> If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
+*> If PACK='C' or 'R', LDA must be at least 1.
+*> If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
+*> If PACK='Z', LDA must be at least KUU+KLL+1, where
+*> KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] IWORK
+*> \verbatim
+*> IWORK is INTEGER array, dimension (N or M)
+*> Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error parameter on exit:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S' or 'H'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
+*> -11 => GRADE illegal string, or GRADE='E' and
+*> M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E'
+*> and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E'
+*> and SYM = 'S'
+*> -12 => GRADE = 'E' and DL contains zero
+*> -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
+*> 'S' or 'E'
+*> -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
+*> and MODEL neither -6, 0 nor 6
+*> -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
+*> -17 => CONDR less than 1.0, GRADE='R' or 'B', and
+*> MODER neither -6, 0 nor 6
+*> -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
+*> M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
+*> or 'H'
+*> -19 => IPIVOT contains out of range number and
+*> PIVTNG not equal to 'N'
+*> -20 => KL negative
+*> -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
+*> -22 => SPARSE not in range 0. to 1.
+*> -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
+*> and SYM='N', or PACK='C' and SYM='N' and either KL
+*> not equal to 0 or N not equal to M, or PACK='R' and
+*> SYM='N', and either KU not equal to 0 or N not equal
+*> to M
+*> -26 => LDA too small
+*> 1 => Error return from ZLATM1 (computing D)
+*> 2 => Cannot scale diagonal to DMAX (max. entry is 0)
+*> 3 => Error return from ZLATM1 (computing DL)
+*> 4 => Error return from ZLATM1 (computing DR)
+*> 5 => ANORM is positive, but matrix constructed prior to
+*> attempting to scale it to have norm ANORM, is zero
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RSIGN, GRADE, DL, MODEL, CONDL, DR, MODER,
$ CONDR, PIVTNG, IPIVOT, KL, KU, SPARSE, ANORM,
$ PACK, A, LDA, IWORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, GRADE, PACK, PIVTNG, RSIGN, SYM
@@ -18,366 +511,6 @@
COMPLEX*16 A( LDA, * ), D( * ), DL( * ), DR( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATMR generates random matrices of various types for testing
-* LAPACK programs.
-*
-* ZLATMR operates by applying the following sequence of
-* operations:
-*
-* Generate a matrix A with random entries of distribution DIST
-* which is symmetric if SYM='S', Hermitian if SYM='H', and
-* nonsymmetric if SYM='N'.
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX and RSIGN
-* as described below.
-*
-* Grade the matrix, if desired, from the left and/or right
-* as specified by GRADE. The inputs DL, MODEL, CONDL, DR,
-* MODER and CONDR also determine the grading as described
-* below.
-*
-* Permute, if desired, the rows and/or columns as specified by
-* PIVTNG and IPIVOT.
-*
-* Set random entries to zero, if desired, to get a random sparse
-* matrix as specified by SPARSE.
-*
-* Make A a band matrix, if desired, by zeroing out the matrix
-* outside a band of lower bandwidth KL and upper bandwidth KU.
-*
-* Scale A, if desired, to have maximum entry ANORM.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if symmetric or Hermitian)
-* zero out lower half (if symmetric or Hermitian)
-* store the upper half columnwise (if symmetric or Hermitian
-* or square upper triangular)
-* store the lower half columnwise (if symmetric or Hermitian
-* or square lower triangular)
-* same as upper half rowwise if symmetric
-* same as conjugate upper half rowwise if Hermitian
-* store the lower triangle in banded format
-* (if symmetric or Hermitian)
-* store the upper triangle in banded format
-* (if symmetric or Hermitian)
-* store the entire matrix in banded format
-*
-* Note: If two calls to ZLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-*
-* If two calls to ZLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be and
-* is not maintained with less than full bandwidth.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* Number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* Number of columns of A. Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate a random matrix .
-* 'U' => real and imaginary parts are independent
-* UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => real and imaginary parts are independent
-* UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => real and imaginary parts are independent
-* NORMAL( 0, 1 ) ( 'N' for normal )
-* 'D' => uniform on interior of unit disk ( 'D' for disk )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension (4)
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to ZLATMR
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='S', generated matrix is symmetric.
-* If SYM='H', generated matrix is Hermitian.
-* If SYM='N', generated matrix is nonsymmetric.
-* Not modified.
-*
-* D (input/output) COMPLEX*16 array, dimension (min(M,N))
-* On entry this array specifies the diagonal entries
-* of the diagonal of A. D may either be specified
-* on entry, or set according to MODE and COND as described
-* below. If the matrix is Hermitian, the real part of D
-* will be taken. May be changed on exit if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry describes how D is to be used:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) COMPLEX*16
-* If MODE neither -6, 0 nor 6, the diagonal is scaled by
-* DMAX / max(abs(D(i))), so that maximum absolute entry
-* of diagonal is abs(DMAX). If DMAX is complex (or zero),
-* diagonal will be scaled by a complex number (or zero).
-*
-* RSIGN (input) CHARACTER*1
-* If MODE neither -6, 0 nor 6, specifies sign of diagonal
-* as follows:
-* 'T' => diagonal entries are multiplied by a random complex
-* number uniformly distributed with absolute value 1
-* 'F' => diagonal unchanged
-* Not modified.
-*
-* GRADE (input) CHARACTER*1
-* Specifies grading of matrix as follows:
-* 'N' => no grading
-* 'L' => matrix premultiplied by diag( DL )
-* (only if matrix nonsymmetric)
-* 'R' => matrix postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'B' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DR )
-* (only if matrix nonsymmetric)
-* 'H' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( CONJG(DL) )
-* (only if matrix Hermitian or nonsymmetric)
-* 'S' => matrix premultiplied by diag( DL ) and
-* postmultiplied by diag( DL )
-* (only if matrix symmetric or nonsymmetric)
-* 'E' => matrix premultiplied by diag( DL ) and
-* postmultiplied by inv( diag( DL ) )
-* ( 'S' for similarity )
-* (only if matrix nonsymmetric)
-* Note: if GRADE='S', then M must equal N.
-* Not modified.
-*
-* DL (input/output) COMPLEX*16 array, dimension (M)
-* If MODEL=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODEL is not zero, then DL will be set according
-* to MODEL and CONDL, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DL).
-* If GRADE='E', then DL cannot have zero entries.
-* Not referenced if GRADE = 'N' or 'R'. Changed on exit.
-*
-* MODEL (input) INTEGER
-* This specifies how the diagonal array DL is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDL (input) DOUBLE PRECISION
-* When MODEL is not zero, this specifies the condition number
-* of the computed DL. Not modified.
-*
-* DR (input/output) COMPLEX*16 array, dimension (N)
-* If MODER=0, then on entry this array specifies the diagonal
-* entries of a diagonal matrix used as described under GRADE
-* above. If MODER is not zero, then DR will be set according
-* to MODER and CONDR, analogous to the way D is set according
-* to MODE and COND (except there is no DMAX parameter for DR).
-* Not referenced if GRADE = 'N', 'L', 'H' or 'S'.
-* Changed on exit.
-*
-* MODER (input) INTEGER
-* This specifies how the diagonal array DR is to be computed,
-* just as MODE specifies how D is to be computed.
-* Not modified.
-*
-* CONDR (input) DOUBLE PRECISION
-* When MODER is not zero, this specifies the condition number
-* of the computed DR. Not modified.
-*
-* PIVTNG (input) CHARACTER*1
-* On entry specifies pivoting permutations as follows:
-* 'N' or ' ' => none.
-* 'L' => left or row pivoting (matrix must be nonsymmetric).
-* 'R' => right or column pivoting (matrix must be
-* nonsymmetric).
-* 'B' or 'F' => both or full pivoting, i.e., on both sides.
-* In this case, M must equal N
-*
-* If two calls to ZLATMR both have full bandwidth (KL = M-1
-* and KU = N-1), and differ only in the PIVTNG and PACK
-* parameters, then the matrices generated will differ only
-* in the order of the rows and/or columns, and otherwise
-* contain the same data. This consistency cannot be
-* maintained with less than full bandwidth.
-*
-* IPIVOT (input) INTEGER array, dimension (N or M)
-* This array specifies the permutation used. After the
-* basic matrix is generated, the rows, columns, or both
-* are permuted. If, say, row pivoting is selected, ZLATMR
-* starts with the *last* row and interchanges the M-th and
-* IPIVOT(M)-th rows, then moves to the next-to-last row,
-* interchanging the (M-1)-th and the IPIVOT(M-1)-th rows,
-* and so on. In terms of "2-cycles", the permutation is
-* (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M))
-* where the rightmost cycle is applied first. This is the
-* *inverse* of the effect of pivoting in LINPACK. The idea
-* is that factoring (with pivoting) an identity matrix
-* which has been inverse-pivoted in this way should
-* result in a pivot vector identical to IPIVOT.
-* Not referenced if PIVTNG = 'N'. Not modified.
-*
-* SPARSE (input) DOUBLE PRECISION
-* On entry specifies the sparsity of the matrix if a sparse
-* matrix is to be generated. SPARSE should lie between
-* 0 and 1. To generate a sparse matrix, for each matrix entry
-* a uniform ( 0, 1 ) random number x is generated and
-* compared to SPARSE; if x is larger the matrix entry
-* is unchanged and if x is smaller the entry is set
-* to zero. Thus on the average a fraction SPARSE of the
-* entries will be set to zero.
-* Not modified.
-*
-* KL (input) INTEGER
-* On entry specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL at least M-1 implies the matrix is not
-* banded. Must equal KU if matrix is symmetric or Hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* On entry specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU at least N-1 implies the matrix is not
-* banded. Must equal KL if matrix is symmetric or Hermitian.
-* Not modified.
-*
-* ANORM (input) DOUBLE PRECISION
-* On entry specifies maximum entry of output matrix
-* (output matrix will by multiplied by a constant so that
-* its largest absolute entry equal ANORM)
-* if ANORM is nonnegative. If ANORM is negative no scaling
-* is done. Not modified.
-*
-* PACK (input) CHARACTER*1
-* On entry specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries
-* (if symmetric or Hermitian)
-* 'L' => zero out all superdiagonal entries
-* (if symmetric or Hermitian)
-* 'C' => store the upper triangle columnwise
-* (only if matrix symmetric or Hermitian or
-* square upper triangular)
-* 'R' => store the lower triangle columnwise
-* (only if matrix symmetric or Hermitian or
-* square lower triangular)
-* (same as upper half rowwise if symmetric)
-* (same as conjugate upper half rowwise if Hermitian)
-* 'B' => store the lower triangle in band storage scheme
-* (only if matrix symmetric or Hermitian)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if matrix symmetric or Hermitian)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, HB or TB - use 'B' or 'Q'
-* PP, HP or TP - use 'C' or 'R'
-*
-* If two calls to ZLATMR differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX*16 array, dimension (LDA,N)
-* On exit A is the desired test matrix. Only those
-* entries of A which are significant on output
-* will be referenced (even if A is in packed or band
-* storage format). The 'unoccupied corners' of A in
-* band format will be zeroed out.
-*
-* LDA (input) INTEGER
-* on entry LDA specifies the first dimension of A as
-* declared in the calling program.
-* If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ).
-* If PACK='C' or 'R', LDA must be at least 1.
-* If PACK='B', or 'Q', LDA must be MIN ( KU+1, N )
-* If PACK='Z', LDA must be at least KUU+KLL+1, where
-* KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 )
-* Not modified.
-*
-* IWORK (workspace) INTEGER array, dimension (N or M)
-* Workspace. Not referenced if PIVTNG = 'N'. Changed on exit.
-*
-* INFO (output) INTEGER
-* Error parameter on exit:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S' or 'H'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string
-* -11 => GRADE illegal string, or GRADE='E' and
-* M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E'
-* and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E'
-* and SYM = 'S'
-* -12 => GRADE = 'E' and DL contains zero
-* -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H',
-* 'S' or 'E'
-* -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E',
-* and MODEL neither -6, 0 nor 6
-* -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B'
-* -17 => CONDR less than 1.0, GRADE='R' or 'B', and
-* MODER neither -6, 0 nor 6
-* -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and
-* M not equal to N, or PIVTNG='L' or 'R' and SYM='S'
-* or 'H'
-* -19 => IPIVOT contains out of range number and
-* PIVTNG not equal to 'N'
-* -20 => KL negative
-* -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL
-* -22 => SPARSE not in range 0. to 1.
-* -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q'
-* and SYM='N', or PACK='C' and SYM='N' and either KL
-* not equal to 0 or N not equal to M, or PACK='R' and
-* SYM='N', and either KU not equal to 0 or N not equal
-* to M
-* -26 => LDA too small
-* 1 => Error return from ZLATM1 (computing D)
-* 2 => Cannot scale diagonal to DMAX (max. entry is 0)
-* 3 => Error return from ZLATM1 (computing DL)
-* 4 => Error return from ZLATM1 (computing DR)
-* 5 => ANORM is positive, but matrix constructed prior to
-* attempting to scale it to have norm ANORM, is zero
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatms.f b/TESTING/MATGEN/zlatms.f
index 53e8a4c6..481d6719 100644
--- a/TESTING/MATGEN/zlatms.f
+++ b/TESTING/MATGEN/zlatms.f
@@ -1,9 +1,345 @@
+*> \brief \b ZLATMS
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* CHARACTER DIST, PACK, SYM
+* INTEGER INFO, KL, KU, LDA, M, MODE, N
+* DOUBLE PRECISION COND, DMAX
+* ..
+* .. Array Arguments ..
+* INTEGER ISEED( 4 )
+* DOUBLE PRECISION D( * )
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATMS generates random matrices with specified singular values
+*> (or hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> ZLATMS operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then convert
+*> the bandwidth-1 to a bandwidth-2 matrix, etc. Note
+*> that for reasonably small bandwidths (relative to M and
+*> N) this requires less storage, as a dense matrix is not
+*> generated. Also, for hermitian or symmetric matrices,
+*> only one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if hermitian)
+*> zero out lower half (if hermitian)
+*> store the upper half columnwise (if hermitian or upper
+*> triangular)
+*> store the lower half columnwise (if hermitian or lower
+*> triangular)
+*> store the lower triangle in banded format (if hermitian or
+*> lower triangular)
+*> store the upper triangle in banded format (if hermitian or
+*> upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. N must equal M if the matrix
+*> is symmetric or hermitian (i.e., if SYM is not 'N')
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to ZLATMS
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='H', the generated matrix is hermitian, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is hermitian, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> If SYM='S', the generated matrix is (complex) symmetric,
+*> with singular values specified by D, COND, MODE, and
+*> DMAX; they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( MIN( M, N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
+*> MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric
+*> or hermitian)
+*> 'L' => zero out all superdiagonal entries (if symmetric
+*> or hermitian)
+*> 'C' => store the upper triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or upper triangular)
+*> 'R' => store the lower triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB, HB, or TB - use 'B' or 'Q'
+*> PP, SP, HB, or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to ZLATMS differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension ( 3*MAX( N, M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM is not 'N' and KU is not equal to
+*> KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from DLATM1
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from ZLAGGE, CLAGHE or CLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLATMS( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-* June 2010
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
CHARACTER DIST, PACK, SYM
@@ -16,248 +352,6 @@
COMPLEX*16 A( LDA, * ), WORK( * )
* ..
*
-* Purpose
-* =======
-*
-* ZLATMS generates random matrices with specified singular values
-* (or hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* ZLATMS operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then convert
-* the bandwidth-1 to a bandwidth-2 matrix, etc. Note
-* that for reasonably small bandwidths (relative to M and
-* N) this requires less storage, as a dense matrix is not
-* generated. Also, for hermitian or symmetric matrices,
-* only one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if hermitian)
-* zero out lower half (if hermitian)
-* store the upper half columnwise (if hermitian or upper
-* triangular)
-* store the lower half columnwise (if hermitian or lower
-* triangular)
-* store the lower triangle in banded format (if hermitian or
-* lower triangular)
-* store the upper triangle in banded format (if hermitian or
-* upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. N must equal M if the matrix
-* is symmetric or hermitian (i.e., if SYM is not 'N')
-* Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to ZLATMS
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='H', the generated matrix is hermitian, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is hermitian, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* If SYM='S', the generated matrix is (complex) symmetric,
-* with singular values specified by D, COND, MODE, and
-* DMAX; they will not be negative.
-* Not modified.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( MIN( M, N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND
-* MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(N-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric
-* or hermitian)
-* 'L' => zero out all superdiagonal entries (if symmetric
-* or hermitian)
-* 'C' => store the upper triangle columnwise (only if the
-* matrix is symmetric, hermitian, or upper triangular)
-* 'R' => store the lower triangle columnwise (only if the
-* matrix is symmetric, hermitian, or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB, HB, or TB - use 'B' or 'Q'
-* PP, SP, HB, or TP - use 'C' or 'R'
-*
-* If two calls to ZLATMS differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX*16 array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) COMPLEX*16 array, dimension ( 3*MAX( N, M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM is not 'N' and KU is not equal to
-* KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from DLATM1
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from ZLAGGE, CLAGHE or CLAGSY
-*
* =====================================================================
*
* .. Parameters ..
diff --git a/TESTING/MATGEN/zlatmt.f b/TESTING/MATGEN/zlatmt.f
index b5840306..0e2c319a 100644
--- a/TESTING/MATGEN/zlatmt.f
+++ b/TESTING/MATGEN/zlatmt.f
@@ -1,9 +1,353 @@
+*> \brief \b ZLATMT
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+* Definition
+* ==========
+*
+* SUBROUTINE ZLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
+* RANK, KL, KU, PACK, A, LDA, WORK, INFO )
+*
+* .. Scalar Arguments ..
+* DOUBLE PRECISION COND, DMAX
+* INTEGER INFO, KL, KU, LDA, M, MODE, N, RANK
+* CHARACTER DIST, PACK, SYM
+* ..
+* .. Array Arguments ..
+* COMPLEX*16 A( LDA, * ), WORK( * )
+* DOUBLE PRECISION D( * )
+* INTEGER ISEED( 4 )
+* ..
+*
+* Purpose
+* =======
+*
+*>\details \b Purpose:
+*>\verbatim
+*>
+*> ZLATMT generates random matrices with specified singular values
+*> (or hermitian with specified eigenvalues)
+*> for testing LAPACK programs.
+*>
+*> ZLATMT operates by applying the following sequence of
+*> operations:
+*>
+*> Set the diagonal to D, where D may be input or
+*> computed according to MODE, COND, DMAX, and SYM
+*> as described below.
+*>
+*> Generate a matrix with the appropriate band structure, by one
+*> of two methods:
+*>
+*> Method A:
+*> Generate a dense M x N matrix by multiplying D on the left
+*> and the right by random unitary matrices, then:
+*>
+*> Reduce the bandwidth according to KL and KU, using
+*> Householder transformations.
+*>
+*> Method B:
+*> Convert the bandwidth-0 (i.e., diagonal) matrix to a
+*> bandwidth-1 matrix using Givens rotations, "chasing"
+*> out-of-band elements back, much as in QR; then convert
+*> the bandwidth-1 to a bandwidth-2 matrix, etc. Note
+*> that for reasonably small bandwidths (relative to M and
+*> N) this requires less storage, as a dense matrix is not
+*> generated. Also, for hermitian or symmetric matrices,
+*> only one triangle is generated.
+*>
+*> Method A is chosen if the bandwidth is a large fraction of the
+*> order of the matrix, and LDA is at least M (so a dense
+*> matrix can be stored.) Method B is chosen if the bandwidth
+*> is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
+*> non-symmetric), or LDA is less than M and not less than the
+*> bandwidth.
+*>
+*> Pack the matrix if desired. Options specified by PACK are:
+*> no packing
+*> zero out upper half (if hermitian)
+*> zero out lower half (if hermitian)
+*> store the upper half columnwise (if hermitian or upper
+*> triangular)
+*> store the lower half columnwise (if hermitian or lower
+*> triangular)
+*> store the lower triangle in banded format (if hermitian or
+*> lower triangular)
+*> store the upper triangle in banded format (if hermitian or
+*> upper triangular)
+*> store the entire matrix in banded format
+*> If Method B is chosen, and band format is specified, then the
+*> matrix will be generated in the band format, so no repacking
+*> will be necessary.
+*>
+*>\endverbatim
+*
+* Arguments
+* =========
+*
+*> \param[in] M
+*> \verbatim
+*> M is INTEGER
+*> The number of rows of A. Not modified.
+*> \endverbatim
+*>
+*> \param[in] N
+*> \verbatim
+*> N is INTEGER
+*> The number of columns of A. N must equal M if the matrix
+*> is symmetric or hermitian (i.e., if SYM is not 'N')
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] DIST
+*> \verbatim
+*> DIST is CHARACTER*1
+*> On entry, DIST specifies the type of distribution to be used
+*> to generate the random eigen-/singular values.
+*> 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
+*> 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
+*> 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] ISEED
+*> \verbatim
+*> ISEED is INTEGER array, dimension ( 4 )
+*> On entry ISEED specifies the seed of the random number
+*> generator. They should lie between 0 and 4095 inclusive,
+*> and ISEED(4) should be odd. The random number generator
+*> uses a linear congruential sequence limited to small
+*> integers, and so should produce machine independent
+*> random numbers. The values of ISEED are changed on
+*> exit, and can be used in the next call to ZLATMT
+*> to continue the same random number sequence.
+*> Changed on exit.
+*> \endverbatim
+*>
+*> \param[in] SYM
+*> \verbatim
+*> SYM is CHARACTER*1
+*> If SYM='H', the generated matrix is hermitian, with
+*> eigenvalues specified by D, COND, MODE, and DMAX; they
+*> may be positive, negative, or zero.
+*> If SYM='P', the generated matrix is hermitian, with
+*> eigenvalues (= singular values) specified by D, COND,
+*> MODE, and DMAX; they will not be negative.
+*> If SYM='N', the generated matrix is nonsymmetric, with
+*> singular values specified by D, COND, MODE, and DMAX;
+*> they will not be negative.
+*> If SYM='S', the generated matrix is (complex) symmetric,
+*> with singular values specified by D, COND, MODE, and
+*> DMAX; they will not be negative.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( MIN( M, N ) )
+*> This array is used to specify the singular values or
+*> eigenvalues of A (see SYM, above.) If MODE=0, then D is
+*> assumed to contain the singular/eigenvalues, otherwise
+*> they will be computed according to MODE, COND, and DMAX,
+*> and placed in D.
+*> Modified if MODE is nonzero.
+*> \endverbatim
+*>
+*> \param[in] MODE
+*> \verbatim
+*> MODE is INTEGER
+*> On entry this describes how the singular/eigenvalues are to
+*> be specified:
+*> MODE = 0 means use D as input
+*> MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
+*> MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
+*> MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
+*> MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
+*> MODE = 5 sets D to random numbers in the range
+*> ( 1/COND , 1 ) such that their logarithms
+*> are uniformly distributed.
+*> MODE = 6 set D to random numbers from same distribution
+*> as the rest of the matrix.
+*> MODE < 0 has the same meaning as ABS(MODE), except that
+*> the order of the elements of D is reversed.
+*> Thus if MODE is positive, D has entries ranging from
+*> 1 to 1/COND, if negative, from 1/COND to 1,
+*> If SYM='H', and MODE is neither 0, 6, nor -6, then
+*> the elements of D will also be multiplied by a random
+*> sign (i.e., +1 or -1.)
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] COND
+*> \verbatim
+*> COND is DOUBLE PRECISION
+*> On entry, this is used as described under MODE above.
+*> If used, it must be >= 1. Not modified.
+*> \endverbatim
+*>
+*> \param[in] DMAX
+*> \verbatim
+*> DMAX is DOUBLE PRECISION
+*> If MODE is neither -6, 0 nor 6, the contents of D, as
+*> computed according to MODE and COND, will be scaled by
+*> DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
+*> singular value (which is to say the norm) will be abs(DMAX).
+*> Note that DMAX need not be positive: if DMAX is negative
+*> (or zero), D will be scaled by a negative number (or zero).
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] RANK
+*> \verbatim
+*> RANK is INTEGER
+*> The rank of matrix to be generated for modes 1,2,3 only.
+*> D( RANK+1:N ) = 0.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KL
+*> \verbatim
+*> KL is INTEGER
+*> This specifies the lower bandwidth of the matrix. For
+*> example, KL=0 implies upper triangular, KL=1 implies upper
+*> Hessenberg, and KL being at least M-1 means that the matrix
+*> has full lower bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] KU
+*> \verbatim
+*> KU is INTEGER
+*> This specifies the upper bandwidth of the matrix. For
+*> example, KU=0 implies lower triangular, KU=1 implies lower
+*> Hessenberg, and KU being at least N-1 means that the matrix
+*> has full upper bandwidth. KL must equal KU if the matrix
+*> is symmetric or hermitian.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in] PACK
+*> \verbatim
+*> PACK is CHARACTER*1
+*> This specifies packing of matrix as follows:
+*> 'N' => no packing
+*> 'U' => zero out all subdiagonal entries (if symmetric
+*> or hermitian)
+*> 'L' => zero out all superdiagonal entries (if symmetric
+*> or hermitian)
+*> 'C' => store the upper triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or upper triangular)
+*> 'R' => store the lower triangle columnwise (only if the
+*> matrix is symmetric, hermitian, or lower triangular)
+*> 'B' => store the lower triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> lower triangular)
+*> 'Q' => store the upper triangle in band storage scheme
+*> (only if the matrix is symmetric, hermitian, or
+*> upper triangular)
+*> 'Z' => store the entire matrix in band storage scheme
+*> (pivoting can be provided for by using this
+*> option to store A in the trailing rows of
+*> the allocated storage)
+*> \endverbatim
+*> \verbatim
+*> Using these options, the various LAPACK packed and banded
+*> storage schemes can be obtained:
+*> GB - use 'Z'
+*> PB, SB, HB, or TB - use 'B' or 'Q'
+*> PP, SP, HB, or TP - use 'C' or 'R'
+*> \endverbatim
+*> \verbatim
+*> If two calls to ZLATMT differ only in the PACK parameter,
+*> they will generate mathematically equivalent matrices.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[in,out] A
+*> \verbatim
+*> A is COMPLEX*16 array, dimension ( LDA, N )
+*> On exit A is the desired test matrix. A is first generated
+*> in full (unpacked) form, and then packed, if so specified
+*> by PACK. Thus, the first M elements of the first N
+*> columns will always be modified. If PACK specifies a
+*> packed or banded storage scheme, all LDA elements of the
+*> first N columns will be modified; the elements of the
+*> array which do not correspond to elements of the generated
+*> matrix are set to zero.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> LDA specifies the first dimension of A as declared in the
+*> calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
+*> LDA must be at least M. If PACK='B' or 'Q', then LDA must
+*> be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
+*> If PACK='Z', LDA must be large enough to hold the packed
+*> array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
+*> Not modified.
+*> \endverbatim
+*>
+*> \param[out] WORK
+*> \verbatim
+*> WORK is COMPLEX*16 array, dimension ( 3*MAX( N, M ) )
+*> Workspace.
+*> Modified.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> Error code. On exit, INFO will be set to one of the
+*> following values:
+*> 0 => normal return
+*> -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
+*> -2 => N negative
+*> -3 => DIST illegal string
+*> -5 => SYM illegal string
+*> -7 => MODE not in range -6 to 6
+*> -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
+*> -10 => KL negative
+*> -11 => KU negative, or SYM is not 'N' and KU is not equal to
+*> KL
+*> -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
+*> or PACK='C' or 'Q' and SYM='N' and KL is not zero;
+*> or PACK='R' or 'B' and SYM='N' and KU is not zero;
+*> or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
+*> N.
+*> -14 => LDA is less than M, or PACK='Z' and LDA is less than
+*> MIN(KU,N-1) + MIN(KL,M-1) + 1.
+*> 1 => Error return from DLATM7
+*> 2 => Cannot scale to DMAX (max. sing. value is 0)
+*> 3 => Error return from ZLAGGE, ZLAGHE or ZLAGSY
+*> \endverbatim
+*>
+*
+* Authors
+* =======
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date November 2011
+*
+*> \ingroup complex16_matgen
+*
+* =====================================================================
SUBROUTINE ZLATMT( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX,
$ RANK, KL, KU, PACK, A, LDA, WORK, INFO )
*
-* -- LAPACK test routine (version 3.1) --
-* Craig Lucas, University of Manchester / NAG Ltd.
-* October, 2008
+* -- LAPACK computational routine (version 3.1) --
+* -- LAPACK is a software package provided by Univ. of Tennessee, --
+* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
+* November 2011
*
* .. Scalar Arguments ..
DOUBLE PRECISION COND, DMAX
@@ -16,253 +360,6 @@
INTEGER ISEED( 4 )
* ..
*
-* Purpose
-* =======
-*
-* ZLATMT generates random matrices with specified singular values
-* (or hermitian with specified eigenvalues)
-* for testing LAPACK programs.
-*
-* ZLATMT operates by applying the following sequence of
-* operations:
-*
-* Set the diagonal to D, where D may be input or
-* computed according to MODE, COND, DMAX, and SYM
-* as described below.
-*
-* Generate a matrix with the appropriate band structure, by one
-* of two methods:
-*
-* Method A:
-* Generate a dense M x N matrix by multiplying D on the left
-* and the right by random unitary matrices, then:
-*
-* Reduce the bandwidth according to KL and KU, using
-* Householder transformations.
-*
-* Method B:
-* Convert the bandwidth-0 (i.e., diagonal) matrix to a
-* bandwidth-1 matrix using Givens rotations, "chasing"
-* out-of-band elements back, much as in QR; then convert
-* the bandwidth-1 to a bandwidth-2 matrix, etc. Note
-* that for reasonably small bandwidths (relative to M and
-* N) this requires less storage, as a dense matrix is not
-* generated. Also, for hermitian or symmetric matrices,
-* only one triangle is generated.
-*
-* Method A is chosen if the bandwidth is a large fraction of the
-* order of the matrix, and LDA is at least M (so a dense
-* matrix can be stored.) Method B is chosen if the bandwidth
-* is small (< 1/2 N for hermitian or symmetric, < .3 N+M for
-* non-symmetric), or LDA is less than M and not less than the
-* bandwidth.
-*
-* Pack the matrix if desired. Options specified by PACK are:
-* no packing
-* zero out upper half (if hermitian)
-* zero out lower half (if hermitian)
-* store the upper half columnwise (if hermitian or upper
-* triangular)
-* store the lower half columnwise (if hermitian or lower
-* triangular)
-* store the lower triangle in banded format (if hermitian or
-* lower triangular)
-* store the upper triangle in banded format (if hermitian or
-* upper triangular)
-* store the entire matrix in banded format
-* If Method B is chosen, and band format is specified, then the
-* matrix will be generated in the band format, so no repacking
-* will be necessary.
-*
-* Arguments
-* =========
-*
-* M (input) INTEGER
-* The number of rows of A. Not modified.
-*
-* N (input) INTEGER
-* The number of columns of A. N must equal M if the matrix
-* is symmetric or hermitian (i.e., if SYM is not 'N')
-* Not modified.
-*
-* DIST (input) CHARACTER*1
-* On entry, DIST specifies the type of distribution to be used
-* to generate the random eigen-/singular values.
-* 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform )
-* 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric )
-* 'N' => NORMAL( 0, 1 ) ( 'N' for normal )
-* Not modified.
-*
-* ISEED (input/output) INTEGER array, dimension ( 4 )
-* On entry ISEED specifies the seed of the random number
-* generator. They should lie between 0 and 4095 inclusive,
-* and ISEED(4) should be odd. The random number generator
-* uses a linear congruential sequence limited to small
-* integers, and so should produce machine independent
-* random numbers. The values of ISEED are changed on
-* exit, and can be used in the next call to ZLATMT
-* to continue the same random number sequence.
-* Changed on exit.
-*
-* SYM (input) CHARACTER*1
-* If SYM='H', the generated matrix is hermitian, with
-* eigenvalues specified by D, COND, MODE, and DMAX; they
-* may be positive, negative, or zero.
-* If SYM='P', the generated matrix is hermitian, with
-* eigenvalues (= singular values) specified by D, COND,
-* MODE, and DMAX; they will not be negative.
-* If SYM='N', the generated matrix is nonsymmetric, with
-* singular values specified by D, COND, MODE, and DMAX;
-* they will not be negative.
-* If SYM='S', the generated matrix is (complex) symmetric,
-* with singular values specified by D, COND, MODE, and
-* DMAX; they will not be negative.
-* Not modified.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( MIN( M, N ) )
-* This array is used to specify the singular values or
-* eigenvalues of A (see SYM, above.) If MODE=0, then D is
-* assumed to contain the singular/eigenvalues, otherwise
-* they will be computed according to MODE, COND, and DMAX,
-* and placed in D.
-* Modified if MODE is nonzero.
-*
-* MODE (input) INTEGER
-* On entry this describes how the singular/eigenvalues are to
-* be specified:
-* MODE = 0 means use D as input
-* MODE = 1 sets D(1)=1 and D(2:RANK)=1.0/COND
-* MODE = 2 sets D(1:RANK-1)=1 and D(RANK)=1.0/COND
-* MODE = 3 sets D(I)=COND**(-(I-1)/(RANK-1))
-* MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND)
-* MODE = 5 sets D to random numbers in the range
-* ( 1/COND , 1 ) such that their logarithms
-* are uniformly distributed.
-* MODE = 6 set D to random numbers from same distribution
-* as the rest of the matrix.
-* MODE < 0 has the same meaning as ABS(MODE), except that
-* the order of the elements of D is reversed.
-* Thus if MODE is positive, D has entries ranging from
-* 1 to 1/COND, if negative, from 1/COND to 1,
-* If SYM='H', and MODE is neither 0, 6, nor -6, then
-* the elements of D will also be multiplied by a random
-* sign (i.e., +1 or -1.)
-* Not modified.
-*
-* COND (input) DOUBLE PRECISION
-* On entry, this is used as described under MODE above.
-* If used, it must be >= 1. Not modified.
-*
-* DMAX (input) DOUBLE PRECISION
-* If MODE is neither -6, 0 nor 6, the contents of D, as
-* computed according to MODE and COND, will be scaled by
-* DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or
-* singular value (which is to say the norm) will be abs(DMAX).
-* Note that DMAX need not be positive: if DMAX is negative
-* (or zero), D will be scaled by a negative number (or zero).
-* Not modified.
-*
-* RANK (input) INTEGER
-* The rank of matrix to be generated for modes 1,2,3 only.
-* D( RANK+1:N ) = 0.
-* Not modified.
-*
-* KL (input) INTEGER
-* This specifies the lower bandwidth of the matrix. For
-* example, KL=0 implies upper triangular, KL=1 implies upper
-* Hessenberg, and KL being at least M-1 means that the matrix
-* has full lower bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* KU (input) INTEGER
-* This specifies the upper bandwidth of the matrix. For
-* example, KU=0 implies lower triangular, KU=1 implies lower
-* Hessenberg, and KU being at least N-1 means that the matrix
-* has full upper bandwidth. KL must equal KU if the matrix
-* is symmetric or hermitian.
-* Not modified.
-*
-* PACK (input) CHARACTER*1
-* This specifies packing of matrix as follows:
-* 'N' => no packing
-* 'U' => zero out all subdiagonal entries (if symmetric
-* or hermitian)
-* 'L' => zero out all superdiagonal entries (if symmetric
-* or hermitian)
-* 'C' => store the upper triangle columnwise (only if the
-* matrix is symmetric, hermitian, or upper triangular)
-* 'R' => store the lower triangle columnwise (only if the
-* matrix is symmetric, hermitian, or lower triangular)
-* 'B' => store the lower triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* lower triangular)
-* 'Q' => store the upper triangle in band storage scheme
-* (only if the matrix is symmetric, hermitian, or
-* upper triangular)
-* 'Z' => store the entire matrix in band storage scheme
-* (pivoting can be provided for by using this
-* option to store A in the trailing rows of
-* the allocated storage)
-*
-* Using these options, the various LAPACK packed and banded
-* storage schemes can be obtained:
-* GB - use 'Z'
-* PB, SB, HB, or TB - use 'B' or 'Q'
-* PP, SP, HB, or TP - use 'C' or 'R'
-*
-* If two calls to ZLATMT differ only in the PACK parameter,
-* they will generate mathematically equivalent matrices.
-* Not modified.
-*
-* A (input/output) COMPLEX*16 array, dimension ( LDA, N )
-* On exit A is the desired test matrix. A is first generated
-* in full (unpacked) form, and then packed, if so specified
-* by PACK. Thus, the first M elements of the first N
-* columns will always be modified. If PACK specifies a
-* packed or banded storage scheme, all LDA elements of the
-* first N columns will be modified; the elements of the
-* array which do not correspond to elements of the generated
-* matrix are set to zero.
-* Modified.
-*
-* LDA (input) INTEGER
-* LDA specifies the first dimension of A as declared in the
-* calling program. If PACK='N', 'U', 'L', 'C', or 'R', then
-* LDA must be at least M. If PACK='B' or 'Q', then LDA must
-* be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)).
-* If PACK='Z', LDA must be large enough to hold the packed
-* array: MIN( KU, N-1) + MIN( KL, M-1) + 1.
-* Not modified.
-*
-* WORK (workspace) COMPLEX*16 array, dimension ( 3*MAX( N, M ) )
-* Workspace.
-* Modified.
-*
-* INFO (output) INTEGER
-* Error code. On exit, INFO will be set to one of the
-* following values:
-* 0 => normal return
-* -1 => M negative or unequal to N and SYM='S', 'H', or 'P'
-* -2 => N negative
-* -3 => DIST illegal string
-* -5 => SYM illegal string
-* -7 => MODE not in range -6 to 6
-* -8 => COND less than 1.0, and MODE neither -6, 0 nor 6
-* -10 => KL negative
-* -11 => KU negative, or SYM is not 'N' and KU is not equal to
-* KL
-* -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N';
-* or PACK='C' or 'Q' and SYM='N' and KL is not zero;
-* or PACK='R' or 'B' and SYM='N' and KU is not zero;
-* or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not
-* N.
-* -14 => LDA is less than M, or PACK='Z' and LDA is less than
-* MIN(KU,N-1) + MIN(KL,M-1) + 1.
-* 1 => Error return from DLATM7
-* 2 => Cannot scale to DMAX (max. sing. value is 0)
-* 3 => Error return from ZLAGGE, ZLAGHE or ZLAGSY
-*
* =====================================================================
*
* .. Parameters ..