20180309 134600.190 LAPACK_EXAMPLES_TEST FORTRAN77 version Test the LAPACK library. TEST01 For a double precision real matrix (D) in general band storage mode (GB): DGBTRF factors a general band matrix. DGBTRS solves a factored system. Bandwidth is 3 Partial solution (all should be 1) 1 1.00000 2 1.00000 3 1.00000 ...... .............. 25 1.00000 TEST02 For a double precision real matrix (D) in general band storage mode (GB): DGBTRF factors a general band matrix. DGBTRS solves a factored system. Bandwidth is 7 Partial solution (all should be 1) 1 1.00000 2 1.00000 3 1.00000 ...... .............. 25 1.00000 TEST03 For a double precision real matrix (D) in general storage mode (GE): DGETRF computes the LU factorization; DGECON computes the condition number of a factored matrix The matrix A: Col 1 2 3 Row 1 1. 2. 3. 2 4. 5. 6. 3 7. 8. 0. Matrix L-infinity norm is 15.0000 Matrix reciprocal condition number = 0.240000E-01 TEST04 For a double precision real matrix (D) in general storage mode (GE): DGESVD computes the singular value decomposition: A = U * S * V' The matrix A: Col 1 2 3 4 Row 1 0.218418 0.257578 0.401306 0.945448E-01 2 0.956318 0.109957 0.754673 0.136169E-01 3 0.829509 0.438290E-01 0.797287 0.859097 4 0.561695 0.633966 0.183837E-02 0.840847 5 0.415307 0.617272E-01 0.897504 0.123104 6 0.661187E-01 0.449539 0.350752 0.751236E-02 Singular values 1 2.2289838 2 1.0317514 3 0.60630364 4 0.44109794 Left singular vectors U: Col 1 2 3 4 5 Row 1 -0.214893 0.702687E-01 -0.351627 0.141528 -0.663582 2 -0.493857 0.399434 -0.408471E-01 -0.765911 -0.201888E-01 3 -0.621035 -0.122005 0.541178 0.351135 -0.300880 4 -0.378730 -0.803888 -0.211678 -0.195040 0.293355 5 -0.394186 0.417037 -0.113540 0.424627 0.612954 6 -0.159444 0.217747E-01 -0.723960 0.227388 -0.833789E-01 Col 6 Row 1 -0.604045 2 0.886624E-01 3 0.304520 4 -0.203526 5 -0.319037 6 0.625563 Right singular vectors V': Col 1 2 3 4 Row 1 -0.637670 -0.212197 -0.612157 -0.416669 2 0.186361E-01 -0.404587 0.593962 -0.695105 3 0.196482 -0.887338 -0.159466 0.385482 4 -0.744597 -0.625492E-01 0.497035 0.441157 The product U * S * V': Col 1 2 3 4 Row 1 0.218418 0.257578 0.401306 0.945448E-01 2 0.956318 0.109957 0.754673 0.136169E-01 3 0.829509 0.438290E-01 0.797287 0.859097 4 0.561695 0.633966 0.183837E-02 0.840847 5 0.415307 0.617272E-01 0.897504 0.123104 6 0.661187E-01 0.449539 0.350752 0.751236E-02 TEST05 For a double precision real matrix (D) in general storage mode (GE): DGETRF factors a general matrix; DGETRI computes the inverse. The matrix A: Col 1 2 3 Row 1 1. 2. 3. 2 4. 5. 6. 3 7. 8. 0. The inverse matrix: Col 1 2 3 Row 1 -1.77778 0.888889 -0.111111 2 1.55556 -0.777778 0.222222 3 -0.111111 0.222222 -0.111111 TEST06 For a double precision real matrix (D) in general storage mode (GE): DGETRF computes the LU factorization; DGETRS solves linear systems using the LU factors; The matrix A: Col 1 2 3 Row 1 1. 2. 3. 2 4. 5. 6. 3 7. 8. 0. Right hand side B 1 14.000000 2 32.000000 3 23.000000 The solution X 1 1.0000000 2 2.0000000 3 3.0000000 TEST07 For a double precision real matrix (D) in general storage mode (GE): DGETRF factors a general matrix; DGETRS solves a linear system; Partial solution (all should be 1) 1 1.00000 2 1.00000 3 1.00000 ...... .............. 25 1.00000 TEST08 For a double precision real matrix (D) in general tridiagonal storage mode (GT): DGTSV factors and solves a linear system with a general tridiagonal matrix. The system is of order N = 100 Partial solution (Should be 1,2,3...) 1 1.00000 2 2.00000 3 3.00000 ...... .............. 100 100.000 TEST09 For a double precision real matrix (D) in positive definite band storage mode (PB): DPBTRF computes the lower Cholesky factor A = L*L' or the upper Cholesky factor A = U'*U; The lower Cholesky factor L: 1.414214 0.000000 0.000000 0.000000 0.000000 -0.707107 1.224745 0.000000 0.000000 0.000000 0.000000 -0.816497 1.154701 0.000000 0.000000 0.000000 0.000000 -0.866025 1.118034 0.000000 0.000000 0.000000 0.000000 -0.894427 1.095445 TEST10 For a double precision real matrix (D) in positive definite band storage mode (PB): For a positive definite symmetric band matrix: DPBTRF factors; DPBTRS solves linear systems. Partial solution (all should be 1) 1 1.00000 2 1.00000 3 1.00000 ...... .............. 25 1.00000 TEST11 For a double precision real matrix (D) in positive definite storage mode (PO): DPOTRF computes the Cholesky factor A = R'*R; DPOTRI computes the inverse. The matrix A: Col 1 2 3 4 5 Row 1 2. -1. 0. 0. 0. 2 -1. 2. -1. 0. 0. 3 0. -1. 2. -1. 0. 4 0. 0. -1. 2. -1. 5 0. 0. 0. -1. 2. The Cholesky factor R: Col 1 2 3 4 5 Row 1 1.41421 -0.707107 0. 0. 0. 2 0. 1.22474 -0.816497 0. 0. 3 0. 0. 1.15470 -0.866025 0. 4 0. 0. 0. 1.11803 -0.894427 5 0. 0. 0. 0. 1.09545 The product R' * R Col 1 2 3 4 5 Row 1 2.00000 -1.86603 0.577350 0. 0. 2 0. 1.50000 -1.94281 0.707107 0. 3 0. 0. 1.33333 -1.96825 0.774597 4 0. 0. 0. 1.25000 -1.97980 5 0. 0. 0. 0. 1.20000 The inverse matrix B: Col 1 2 3 4 5 Row 1 0.833333 0.666667 0.500000 0.333333 0.166667 2 0.666667 1.33333 1.00000 0.666667 0.333333 3 0.500000 1.00000 1.50000 1. 0.500000 4 0.333333 0.666667 1. 1.33333 0.666667 5 0.166667 0.333333 0.500000 0.666667 0.833333 The product B * A Col 1 2 3 4 5 Row 1 1.00000 0.222045E-15 0. -0.111022E-15 0. 2 -0.666134E-15 1.00000 0.222045E-15 -0.166533E-15 -0.111022E-15 3 -0.666134E-15 0.111022E-14 1.00000 -0.222045E-15 0. 4 -0.444089E-15 0.666134E-15 0. 1.00000 0. 5 -0.166533E-15 0.222045E-15 0. -0.222045E-15 1. TEST12 For a double precision real matrix (D) in general storage mode (GE): DGEQRF computes the QR factorization: A = Q * R DORGQR computes the explicit form of the Q factor. In this case, our M x N matrix A has more rows than columns: M = 8 N = 6 The matrix A: Col 1 2 3 4 5 Row 1 0.218418 0.438290E-01 0.897504 0.260303 0.861216 2 0.956318 0.633966 0.350752 0.912484 0.453794 3 0.829509 0.617272E-01 0.945448E-01 0.113664 0.911977 4 0.561695 0.449539 0.136169E-01 0.351629 0.597917 5 0.415307 0.401306 0.859097 0.822887 0.188955 6 0.661187E-01 0.754673 0.840847 0.267132 0.761492 7 0.257578 0.797287 0.123104 0.692066 0.396988 8 0.109957 0.183837E-02 0.751236E-02 0.561662 0.185314 Col 6 Row 1 0.574366 2 0.367027 3 0.617205 4 0.361529 5 0.212930 6 0.714471 7 0.117707 8 0.299329 The Q factor: Col 1 2 3 4 5 Row 1 -0.146556 0.816117E-01 0.701174 -0.252365E-01 0.399449 2 -0.641676 -0.521467E-01 -0.116738 0.157662 -0.378612 3 -0.556589 0.406950 -0.288622E-01 -0.372796 0.266842 4 -0.376890 -0.102116 -0.266807 -0.158326 0.191974 5 -0.278665 -0.139347 0.471131 0.374119 -0.457546 6 -0.443647E-01 -0.662038 0.309917 -0.410973 0.122537 7 -0.172831 -0.594385 -0.323532 0.193281 0.263255 8 -0.737795E-01 0.598201E-01 -0.478578E-02 0.681352 0.543477 Col 6 Row 1 0.417974 2 -0.153778 3 -0.671006E-01 4 0.555294E-01 5 0.729012E-01 6 -0.523606 7 0.533219 8 -0.479858 The R factor: Col 1 2 3 4 5 Row 1 -1.49034 -0.900250 -0.712893 -1.22167 -1.31907 2 0. -1.07960 -0.657066 -0.685264 -0.398652 3 0. 0. 1.20747 0.222782 0.560734 4 0. 0. 0. 0.753777 -0.424101 5 0. 0. 0. 0. 0.742417 6 0. 0. 0. 0. 0. Col 6 Row 1 -0.932936 2 -0.312746 3 0.527843 4 -0.231228 5 0.508359 6 -0.277161 The product Q * R: Col 1 2 3 4 5 Row 1 0.218418 0.438290E-01 0.897504 0.260303 0.861216 2 0.956318 0.633966 0.350752 0.912484 0.453794 3 0.829509 0.617272E-01 0.945448E-01 0.113664 0.911977 4 0.561695 0.449539 0.136169E-01 0.351629 0.597917 5 0.415307 0.401306 0.859097 0.822887 0.188955 6 0.661187E-01 0.754673 0.840847 0.267132 0.761492 7 0.257578 0.797287 0.123104 0.692066 0.396988 8 0.109957 0.183837E-02 0.751236E-02 0.561662 0.185314 Col 6 Row 1 0.574366 2 0.367027 3 0.617205 4 0.361529 5 0.212930 6 0.714471 7 0.117707 8 0.299329 TEST13 For a double precision real matrix (D) in general storage mode (GE): DGEQRF computes the QR factorization: A = Q * R DORGQR computes the explicit form of the Q factor. In this case, our M x N matrix A has more rows than columns: M = 8 N = 6 Normally, LAPACK will only return an M x min(M,N) portion of Q. When N .lt. M, we lose information. Here, we force the computation of the full Q by making a copy of A with N-M extra zero columns. The matrix A: Col 1 2 3 4 5 Row 1 0.218418 0.438290E-01 0.897504 0.260303 0.861216 2 0.956318 0.633966 0.350752 0.912484 0.453794 3 0.829509 0.617272E-01 0.945448E-01 0.113664 0.911977 4 0.561695 0.449539 0.136169E-01 0.351629 0.597917 5 0.415307 0.401306 0.859097 0.822887 0.188955 6 0.661187E-01 0.754673 0.840847 0.267132 0.761492 7 0.257578 0.797287 0.123104 0.692066 0.396988 8 0.109957 0.183837E-02 0.751236E-02 0.561662 0.185314 Col 6 Row 1 0.574366 2 0.367027 3 0.617205 4 0.361529 5 0.212930 6 0.714471 7 0.117707 8 0.299329 The Q factor: Col 1 2 3 4 5 Row 1 -0.146556 0.816117E-01 0.701174 -0.252365E-01 0.399449 2 -0.641676 -0.521467E-01 -0.116738 0.157662 -0.378612 3 -0.556589 0.406950 -0.288622E-01 -0.372796 0.266842 4 -0.376890 -0.102116 -0.266807 -0.158326 0.191974 5 -0.278665 -0.139347 0.471131 0.374119 -0.457546 6 -0.443647E-01 -0.662038 0.309917 -0.410973 0.122537 7 -0.172831 -0.594385 -0.323532 0.193281 0.263255 8 -0.737795E-01 0.598201E-01 -0.478578E-02 0.681352 0.543477 Col 6 7 8 Row 1 0.417974 -0.380489 -0.233557E-01 2 -0.153778 -0.537483 -0.301936 3 -0.671006E-01 0.495156 -0.252792 4 0.555294E-01 -0.146356 0.830612 5 0.729012E-01 0.504083 0.268768 6 -0.523606 0.311034E-01 -0.681440E-01 7 0.533219 0.209249 -0.278200 8 -0.479858 0.298091E-01 0.139369E-01 The R factor: Col 1 2 3 4 5 Row 1 -1.49034 -0.900250 -0.712893 -1.22167 -1.31907 2 0. -1.07960 -0.657066 -0.685264 -0.398652 3 0. 0. 1.20747 0.222782 0.560734 4 0. 0. 0. 0.753777 -0.424101 5 0. 0. 0. 0. 0.742417 6 0. 0. 0. 0. 0. 7 0. 0. 0. 0. 0. 8 0. 0. 0. 0. 0. Col 6 Row 1 -0.932936 2 -0.312746 3 0.527843 4 -0.231228 5 0.508359 6 -0.277161 7 0. 8 0. The product Q * R: Col 1 2 3 4 5 Row 1 0.218418 0.438290E-01 0.897504 0.260303 0.861216 2 0.956318 0.633966 0.350752 0.912484 0.453794 3 0.829509 0.617272E-01 0.945448E-01 0.113664 0.911977 4 0.561695 0.449539 0.136169E-01 0.351629 0.597917 5 0.415307 0.401306 0.859097 0.822887 0.188955 6 0.661187E-01 0.754673 0.840847 0.267132 0.761492 7 0.257578 0.797287 0.123104 0.692066 0.396988 8 0.109957 0.183837E-02 0.751236E-02 0.561662 0.185314 Col 6 7 8 Row 1 0.574366 0. 0. 2 0.367027 0. 0. 3 0.617205 0. 0. 4 0.361529 0. 0. 5 0.212930 0. 0. 6 0.714471 0. 0. 7 0.117707 0. 0. 8 0.299329 0. 0. TEST14 For a double precision real matrix (D) in general storage mode (GE): DGEQRF computes the QR factorization: A = Q * R DORGQR computes the explicit form of the Q factor. In this case, our M x N matrix A has more columns than rows: M = 6 N = 8 The matrix A: Col 1 2 3 4 5 Row 1 0.218418 0.257578 0.401306 0.945448E-01 0.260303 2 0.956318 0.109957 0.754673 0.136169E-01 0.912484 3 0.829509 0.438290E-01 0.797287 0.859097 0.113664 4 0.561695 0.633966 0.183837E-02 0.840847 0.351629 5 0.415307 0.617272E-01 0.897504 0.123104 0.822887 6 0.661187E-01 0.449539 0.350752 0.751236E-02 0.267132 Col 6 7 8 Row 1 0.692066 0.188955 0.617205 2 0.561662 0.761492 0.361529 3 0.861216 0.396988 0.212930 4 0.453794 0.185314 0.714471 5 0.911977 0.574366 0.117707 6 0.597917 0.367027 0.299329 The Q factor: Col 1 2 3 4 5 Row 1 -0.149214 0.272403 0.306789 -0.648155E-01 0.271038 2 -0.653315 -0.225684 -0.135212 -0.704057 0.619413E-01 3 -0.566685 -0.267591 0.479507E-01 0.649387 0.413043 4 -0.383726 0.660900 -0.496248 0.205482 -0.355872 5 -0.283720 -0.785339E-01 0.651690 0.105538 -0.690294 6 -0.451695E-01 0.600252 0.462966 -0.158238 0.385936 Col 6 Row 1 -0.855424 2 0.665723E-01 3 0.112500 4 -0.289077E-01 5 0.314898E-01 6 0.499334 The R factor: Col 1 2 3 4 5 Row 1 -1.46379 -0.416196 -1.27592 -0.867762 -1.07986 2 0. 0.717598 -0.133077 0.343352 0.162673 3 0. 0. 0.805674 -0.265207 0.447375 4 0. 0. 0. 0.726753 -0.468671 5 0. 0. 0. 0. -0.416053 6 0. 0. 0. 0. 0. Col 6 7 8 Row 1 -1.41813 -1.00130 -0.770029 2 0.418501 0.710603E-01 0.672182 3 0.823617 0.426310 0.114112E-01 4 0.213845 -0.249963 -0.443991E-01 5 0.178177E-01 -0.584259E-01 0.576377E-01 6 -0.143572 0.129718 -0.347431 The product Q*R Col 1 2 3 4 5 Row 1 0.218418 0.257578 0.401306 0.945448E-01 0.260303 2 0.956318 0.109957 0.754673 0.136169E-01 0.912484 3 0.829509 0.438290E-01 0.797287 0.859097 0.113664 4 0.561695 0.633966 0.183837E-02 0.840847 0.351629 5 0.415307 0.617272E-01 0.897504 0.123104 0.822887 6 0.661187E-01 0.449539 0.350752 0.751236E-02 0.267132 Col 6 7 8 Row 1 0.692066 0.188955 0.617205 2 0.561662 0.761492 0.361529 3 0.861216 0.396988 0.212930 4 0.453794 0.185314 0.714471 5 0.911977 0.574366 0.117707 6 0.597917 0.367027 0.299329 TEST15 For a double precision real matrix (D) in symmetric band storage mode (SB): For a symmetric banded NxN matrix A, and a symmetric banded positive definite NxN matrix B, DSBGVX solves the generalized eigenvalue problem A * X = LAMBDA * B * X Computed eigenvalues 1 1.0581164 Computed eigenvalues 1 4.7709121 TEST16 For a double precision real matrix (D) in symmetric storage mode (SY): For a symmetric matrix in general storage, DSYEV computes eigenvalues and eigenvectors; The matrix A: Col 1 2 3 4 5 Row 1 0. 2.44949 0. 0. 0. 2 2.44949 0. 3.16228 0. 0. 3 0. 3.16228 0. 3.46410 0. 4 0. 0. 3.46410 0. 3.46410 5 0. 0. 0. 3.46410 0. 6 0. 0. 0. 0. 3.16228 7 0. 0. 0. 0. 0. Col 6 7 Row 1 0. 0. 2 0. 0. 3 0. 0. 4 0. 0. 5 3.16228 0. 6 0. 2.44949 7 2.44949 0. The eigenvalues: 1 -6.0000000 2 -4.0000000 3 -2.0000000 4 -0.67072288E-15 5 2.0000000 6 4.0000000 7 6.0000000 The eigenvector matrix: Col 1 2 3 4 5 Row 1 -0.125000 0.306186 0.484123 -0.559017 -0.484123 2 0.306186 -0.500000 -0.395285 -0.315775E-15 -0.395285 3 -0.484123 0.395285 -0.125000 0.433013 0.125000 4 0.559017 0.336779E-15 0.433013 -0.862557E-16 0.433013 5 -0.484123 -0.395285 -0.125000 -0.433013 0.125000 6 0.306186 0.500000 -0.395285 0.157289E-15 -0.395285 7 -0.125000 -0.306186 0.484123 0.559017 -0.484123 Col 6 7 Row 1 -0.306186 0.125000 2 -0.500000 0.306186 3 -0.395285 0.484123 4 0.104083E-16 0.559017 5 0.395285 0.484123 6 0.500000 0.306186 7 0.306186 0.125000 TEST17 Call the standard LAPACK routine DGEQRF to get the QR factorization of a matrix stored in GE format. Input matrix: Col 1 2 3 4 5 Row 1 2. -1. 0. 0. 0. 2 -1. 2. -1. 0. 0. 3 0. -1. 2. -1. 0. 4 0. 0. -1. 2. -1. 5 0. 0. 0. -1. 2. DGEQRF called successfully. Factored matrix: Col 1 2 3 4 5 Row 1 -2.23607 1.78885 -0.447214 0. 0. 2 -0.236068 -1.67332 1.91237 -0.597614 0. 3 0. -0.331679 -1.46385 1.95180 -0.683130 4 0. 0. -0.394805 -1.35401 1.96946 5 0. 0. 0. -0.441135 0.809040 Tau: 1 1.8944272 2 1.8017837 3 1.7302967 4 1.6741999 5 0.0000000 DGEQRS called successfully. Solution from DGEQRS: 1.00000 2.00000 3.00000 4.00000 5.00000 LAPACK_EXAMPLES_TEST Normal end of execution. 20180309 134600.192