![]() |
MAGMA
2.0.0
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_dgehrd (magma_int_t n, magma_int_t ilo, magma_int_t ihi, double *A, magma_int_t lda, double *tau, double *work, magma_int_t lwork, magmaDouble_ptr dT, magma_int_t *info) |
DGEHRD reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H . More... | |
magma_int_t | magma_dgehrd2 (magma_int_t n, magma_int_t ilo, magma_int_t ihi, double *A, magma_int_t lda, double *tau, double *work, magma_int_t lwork, magma_int_t *info) |
DGEHRD2 reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H . More... | |
magma_int_t | magma_dgehrd_m (magma_int_t n, magma_int_t ilo, magma_int_t ihi, double *A, magma_int_t lda, double *tau, double *work, magma_int_t lwork, double *T, magma_int_t *info) |
DGEHRD reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H . More... | |
magma_int_t | magma_dorghr (magma_int_t n, magma_int_t ilo, magma_int_t ihi, double *A, magma_int_t lda, double *tau, magmaDouble_ptr dT, magma_int_t nb, magma_int_t *info) |
DORGHR generates a DOUBLE_PRECISION unitary matrix Q which is defined as the product of IHI-ILO elementary reflectors of order N, as returned by DGEHRD: More... | |
magma_int_t | magma_dorghr_m (magma_int_t n, magma_int_t ilo, magma_int_t ihi, double *A, magma_int_t lda, double *tau, double *T, magma_int_t nb, magma_int_t *info) |
DORGHR generates a DOUBLE_PRECISION unitary matrix Q which is defined as the product of IHI-ILO elementary reflectors of order N, as returned by DGEHRD: More... | |
magma_int_t | magma_dtrevc3 (magma_side_t side, magma_vec_t howmany, magma_int_t *select, magma_int_t n, double *T, magma_int_t ldt, double *VL, magma_int_t ldvl, double *VR, magma_int_t ldvr, magma_int_t mm, magma_int_t *mout, double *work, magma_int_t lwork, magma_int_t *info) |
DTREVC3 computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T. More... | |
magma_int_t | magma_dtrevc3_mt (magma_side_t side, magma_vec_t howmany, magma_int_t *select, magma_int_t n, double *T, magma_int_t ldt, double *VL, magma_int_t ldvl, double *VR, magma_int_t ldvr, magma_int_t mm, magma_int_t *mout, double *work, magma_int_t lwork, magma_int_t *info) |
DTREVC3_MT computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T. More... | |
subroutine | dtrevc3 (SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR, LDVR, MM, M, WORK, LWORK, INFO) |
DTREVC3 More... | |
subroutine dtrevc3 | ( | character | SIDE, |
character | HOWMNY, | ||
logical, dimension( * ) | SELECT, | ||
integer | N, | ||
double precision, dimension( ldt, * ) | T, | ||
integer | LDT, | ||
double precision, dimension( ldvl, * ) | VL, | ||
integer | LDVL, | ||
double precision, dimension( ldvr, * ) | VR, | ||
integer | LDVR, | ||
integer | MM, | ||
integer | M, | ||
double precision, dimension( * ) | WORK, | ||
integer | LWORK, | ||
integer | INFO | ||
) |
DTREVC3
DTREVC3 computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T. Matrices of this type are produced by the Schur factorization of a real general matrix: A = Q*T*Q**T, as computed by DHSEQR. The right eigenvector x and the left eigenvector y of T corresponding to an eigenvalue w are defined by: T*x = w*x, (y**T)*T = w*(y**T) where y**T denotes the transpose of the vector y. The eigenvalues are not input to this routine, but are read directly from the diagonal blocks of T. This routine returns the matrices X and/or Y of right and left eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y are the matrices of right and left eigenvectors of A. This uses a Level 3 BLAS version of the back transformation.
[in] | SIDE | SIDE is CHARACTER*1 = 'R': compute right eigenvectors only; = 'L': compute left eigenvectors only; = 'B': compute both right and left eigenvectors. |
[in] | HOWMNY | HOWMNY is CHARACTER*1 = 'A': compute all right and/or left eigenvectors; = 'B': compute all right and/or left eigenvectors, backtransformed by the matrices in VR and/or VL; = 'S': compute selected right and/or left eigenvectors, as indicated by the logical array SELECT. |
[in,out] | SELECT | SELECT is LOGICAL array, dimension (N) If HOWMNY = 'S', SELECT specifies the eigenvectors to be computed. If w(j) is a real eigenvalue, the corresponding real eigenvector is computed if SELECT(j) is .TRUE.. If w(j) and w(j+1) are the real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if either SELECT(j) or SELECT(j+1) is .TRUE., and on exit SELECT(j) is set to .TRUE. and SELECT(j+1) is set to .FALSE.. Not referenced if HOWMNY = 'A' or 'B'. |
[in] | N | N is INTEGER The order of the matrix T. N >= 0. |
[in] | T | T is DOUBLE PRECISION array, dimension (LDT,N) The upper quasi-triangular matrix T in Schur canonical form. |
[in] | LDT | LDT is INTEGER The leading dimension of the array T. LDT >= max(1,N). |
[in,out] | VL | VL is DOUBLE PRECISION array, dimension (LDVL,MM) On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must contain an N-by-N matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if SIDE = 'L' or 'B', VL contains: if HOWMNY = 'A', the matrix Y of left eigenvectors of T; if HOWMNY = 'B', the matrix Q*Y; if HOWMNY = 'S', the left eigenvectors of T specified by SELECT, stored consecutively in the columns of VL, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part, and the second the imaginary part. Not referenced if SIDE = 'R'. |
[in] | LDVL | LDVL is INTEGER The leading dimension of the array VL. LDVL >= 1, and if SIDE = 'L' or 'B', LDVL >= N. |
[in,out] | VR | VR is DOUBLE PRECISION array, dimension (LDVR,MM) On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must contain an N-by-N matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if SIDE = 'R' or 'B', VR contains: if HOWMNY = 'A', the matrix X of right eigenvectors of T; if HOWMNY = 'B', the matrix Q*X; if HOWMNY = 'S', the right eigenvectors of T specified by SELECT, stored consecutively in the columns of VR, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part and the second the imaginary part. Not referenced if SIDE = 'L'. |
[in] | LDVR | LDVR is INTEGER The leading dimension of the array VR. LDVR >= 1, and if SIDE = 'R' or 'B', LDVR >= N. |
[in] | MM | MM is INTEGER The number of columns in the arrays VL and/or VR. MM >= M. |
[out] | M | M is INTEGER The number of columns in the arrays VL and/or VR actually used to store the eigenvectors. If HOWMNY = 'A' or 'B', M is set to N. Each selected real eigenvector occupies one column and each selected complex eigenvector occupies two columns. |
[out] | WORK | WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) |
[in] | LWORK | LWORK is INTEGER The dimension of array WORK. LWORK >= max(1,3*N). For optimum performance, LWORK >= N + 2*N*NB, where NB is the optimal blocksize. |
[out] | INFO | INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value |
The algorithm used in this program is basically backward (forward) substitution, with scaling to make the the code robust against possible overflow. Each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number (x,y) is taken to be |x| + |y|.
magma_int_t magma_dgehrd | ( | magma_int_t | n, |
magma_int_t | ilo, | ||
magma_int_t | ihi, | ||
double * | A, | ||
magma_int_t | lda, | ||
double * | tau, | ||
double * | work, | ||
magma_int_t | lwork, | ||
magmaDouble_ptr | dT, | ||
magma_int_t * | info | ||
) |
DGEHRD reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H .
This version stores the triangular matrices used in the factorization so that they can be applied directly (i.e., without being recomputed) later. As a result, the application of Q is much faster.
[in] | n | INTEGER The order of the matrix A. N >= 0. |
[in] | ilo | INTEGER |
[in] | ihi | INTEGER It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to DGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. |
[in,out] | A | DOUBLE_PRECISION array, dimension (LDA,N) On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N). |
[out] | tau | DOUBLE_PRECISION array, dimension (N-1) The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. |
[out] | work | (workspace) DOUBLE_PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK[0] returns the optimal LWORK. |
[in] | lwork | INTEGER The length of the array WORK. LWORK >= N*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. |
[out] | dT | DOUBLE_PRECISION array on the GPU, dimension NB*N, where NB is the optimal blocksize. It stores the NB*NB blocks of the triangular T matrices used in the reduction. |
[out] | info | INTEGER
|
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-1).
Each H(i) has the form
H(i) = I - tau * v * v'
where tau is a real scalar, and v is a real vector with v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).
The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit, ( a a a a a a a ) ( a a h h h h a ) ( a a a a a a ) ( a h h h h a ) ( a a a a a a ) ( h h h h h h ) ( a a a a a a ) ( v2 h h h h h ) ( a a a a a a ) ( v2 v3 h h h h ) ( a a a a a a ) ( v2 v3 v4 h h h ) ( a ) ( a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).
This implementation follows the hybrid algorithm and notations described in
S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.
This version stores the T matrices in dT, for later use in magma_dorghr.
magma_int_t magma_dgehrd2 | ( | magma_int_t | n, |
magma_int_t | ilo, | ||
magma_int_t | ihi, | ||
double * | A, | ||
magma_int_t | lda, | ||
double * | tau, | ||
double * | work, | ||
magma_int_t | lwork, | ||
magma_int_t * | info | ||
) |
DGEHRD2 reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H .
[in] | n | INTEGER The order of the matrix A. N >= 0. |
[in] | ilo | INTEGER |
[in] | ihi | INTEGER It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to DGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. |
[in,out] | A | DOUBLE_PRECISION array, dimension (LDA,N) On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N). |
[out] | tau | DOUBLE_PRECISION array, dimension (N-1) The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. |
[out] | work | (workspace) DOUBLE_PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK[0] returns the optimal LWORK. |
[in] | lwork | INTEGER The length of the array WORK. LWORK >= max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. |
[out] | info | INTEGER
|
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-1).
Each H(i) has the form
H(i) = I - tau * v * v'
where tau is a real scalar, and v is a real vector with v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).
The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit, ( a a a a a a a ) ( a a h h h h a ) ( a a a a a a ) ( a h h h h a ) ( a a a a a a ) ( h h h h h h ) ( a a a a a a ) ( v2 h h h h h ) ( a a a a a a ) ( v2 v3 h h h h ) ( a a a a a a ) ( v2 v3 v4 h h h ) ( a ) ( a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).
This implementation follows the hybrid algorithm and notations described in
S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.
magma_int_t magma_dgehrd_m | ( | magma_int_t | n, |
magma_int_t | ilo, | ||
magma_int_t | ihi, | ||
double * | A, | ||
magma_int_t | lda, | ||
double * | tau, | ||
double * | work, | ||
magma_int_t | lwork, | ||
double * | T, | ||
magma_int_t * | info | ||
) |
DGEHRD reduces a DOUBLE_PRECISION general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H .
This version stores the triangular matrices used in the factorization so that they can be applied directly (i.e., without being recomputed) later. As a result, the application of Q is much faster.
[in] | n | INTEGER The order of the matrix A. N >= 0. |
[in] | ilo | INTEGER |
[in] | ihi | INTEGER It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to DGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. |
[in,out] | A | DOUBLE_PRECISION array, dimension (LDA,N) On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N). |
[out] | tau | DOUBLE_PRECISION array, dimension (N-1) The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. |
[out] | work | (workspace) DOUBLE_PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK[0] returns the optimal LWORK. |
[in] | lwork | INTEGER The length of the array WORK. LWORK >= N*NB. where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. |
[out] | T | DOUBLE_PRECISION array, dimension NB*N, where NB is the optimal blocksize. It stores the NB*NB blocks of the triangular T matrices used in the reduction. |
[out] | info | INTEGER
|
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-1).
Each H(i) has the form
H(i) = I - tau * v * v'
where tau is a real scalar, and v is a real vector with v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).
The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit, ( a a a a a a a ) ( a a h h h h a ) ( a a a a a a ) ( a h h h h a ) ( a a a a a a ) ( h h h h h h ) ( a a a a a a ) ( v2 h h h h h ) ( a a a a a a ) ( v2 v3 h h h h ) ( a a a a a a ) ( v2 v3 v4 h h h ) ( a ) ( a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).
This implementation follows the hybrid algorithm and notations described in
S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.
This version stores the T matrices, for later use in magma_dorghr.
magma_int_t magma_dorghr | ( | magma_int_t | n, |
magma_int_t | ilo, | ||
magma_int_t | ihi, | ||
double * | A, | ||
magma_int_t | lda, | ||
double * | tau, | ||
magmaDouble_ptr | dT, | ||
magma_int_t | nb, | ||
magma_int_t * | info | ||
) |
DORGHR generates a DOUBLE_PRECISION unitary matrix Q which is defined as the product of IHI-ILO elementary reflectors of order N, as returned by DGEHRD:
Q = H(ilo) H(ilo+1) . . . H(ihi-1).
[in] | n | INTEGER The order of the matrix Q. N >= 0. |
[in] | ilo | INTEGER |
[in] | ihi | INTEGER ILO and IHI must have the same values as in the previous call of DGEHRD. Q is equal to the unit matrix except in the submatrix Q(ilo+1:ihi,ilo+1:ihi). 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. |
[in,out] | A | DOUBLE_PRECISION array, dimension (LDA,N) On entry, the vectors which define the elementary reflectors, as returned by DGEHRD. On exit, the N-by-N unitary matrix Q. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N). |
[in] | tau | DOUBLE_PRECISION array, dimension (N-1) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGEHRD. |
[in] | dT | DOUBLE_PRECISION array on the GPU device. DT contains the T matrices used in blocking the elementary reflectors H(i), e.g., this can be the 9th argument of magma_dgehrd. |
[in] | nb | INTEGER This is the block size used in DGEHRD, and correspondingly the size of the T matrices, used in the factorization, and stored in DT. |
[out] | info | INTEGER
|
magma_int_t magma_dorghr_m | ( | magma_int_t | n, |
magma_int_t | ilo, | ||
magma_int_t | ihi, | ||
double * | A, | ||
magma_int_t | lda, | ||
double * | tau, | ||
double * | T, | ||
magma_int_t | nb, | ||
magma_int_t * | info | ||
) |
DORGHR generates a DOUBLE_PRECISION unitary matrix Q which is defined as the product of IHI-ILO elementary reflectors of order N, as returned by DGEHRD:
Q = H(ilo) H(ilo+1) . . . H(ihi-1).
[in] | n | INTEGER The order of the matrix Q. N >= 0. |
[in] | ilo | INTEGER |
[in] | ihi | INTEGER ILO and IHI must have the same values as in the previous call of DGEHRD. Q is equal to the unit matrix except in the submatrix Q(ilo+1:ihi,ilo+1:ihi). 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. |
[in,out] | A | DOUBLE_PRECISION array, dimension (LDA,N) On entry, the vectors which define the elementary reflectors, as returned by DGEHRD. On exit, the N-by-N unitary matrix Q. |
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N). |
[in] | tau | DOUBLE_PRECISION array, dimension (N-1) TAU(i) must contain the scalar factor of the elementary reflector H(i), as returned by DGEHRD. |
[in] | T | DOUBLE_PRECISION array on the GPU device. T contains the T matrices used in blocking the elementary reflectors H(i), e.g., this can be the 9th argument of magma_dgehrd. |
[in] | nb | INTEGER This is the block size used in DGEHRD, and correspondingly the size of the T matrices, used in the factorization, and stored in T. |
[out] | info | INTEGER
|
magma_int_t magma_dtrevc3 | ( | magma_side_t | side, |
magma_vec_t | howmany, | ||
magma_int_t * | select, | ||
magma_int_t | n, | ||
double * | T, | ||
magma_int_t | ldt, | ||
double * | VL, | ||
magma_int_t | ldvl, | ||
double * | VR, | ||
magma_int_t | ldvr, | ||
magma_int_t | mm, | ||
magma_int_t * | mout, | ||
double * | work, | ||
magma_int_t | lwork, | ||
magma_int_t * | info | ||
) |
DTREVC3 computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T.
Matrices of this type are produced by the Schur factorization of a real general matrix: A = Q*T*Q**T, as computed by DHSEQR.
The right eigenvector x and the left eigenvector y of T corresponding to an eigenvalue w are defined by:
T*x = w*x, (y**T)*T = w*(y**T)
where y**T denotes the transpose of the vector y. The eigenvalues are not input to this routine, but are read directly from the diagonal blocks of T.
This routine returns the matrices X and/or Y of right and left eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y are the matrices of right and left eigenvectors of A.
This uses a Level 3 BLAS version of the back transformation.
[in] | side | magma_side_t
|
[in] | howmany | magma_vec_t
|
[in,out] | select | LOGICAL array, dimension (n) If howmany = MagmaSomeVec, select specifies the eigenvectors to be computed. If w(j) is a real eigenvalue, the corresponding real eigenvector is computed if select(j) is true. If w(j) and w(j+1) are the real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if either select(j) or select(j+1) is true, and on exit select(j) is set to true and select(j+1) is set to false. Not referenced if howmany = MagmaAllVec or MagmaBacktransVec. |
[in] | n | INTEGER The order of the matrix T. n >= 0. |
[in] | T | DOUBLE PRECISION array, dimension (ldt,n) The upper quasi-triangular matrix T in Schur canonical form. |
[in] | ldt | INTEGER The leading dimension of the array T. ldt >= max(1,n). |
[in,out] | VL | DOUBLE PRECISION array, dimension (ldvl,mm) On entry, if side = MagmaLeft or MagmaBothSides and howmany = MagmaBacktransVec, VL must contain an n-by-n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if side = MagmaLeft or MagmaBothSides, VL contains: if howmany = MagmaAllVec, the matrix Y of left eigenvectors of T; if howmany = MagmaBacktransVec, the matrix Q*Y; if howmany = MagmaSomeVec, the left eigenvectors of T specified by select, stored consecutively in the columns of VL, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part, and the second the imaginary part. Not referenced if side = MagmaRight. |
[in] | ldvl | INTEGER The leading dimension of the array VL. ldvl >= 1, and if side = MagmaLeft or MagmaBothSides, ldvl >= n. |
[in,out] | VR | DOUBLE PRECISION array, dimension (ldvr,mm) On entry, if side = MagmaRight or MagmaBothSides and howmany = MagmaBacktransVec, VR must contain an n-by-n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if side = MagmaRight or MagmaBothSides, VR contains: if howmany = MagmaAllVec, the matrix X of right eigenvectors of T; if howmany = MagmaBacktransVec, the matrix Q*X; if howmany = MagmaSomeVec, the right eigenvectors of T specified by select, stored consecutively in the columns of VR, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part and the second the imaginary part. Not referenced if side = MagmaLeft. |
[in] | ldvr | INTEGER The leading dimension of the array VR. ldvr >= 1, and if side = MagmaRight or MagmaBothSides, ldvr >= n. |
[in] | mm | INTEGER The number of columns in the arrays VL and/or VR. mm >= mout. |
[out] | mout | INTEGER The number of columns in the arrays VL and/or VR actually used to store the eigenvectors. If howmany = MagmaAllVec or MagmaBacktransVec, mout is set to n. Each selected real eigenvector occupies one column and each selected complex eigenvector occupies two columns. |
work | (workspace) DOUBLE PRECISION array, dimension (max(1,lwork)) | |
[in] | lwork | INTEGER The dimension of array work. lwork >= max(1,3*n). For optimum performance, lwork >= (1 + 2*nb)*n, where nb is the optimal blocksize. |
[out] | info | INTEGER
|
The algorithm used in this program is basically backward (forward) substitution, with scaling to make the the code robust against possible overflow.
Each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number (x,y) is taken to be |x| + |y|.
magma_int_t magma_dtrevc3_mt | ( | magma_side_t | side, |
magma_vec_t | howmany, | ||
magma_int_t * | select, | ||
magma_int_t | n, | ||
double * | T, | ||
magma_int_t | ldt, | ||
double * | VL, | ||
magma_int_t | ldvl, | ||
double * | VR, | ||
magma_int_t | ldvr, | ||
magma_int_t | mm, | ||
magma_int_t * | mout, | ||
double * | work, | ||
magma_int_t | lwork, | ||
magma_int_t * | info | ||
) |
DTREVC3_MT computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T.
Matrices of this type are produced by the Schur factorization of a real general matrix: A = Q*T*Q**T, as computed by DHSEQR.
The right eigenvector x and the left eigenvector y of T corresponding to an eigenvalue w are defined by:
T*x = w*x, (y**T)*T = w*(y**T)
where y**T denotes the transpose of the vector y. The eigenvalues are not input to this routine, but are read directly from the diagonal blocks of T.
This routine returns the matrices X and/or Y of right and left eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y are the matrices of right and left eigenvectors of A.
This uses a Level 3 BLAS version of the back transformation. This uses a multi-threaded (mt) implementation.
[in] | side | magma_side_t
|
[in] | howmany | magma_vec_t
|
[in,out] | select | LOGICAL array, dimension (n) If howmany = MagmaSomeVec, select specifies the eigenvectors to be computed. If w(j) is a real eigenvalue, the corresponding real eigenvector is computed if select(j) is true. If w(j) and w(j+1) are the real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if either select(j) or select(j+1) is true, and on exit select(j) is set to true and select(j+1) is set to false. Not referenced if howmany = MagmaAllVec or MagmaBacktransVec. |
[in] | n | INTEGER The order of the matrix T. n >= 0. |
[in] | T | DOUBLE PRECISION array, dimension (ldt,n) The upper quasi-triangular matrix T in Schur canonical form. |
[in] | ldt | INTEGER The leading dimension of the array T. ldt >= max(1,n). |
[in,out] | VL | DOUBLE PRECISION array, dimension (ldvl,mm) On entry, if side = MagmaLeft or MagmaBothSides and howmany = MagmaBacktransVec, VL must contain an n-by-n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if side = MagmaLeft or MagmaBothSides, VL contains: if howmany = MagmaAllVec, the matrix Y of left eigenvectors of T; if howmany = MagmaBacktransVec, the matrix Q*Y; if howmany = MagmaSomeVec, the left eigenvectors of T specified by select, stored consecutively in the columns of VL, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part, and the second the imaginary part. Not referenced if side = MagmaRight. |
[in] | ldvl | INTEGER The leading dimension of the array VL. ldvl >= 1, and if side = MagmaLeft or MagmaBothSides, ldvl >= n. |
[in,out] | VR | DOUBLE PRECISION array, dimension (ldvr,mm) On entry, if side = MagmaRight or MagmaBothSides and howmany = MagmaBacktransVec, VR must contain an n-by-n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by DHSEQR). On exit, if side = MagmaRight or MagmaBothSides, VR contains: if howmany = MagmaAllVec, the matrix X of right eigenvectors of T; if howmany = MagmaBacktransVec, the matrix Q*X; if howmany = MagmaSomeVec, the right eigenvectors of T specified by select, stored consecutively in the columns of VR, in the same order as their eigenvalues. A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive columns, the first holding the real part and the second the imaginary part. Not referenced if side = MagmaLeft. |
[in] | ldvr | INTEGER The leading dimension of the array VR. ldvr >= 1, and if side = MagmaRight or MagmaBothSides, ldvr >= n. |
[in] | mm | INTEGER The number of columns in the arrays VL and/or VR. mm >= mout. |
[out] | mout | INTEGER The number of columns in the arrays VL and/or VR actually used to store the eigenvectors. If howmany = MagmaAllVec or MagmaBacktransVec, mout is set to n. Each selected real eigenvector occupies one column and each selected complex eigenvector occupies two columns. |
work | (workspace) DOUBLE PRECISION array, dimension (max(1,lwork)) | |
[in] | lwork | INTEGER The dimension of array work. lwork >= max(1,3*n). For optimum performance, lwork >= (1 + 2*nb)*n, where nb is the optimal blocksize. |
[out] | info | INTEGER
|
The algorithm used in this program is basically backward (forward) substitution, with scaling to make the the code robust against possible overflow.
Each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number (x,y) is taken to be |x| + |y|.