--- rpl/lapack/lapack/dlagv2.f 2010/08/06 15:32:26 1.4
+++ rpl/lapack/lapack/dlagv2.f 2017/06/17 10:53:53 1.17
@@ -1,10 +1,166 @@
+*> \brief \b DLAGV2 computes the Generalized Schur factorization of a real 2-by-2 matrix pencil (A,B) where B is upper triangular.
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+*> \htmlonly
+*> Download DLAGV2 + dependencies
+*>
+*> [TGZ]
+*>
+*> [ZIP]
+*>
+*> [TXT]
+*> \endhtmlonly
+*
+* Definition:
+* ===========
+*
+* SUBROUTINE DLAGV2( A, LDA, B, LDB, ALPHAR, ALPHAI, BETA, CSL, SNL,
+* CSR, SNR )
+*
+* .. Scalar Arguments ..
+* INTEGER LDA, LDB
+* DOUBLE PRECISION CSL, CSR, SNL, SNR
+* ..
+* .. Array Arguments ..
+* DOUBLE PRECISION A( LDA, * ), ALPHAI( 2 ), ALPHAR( 2 ),
+* $ B( LDB, * ), BETA( 2 )
+* ..
+*
+*
+*> \par Purpose:
+* =============
+*>
+*> \verbatim
+*>
+*> DLAGV2 computes the Generalized Schur factorization of a real 2-by-2
+*> matrix pencil (A,B) where B is upper triangular. This routine
+*> computes orthogonal (rotation) matrices given by CSL, SNL and CSR,
+*> SNR such that
+*>
+*> 1) if the pencil (A,B) has two real eigenvalues (include 0/0 or 1/0
+*> types), then
+*>
+*> [ a11 a12 ] := [ CSL SNL ] [ a11 a12 ] [ CSR -SNR ]
+*> [ 0 a22 ] [ -SNL CSL ] [ a21 a22 ] [ SNR CSR ]
+*>
+*> [ b11 b12 ] := [ CSL SNL ] [ b11 b12 ] [ CSR -SNR ]
+*> [ 0 b22 ] [ -SNL CSL ] [ 0 b22 ] [ SNR CSR ],
+*>
+*> 2) if the pencil (A,B) has a pair of complex conjugate eigenvalues,
+*> then
+*>
+*> [ a11 a12 ] := [ CSL SNL ] [ a11 a12 ] [ CSR -SNR ]
+*> [ a21 a22 ] [ -SNL CSL ] [ a21 a22 ] [ SNR CSR ]
+*>
+*> [ b11 0 ] := [ CSL SNL ] [ b11 b12 ] [ CSR -SNR ]
+*> [ 0 b22 ] [ -SNL CSL ] [ 0 b22 ] [ SNR CSR ]
+*>
+*> where b11 >= b22 > 0.
+*>
+*> \endverbatim
+*
+* Arguments:
+* ==========
+*
+*> \param[in,out] A
+*> \verbatim
+*> A is DOUBLE PRECISION array, dimension (LDA, 2)
+*> On entry, the 2 x 2 matrix A.
+*> On exit, A is overwritten by the ``A-part'' of the
+*> generalized Schur form.
+*> \endverbatim
+*>
+*> \param[in] LDA
+*> \verbatim
+*> LDA is INTEGER
+*> THe leading dimension of the array A. LDA >= 2.
+*> \endverbatim
+*>
+*> \param[in,out] B
+*> \verbatim
+*> B is DOUBLE PRECISION array, dimension (LDB, 2)
+*> On entry, the upper triangular 2 x 2 matrix B.
+*> On exit, B is overwritten by the ``B-part'' of the
+*> generalized Schur form.
+*> \endverbatim
+*>
+*> \param[in] LDB
+*> \verbatim
+*> LDB is INTEGER
+*> THe leading dimension of the array B. LDB >= 2.
+*> \endverbatim
+*>
+*> \param[out] ALPHAR
+*> \verbatim
+*> ALPHAR is DOUBLE PRECISION array, dimension (2)
+*> \endverbatim
+*>
+*> \param[out] ALPHAI
+*> \verbatim
+*> ALPHAI is DOUBLE PRECISION array, dimension (2)
+*> \endverbatim
+*>
+*> \param[out] BETA
+*> \verbatim
+*> BETA is DOUBLE PRECISION array, dimension (2)
+*> (ALPHAR(k)+i*ALPHAI(k))/BETA(k) are the eigenvalues of the
+*> pencil (A,B), k=1,2, i = sqrt(-1). Note that BETA(k) may
+*> be zero.
+*> \endverbatim
+*>
+*> \param[out] CSL
+*> \verbatim
+*> CSL is DOUBLE PRECISION
+*> The cosine of the left rotation matrix.
+*> \endverbatim
+*>
+*> \param[out] SNL
+*> \verbatim
+*> SNL is DOUBLE PRECISION
+*> The sine of the left rotation matrix.
+*> \endverbatim
+*>
+*> \param[out] CSR
+*> \verbatim
+*> CSR is DOUBLE PRECISION
+*> The cosine of the right rotation matrix.
+*> \endverbatim
+*>
+*> \param[out] SNR
+*> \verbatim
+*> SNR is DOUBLE PRECISION
+*> The sine of the right rotation matrix.
+*> \endverbatim
+*
+* Authors:
+* ========
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date December 2016
+*
+*> \ingroup doubleOTHERauxiliary
+*
+*> \par Contributors:
+* ==================
+*>
+*> Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
+*
+* =====================================================================
SUBROUTINE DLAGV2( A, LDA, B, LDB, ALPHAR, ALPHAI, BETA, CSL, SNL,
$ CSR, SNR )
*
-* -- LAPACK auxiliary routine (version 3.2) --
+* -- LAPACK auxiliary routine (version 3.7.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
-* November 2006
+* December 2016
*
* .. Scalar Arguments ..
INTEGER LDA, LDB
@@ -15,79 +171,6 @@
$ B( LDB, * ), BETA( 2 )
* ..
*
-* Purpose
-* =======
-*
-* DLAGV2 computes the Generalized Schur factorization of a real 2-by-2
-* matrix pencil (A,B) where B is upper triangular. This routine
-* computes orthogonal (rotation) matrices given by CSL, SNL and CSR,
-* SNR such that
-*
-* 1) if the pencil (A,B) has two real eigenvalues (include 0/0 or 1/0
-* types), then
-*
-* [ a11 a12 ] := [ CSL SNL ] [ a11 a12 ] [ CSR -SNR ]
-* [ 0 a22 ] [ -SNL CSL ] [ a21 a22 ] [ SNR CSR ]
-*
-* [ b11 b12 ] := [ CSL SNL ] [ b11 b12 ] [ CSR -SNR ]
-* [ 0 b22 ] [ -SNL CSL ] [ 0 b22 ] [ SNR CSR ],
-*
-* 2) if the pencil (A,B) has a pair of complex conjugate eigenvalues,
-* then
-*
-* [ a11 a12 ] := [ CSL SNL ] [ a11 a12 ] [ CSR -SNR ]
-* [ a21 a22 ] [ -SNL CSL ] [ a21 a22 ] [ SNR CSR ]
-*
-* [ b11 0 ] := [ CSL SNL ] [ b11 b12 ] [ CSR -SNR ]
-* [ 0 b22 ] [ -SNL CSL ] [ 0 b22 ] [ SNR CSR ]
-*
-* where b11 >= b22 > 0.
-*
-*
-* Arguments
-* =========
-*
-* A (input/output) DOUBLE PRECISION array, dimension (LDA, 2)
-* On entry, the 2 x 2 matrix A.
-* On exit, A is overwritten by the ``A-part'' of the
-* generalized Schur form.
-*
-* LDA (input) INTEGER
-* THe leading dimension of the array A. LDA >= 2.
-*
-* B (input/output) DOUBLE PRECISION array, dimension (LDB, 2)
-* On entry, the upper triangular 2 x 2 matrix B.
-* On exit, B is overwritten by the ``B-part'' of the
-* generalized Schur form.
-*
-* LDB (input) INTEGER
-* THe leading dimension of the array B. LDB >= 2.
-*
-* ALPHAR (output) DOUBLE PRECISION array, dimension (2)
-* ALPHAI (output) DOUBLE PRECISION array, dimension (2)
-* BETA (output) DOUBLE PRECISION array, dimension (2)
-* (ALPHAR(k)+i*ALPHAI(k))/BETA(k) are the eigenvalues of the
-* pencil (A,B), k=1,2, i = sqrt(-1). Note that BETA(k) may
-* be zero.
-*
-* CSL (output) DOUBLE PRECISION
-* The cosine of the left rotation matrix.
-*
-* SNL (output) DOUBLE PRECISION
-* The sine of the left rotation matrix.
-*
-* CSR (output) DOUBLE PRECISION
-* The cosine of the right rotation matrix.
-*
-* SNR (output) DOUBLE PRECISION
-* The sine of the right rotation matrix.
-*
-* Further Details
-* ===============
-*
-* Based on contributions by
-* Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
-*
* =====================================================================
*
* .. Parameters ..
@@ -142,6 +225,7 @@
SNR = ZERO
A( 2, 1 ) = ZERO
B( 2, 1 ) = ZERO
+ WI = ZERO
*
* Check if B is singular
*
@@ -154,6 +238,7 @@
A( 2, 1 ) = ZERO
B( 1, 1 ) = ZERO
B( 2, 1 ) = ZERO
+ WI = ZERO
*
ELSE IF( ABS( B( 2, 2 ) ).LE.ULP ) THEN
CALL DLARTG( A( 2, 2 ), A( 2, 1 ), CSR, SNR, T )
@@ -165,6 +250,7 @@
A( 2, 1 ) = ZERO
B( 2, 1 ) = ZERO
B( 2, 2 ) = ZERO
+ WI = ZERO
*
ELSE
*
@@ -239,7 +325,7 @@
CALL DLASV2( B( 1, 1 ), B( 1, 2 ), B( 2, 2 ), R, T, SNR,
$ CSR, SNL, CSL )
*
-* Form (A,B) := Q(A,B)Z' where Q is left rotation matrix and
+* Form (A,B) := Q(A,B)Z**T where Q is left rotation matrix and
* Z is right rotation matrix computed from DLASV2
*
CALL DROT( 2, A( 1, 1 ), LDA, A( 2, 1 ), LDA, CSL, SNL )