09 May 2025 9:17:23.982 PM linpack_d_test(): FORTRAN90 version Test linpack_d(). TEST01 For real ( kind = rk8 ), general storage, DCHDC computes the Cholesky decomposition. The number of equations is N = 4 The matrix A: 2.00000 -1.00000 0.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 2.00000 Decompose the matrix. The Cholesky factor U: 1.41421 -0.707107 0.00000 0.00000 0.00000 1.22474 -0.816497 0.00000 0.00000 0.00000 1.15470 -0.866025 0.00000 0.00000 0.00000 1.11803 The product U' * U: 2.00000 -1.00000 0.00000 0.00000 -1.00000 2.00000 -1.00000 0.00000 0.00000 -1.00000 2.00000 -1.00000 0.00000 0.00000 -1.00000 2.00000 TEST02 For double precision real general storage, DCHEX can shift columns in a Cholesky factorization. The number of equations is N = 5 The matrix A: 2.00000 -1.00000 0.00000 0.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 0.00000 2.00000 The vector Z: 1.00000 2.00000 3.00000 4.00000 5.00000 Decompose the matrix. The Cholesky factor U: 1.41421 -0.707107 0.00000 0.00000 0.00000 0.00000 1.22474 -0.816497 0.00000 0.00000 0.00000 0.00000 1.15470 -0.866025 0.00000 0.00000 0.00000 0.00000 1.11803 -0.894427 0.00000 0.00000 0.00000 0.00000 1.09545 Right circular shift columns K = 1 through L = 3 Left circular shift columns K+1 = 2 through L = 3 The shifted Cholesky factor U: 1.41421 -0.707107 0.00000 -0.707107 0.00000 0.00000 -1.22474 0.816497 0.408248 -0.00000 0.00000 0.00000 1.15470 -0.288675 0.00000 0.00000 0.00000 0.00000 1.11803 -0.894427 0.00000 0.00000 0.00000 0.00000 1.09545 The shifted vector Z: 1.29479 -2.17020 2.75931 4.00000 5.00000 The shifted product U' * U: 2.00000 -1.00000 0.00000 -1.00000 0.00000 -1.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 -1.00000 2.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 -1.00000 2.00000 TEST03 For double precision real general storage, DCHUD updates a Cholesky decomposition. DTRSL can solve a triangular linear system. In this example, we use DCHUD to solve a least squares problem R * b = z. The number of equations is P = 20 Solution vector # 1 (Should be (1,2,3...,n)) 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 TEST04 For a banded matrix in general format, DGBCO estimates the reciprocal condition number. The matrix size is N = 10 The bandwidth of the matrix is 3 Estimate the condition. Estimated reciprocal condition = 0.233017E-01 TEST05 For a banded matrix in general format, DGBFA factors the matrix, DGBSL solves a factored linear system. The matrix size is N = 10 The bandwidth of the matrix is 3 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (All should be 1): 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 ...... .............. 6 1.00000 7 1.00000 8 1.00000 9 1.00000 10 1.00000 TEST06 For a banded matrix in general format, DGBFA factors the matrix, DGBDI computes the determinant as det = MANTISSA * 10**EXPONENT Find the determinant of the -1,2,-1 matrix for N = 2, 4, 8, 16, 32, 64, 128. (For this matrix, det ( A ) = N + 1.) The bandwidth of the matrix is 3 N Mantissa Exponent 2 3.00000 0.00000 4 5.00000 0.00000 8 9.00000 0.00000 16 1.70000 1.00000 32 3.30000 1.00000 64 6.50000 1.00000 128 1.29000 2.00000 TEST07 For a banded matrix in general format, DGBFA factors the matrix, DGBSL solves a factored linear system. The matrix size is N = 100 The bandwidth of the matrix is 51 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (All should be 1): 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 ...... .............. 96 1.00000 97 1.00000 98 1.00000 99 1.00000 100 1.00000 TEST08 DGECO factors a general matrix and computes its reciprocal condition number; DGESL solves a factored linear system. The matrix size is N = 3 Factor the matrix. The reciprocal matrix condition number = 0.246445E-01 Solve the linear system. Solution returned by DGESL (Should be (1,2,3)) 1.00000 2.00000 3.00000 Call DGESL for a new right hand side for the same, factored matrix. Solve a linear system. Solution returned by DGESL (should be (1,0,0)) 1.00000 0.00000 0.00000 Call DGESL for transposed problem. Call DGESL to solve a transposed linear system. Solution returned by DGESL (should be (-1,0,1)) -1.00000 -0.394746E-15 1.00000 TEST09 DGEFA factors a general matrix; DGEDI computes the inverse and determinant of a factored matrix. The matrix size is N = 3 Factor the matrix Get the inverse and determinant The determinant = 2.70000 * 10 ** 1.00000 The inverse matrix: -1.77778 0.888889 -0.111111 1.55556 -0.777778 0.222222 -0.111111 0.222222 -0.111111 TEST10 DGEFA factors a general matrix; DGESL solves a factored linear system; The number of equations is N = 3 The matrix A: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 0.00000 The right hand side B is 14.0000 32.0000 23.0000 Factor the matrix Solve the linear system. DGESL returns the solution: (Should be (1,2,3)) 1.00000 2.00000 3.00000 TEST11 DGEFA factors a general matrix; DGESL solves a factored linear system; The matrix size is N = 100 Factor the matrix. Solve the linear system. The first and last five solution entries: (All of them should be 1.) 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 ...... .............. 96 1.00000 97 1.00000 98 1.00000 99 1.00000 100 1.00000 TEST12 For a general tridiagonal matrix, DGTSL factors and solves a linear system. The matrix size is N = 100 Factor the matrix and solve the system. The first and last 5 solution entries: (Should be (1,2,3,4,5,...,n-1,n)) 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 96 96.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST13 For a positive definite symmetric band matrix, DPBCO estimates the reciprocal condition number. The matrix size is N = 10 Estimate the condition. Reciprocal condition = 0.204918E-01 TEST14 For a positive definite symmetric band matrix, DPBDI computes the determinant as det = MANTISSA * 10**EXPONENT Find the determinant of the -1,2,-1 matrix for N = 2, 4, 8, 16, 32, 64, 128. (For this matrix, det ( A ) = N + 1.) The bandwidth of the matrix is 3 N Mantissa Exponent 2 3.00000 0.00000 4 5.00000 0.00000 8 9.00000 0.00000 16 1.70000 1.00000 32 3.30000 1.00000 64 6.50000 1.00000 128 1.29000 2.00000 TEST15 For a positive definite symmetric band matrix, DPBFA computes the LU factors. DPBSL solves a factored linear system. The matrix size is N = 10 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (All should be 1): 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 1.00000 ...... .............. 6 1.00000 7 1.00000 8 1.00000 9 1.00000 10 1.00000 TEST16 For a positive definite symmetric matrix, DPOCO estimates the reciprocal condition number. The matrix size is N = 5 Estimate the condition. Reciprocal condition = 0.675676E-01 TEST17 For a positive definite symmetric matrix, DPOFA computes the LU factors, DPODI computes the inverse or determinant. The matrix size is N = 5 Factor the matrix. Get the determinant and inverse. Determinant = 6.00000 * 10 ** 0.00000 First row of inverse: 0.833333 0.666667 0.500000 0.333333 0.166667 TEST18 For a positive definite symmetric matrix, DPOFA computes the LU factors. DPOSL solves a factored linear system. The matrix size is N = 20 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (Should be 1,2,3,4,5,...,n-1,n): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 TEST19 For a positive definite symmetric packed matrix, DPPCO estimates the reciprocal condition number. The matrix size is N = 5 Estimate the condition number. Reciprocal condition number = 0.675676E-01 TEST20 For a positive definite symmetric packed matrix, DPPFA factors the matrix. DPPDI computes the inverse or determinant. The matrix size is N = 5 Factor the matrix. Get the determinant and inverse. Determinant = 6.00000 * 10 ** 0.00000 Inverse: 0.833333 0.666667 0.500000 0.333333 0.166667 0.666667 1.33333 1.00000 0.666667 0.333333 0.500000 1.00000 1.50000 1.00000 0.500000 0.333333 0.666667 1.00000 1.33333 0.666667 0.166667 0.333333 0.500000 0.666667 0.833333 TEST21 For a positive definite symmetric packed matrix, DPPFA factors the matrix. DPPSL solves a factored linear system. The matrix size is N = 20 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (Should be 1,2,3,4,5,...,n-1,n): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 TEST22 For a positive definite symmetric tridiagonal matrix, DPTSL factors and solves a linear system. The matrix size is N = 20 Factor the matrix and solve the system. The first and last 5 solution entries: (Should be 1,2,3,4,5,...,n-1,n): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 DQRDC_TEST DQRDC computes the QR decomposition of a rectangular matrix, but does not return Q and R explicitly. Show how Q and R can be recovered using DQRSL. The original matrix A: 1.00000 1.00000 0.00000 1.00000 0.00000 1.00000 0.00000 1.00000 1.00000 Decompose the matrix. The packed matrix A which describes Q and R: -1.41421 -0.707107 -0.707107 0.707107 1.22474 0.408248 0.00000 -0.816497 1.15470 The QRAUX vector, containing some additional information defining Q: 1.70711 1.57735 0.00000 The R factor: -1.41421 -0.707107 -0.707107 0.00000 1.22474 0.408248 0.00000 0.00000 1.15470 The Q factor: -0.707107 0.408248 -0.577350 -0.707107 -0.408248 0.577350 0.00000 0.816497 0.577350 The product Q * R: 1.00000 1.00000 -0.198977E-15 1.00000 -0.555112E-16 1.00000 0.00000 1.00000 1.00000 DQRSL_TEST DQRSL solves a rectangular linear system A*x=b in the least squares sense after A has been factored by DQRDC. The matrix A: 1.00000 1.00000 1.00000 1.00000 2.00000 4.00000 1.00000 3.00000 9.00000 1.00000 4.00000 16.0000 1.00000 5.00000 25.0000 Decompose the matrix. X X(expected): -3.02000 -3.02000 4.49143 4.49143 -0.728571 -0.728571 TEST24 For a symmetric indefinite matrix, DSICO estimates the reciprocal condition number. The matrix size is N = 100 Estimate the condition. Estimated reciprocal condition = 0.245050E-03 TEST25 For a symmetric indefinite matrix, DSIFA factors the matrix, DSISL solves a factored linear system, The matrix size is N = 100 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (Should be (1,2,3,4,5,...,n-1,n)) 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 96 96.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST26 For a symmetric indefinite packed matrix, DSPCO estimates the reciprocal condition number. The matrix size is N = 100 Estimate the condition. Estimated reciprocal condition = 0.245050E-03 TEST27 For a symmetric indefinite packed matrix, DSPFA factors the matrix, DSPSL solves a factored linear system. The matrix size is N = 100 Factor the matrix. Solve the linear system. The first and last 5 solution entries: (Should be (1,2,3,4,5,...,n-1,n)) 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 ...... .............. 96 96.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 DSVDC_TEST For an MxN matrix A in general storage, DSVDC computes the singular value decomposition: A = U * S * V' Matrix rows M = 6 Matrix columns N = 4 The matrix A: 0.5874 0.9428 0.1910 0.1791 0.2972 0.4485 0.6036 0.4092 0.8072 0.2819 0.4716 0.6556 0.1398 0.9928 0.7138 0.1501 0.8127 0.2964 0.2948 0.8781 0.4346 0.1634 0.5815 0.9996 Decompose the matrix. Singular values: 1 2.53405 2 1.14786 3 0.642202 4 0.228433 Left Singular Vector Matrix U: -0.3693 -0.4486 0.6176 0.2837 -0.4356 -0.1034 -0.3415 -0.1166 -0.3466 -0.3050 -0.0893 -0.8054 -0.4434 0.2414 0.1943 -0.7384 -0.1651 0.3673 -0.3753 -0.6586 -0.3854 0.0124 0.3692 0.3747 -0.4642 0.3659 0.3225 0.2503 0.6760 -0.1646 -0.4405 0.3991 -0.4563 0.4675 -0.4263 0.1956 Right Singular Vector Matrix V: -0.5120 0.2399 0.6643 -0.4889 -0.4769 -0.7731 0.1869 0.3741 -0.4525 -0.1501 -0.6928 -0.5411 -0.5528 0.5676 -0.2095 0.5730 The product U * S * V' (should equal A): 0.5874 0.9428 0.1910 0.1791 0.2972 0.4485 0.6036 0.4092 0.8072 0.2819 0.4716 0.6556 0.1398 0.9928 0.7138 0.1501 0.8127 0.2964 0.2948 0.8781 0.4346 0.1634 0.5815 0.9996 DTRCO_TEST DTRCO computes the LU factors of a triangular matrix, and its reciprocal condition number. The matrix size is N = 5 Lower triangular matrix A: 0.302048E-01 0.00000 0.00000 0.00000 0.00000 0.569517 0.979770 0.00000 0.00000 0.00000 0.657535 0.379377 0.743706 0.00000 0.00000 0.882185 0.133685 0.457762E-01 0.789949 0.00000 0.180436 0.911120 0.834974 0.764356 0.933057 Estimate the condition: The reciprocal condition number = 0.268945E-02 Upper triangular matrix A: 0.616906 0.239080 0.880435 0.532262 0.582614 0.00000 0.721186E-01 0.716378 0.196339 0.603031 0.00000 0.00000 0.596272 0.402184 0.562706 0.00000 0.00000 0.00000 0.909796 0.232557 0.00000 0.00000 0.00000 0.00000 0.818246E-01 Estimate the condition: The reciprocal condition number = 0.247366E-01 DTRDI_TEST DTRDI computes the determinant or inverse of a triangular matrix. The matrix size is N = 5 Lower triangular matrix A: 0.853554 0.00000 0.00000 0.00000 0.00000 0.820770 0.728059 0.00000 0.00000 0.00000 0.691946 0.139126 0.825630 0.00000 0.00000 0.730267 0.945883 0.318448E-01 0.140681 0.00000 0.967353 0.216692 0.576895 0.264772 0.656850E-01 The determinant = 4.74117 * 10 ** -3.00000 The inverse matrix: 1.17157 0.00000 0.00000 0.00000 0.00000 -1.32076 1.37351 0.00000 0.00000 0.00000 -0.759314 -0.231450 1.21120 0.00000 0.00000 2.97057 -9.18257 -0.274168 7.10828 0.00000 -18.2021 34.5159 -9.53247 -28.6530 15.2242 Upper triangular matrix A: 0.583188 0.273585 0.134777 0.778646 0.921572 0.00000 0.433710E-01 0.266096 0.894183E-01 0.190100E-01 0.00000 0.00000 0.990182 0.318013 0.842288 0.00000 0.00000 0.00000 0.344415 0.927456 0.00000 0.00000 0.00000 0.00000 0.775774 The determinant = 6.69174 * 10 ** -3.00000 The inverse matrix: 1.71471 -10.8165 2.67336 -3.53681 -0.446155 0.00000 23.0569 -6.19618 -0.264917 6.47915 0.00000 0.00000 1.00992 -0.932500 0.183215E-01 0.00000 0.00000 0.00000 2.90348 -3.47118 0.00000 0.00000 0.00000 0.00000 1.28904 DTRSL_TEST DTRSL solves a linear system with a triangular matrix. The matrix size is N = 5 For a lower triangular matrix A, solve A * x = b The solution (should be 1,2,3,4,5): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 For a lower triangular matrix A, solve A' * x = b The solution (should be 1,2,3,4,5): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 For an upper triangular matrix A, solve A * x = b The solution (should be 1,2,3,4,5): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 For an upper triangular matrix A, solve A' * x = b The solution (should be 1,2,3,4,5): 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 linpack_d_test(): Normal end of execution. 09 May 2025 9:17:23.985 PM