Last active
May 10, 2021 17:41
-
-
Save weslleyspereira/0587d103761e3aee36163e00d753de49 to your computer and use it in GitHub Desktop.
Test for Lapack DGESVDX with RANGE='I'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROGRAM testSVD | |
IMPLICIT NONE | |
INTEGER M, N, LDA, LDU, LDVT, NS, LWORK, INFO | |
PARAMETER ( M = 5, N = 5, LDA = 10, LDU = 10, LDVT = 10 ) | |
INTEGER IWORK( 12*MIN(M,N) ) | |
DOUBLE PRECISION A( LDA, N ), S( MIN(M,N) ), | |
$ U( LDU, N ), VT( LDVT, N ), WORK( 2000 ) | |
EXTERNAL SGGQRCS | |
CALL DGESVDX( 'V', 'V', 'I', M, N, A, LDA, WORK(1), WORK(1), | |
$ 1, 5, NS, S, U, LDU, VT, LDVT, | |
$ WORK, -1, IWORK, INFO ) | |
LWORK = INT(WORK(1)) | |
WRITE(*,*) "LWORK = ", LWORK | |
A = 0.0 | |
A(1,1) = 1.0D0 | |
A(2,2) = 2.0D0 | |
A(3,3) = 3.0D0 | |
A(4,4) = 4.0D0 | |
A(5,5) = 5.0D0 | |
CALL DGESVDX( 'V', 'V', 'I', M, N, A, LDA, WORK(1), WORK(1), | |
$ 2, 4, NS, S, U, LDU, VT, LDVT, | |
$ WORK, LWORK, IWORK, INFO ) | |
WRITE(*,*) "NS = ", NS | |
WRITE(*,*) "S = ", S | |
END PROGRAM testSVD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment