03-Jun-2024 13:35:27 linpack_d_test(): MATLAB/Octave version 6.4.0 Test linpack_d(). TEST01 For double precision, general storage, DCHDC computes the Cholesky decomposition. The number of equations is N = 4 The matrix A: 2.000000 -1.000000 0.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 2.000000 Decompose the matrix. The Cholesky factor U: 1.414214 -0.707107 0.000000 0.000000 0.000000 1.224745 -0.816497 0.000000 0.000000 0.000000 1.154701 -0.866025 0.000000 0.000000 0.000000 1.118034 The product U' * U: 2.000000 -1.000000 0.000000 0.000000 -1.000000 2.000000 -1.000000 0.000000 0.000000 -1.000000 2.000000 -1.000000 0.000000 0.000000 -1.000000 2.000000 TEST02 For double precision, general storage, DCHEX can shift columns in a Cholesky factorization. The number of equations is N = 5 The matrix A: 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 2.000000 The vector Z: 1.000000 2.000000 3.000000 4.000000 5.000000 Decompose the matrix. The Cholesky factor U: 1.414214 -0.707107 0.000000 0.000000 0.000000 0.000000 1.224745 -0.816497 0.000000 0.000000 0.000000 0.000000 1.154701 -0.866025 0.000000 0.000000 0.000000 0.000000 1.118034 -0.894427 0.000000 0.000000 0.000000 0.000000 1.095445 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.414214 -0.707107 0.000000 -0.707107 0.000000 0.000000 -1.224745 0.816497 0.408248 -0.000000 0.000000 0.000000 1.154701 -0.288675 0.000000 0.000000 0.000000 0.000000 1.118034 -0.894427 0.000000 0.000000 0.000000 0.000000 1.095445 The shifted vector Z: 1.294789 -2.170197 2.759306 4.000000 5.000000 The shifted product U' * U: 2.000000 -1.000000 0.000000 -1.000000 0.000000 -1.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 -1.000000 2.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 2.000000 -1.000000 0.000000 0.000000 0.000000 -1.000000 2.000000 TEST03 For double precision, general storage, DCHUD updates a Cholesky decomposition. 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.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 16 16.000000 17 17.000000 18 18.000000 19 19.000000 20 20.000000 TEST04 For a general banded matrix, 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.023302 TEST05 For a general banded matrix, 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 entries of the solution: (All should be 1): 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 ...... .............. 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 TEST06 For a general banded matrix, 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.000000 0.000000 4 5.000000 0.000000 8 9.000000 0.000000 16 1.700000 1.000000 32 3.300000 1.000000 64 6.500000 1.000000 128 1.290000 2.000000 TEST07 For a general banded matrix, 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 entries of the solution: (All should be 1): 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 ...... .............. 96 1.000000 97 1.000000 98 1.000000 99 1.000000 100 1.000000 TEST08 For a general matrix, DGECO computes the LU factors 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.024645 Solve the linear system. Solution returned by DGESL (Should be (1,1,1)) 1.000000 1.000000 1.000000 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.000000 0.000000 0.000000 Call DGESL for transposed problem. Call DGESL to solve a transposed linear system. Solution returned by DGESL (should be (-1,0,1)) -1.000000 -0.000000 1.000000 TEST09 For a general matrix, DGEFA computes the LU factors; 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.700000 * 10 ^ 1.000000 The inverse matrix: -1.777778 0.888889 -0.111111 1.555556 -0.777778 0.222222 -0.111111 0.222222 -0.111111 TEST10 For a general matrix, DGEFA computes the LU factors; DGESL solves a factored linear system; The number of equations is N = 3 The matrix A: 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 The right hand side B is 6.000000 15.000000 15.000000 Factor the matrix Solve the linear system. DGESL returns the solution: (Should be (1,1,1)) 1.000000 1.000000 1.000000 TEST11 For a general matrix, DGEFA computes the LU factors; DGESL solves a factored linear system; The matrix size is N = 100 Factor the matrix Solve the linear system. The first and last five entries of the solution: (All of them should be 1.) 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 ...... .............. 96 1.000000 97 1.000000 98 1.000000 99 1.000000 100 1.000000 dgtsl_test 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 entries of the solution: (Should be 1,2,3,4,5,...,n,n-1): 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 96 96.000000 97 97.000000 98 98.000000 99 99.000000 100 100.000000 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.020492 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.000000 0.000000 4 5.000000 0.000000 8 9.000000 0.000000 16 1.700000 1.000000 32 3.300000 1.000000 64 6.500000 1.000000 128 1.290000 2.000000 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 entries of the solution: (All should be 1): 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 ...... .............. 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 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.067568 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.000000 * 10 ^ 0.000000 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 five entries of the solution: (Should be 1,2,3,4,5,...,n-1,n.) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 16 16.000000 17 17.000000 18 18.000000 19 19.000000 20 20.000000 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.067568 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.000000 * 10 ^ 0.000000 Inverse: 0.833333 0.666667 0.500000 0.333333 0.166667 0.666667 1.333333 1.000000 0.666667 0.333333 0.500000 1.000000 1.500000 1.000000 0.500000 0.333333 0.666667 1.000000 1.333333 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 five entries of the solution: (Should be 1,2,3,4,5,...,n-1,n.) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 16 16.000000 17 17.000000 18 18.000000 19 19.000000 20 20.000000 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 five entries of the solution: (Should be 1,2,3,4,5,...,n-1,n): 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 16 16.000000 17 17.000000 18 18.000000 19 19.000000 20 20.000000 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 SQRSL. The original matrix A: 1.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 Decompose the matrix. The packed matrix A which describes Q and R: -1.414214 -0.707107 -0.707107 0.707107 1.224745 0.408248 0.000000 -0.816497 1.154701 The QRAUX vector, containing some additional information defining Q: 1.707107 1.577350 0.000000 The R factor: -1.414214 -0.707107 -0.707107 0.000000 1.224745 0.408248 0.000000 0.000000 1.154701 The Q factor: -0.707107 0.408248 -0.577350 -0.707107 -0.408248 0.577350 0.000000 0.816497 0.577350 The product Q * R: 1.000000 1.000000 -0.000000 1.000000 -0.000000 1.000000 0.000000 1.000000 1.000000 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.000000 1.000000 1.000000 1.000000 2.000000 4.000000 1.000000 3.000000 9.000000 1.000000 4.000000 16.000000 1.000000 5.000000 25.000000 Decompose the matrix. X X(expected): -3.02 -3.02 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.000245 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 five entries of the solution: (Should be 1,2,3,4,5,...,n-1,n): 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 96 96.000000 97 97.000000 98 98.000000 99 99.000000 100 100.000000 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.000245 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 five entries of the solution: (Should be 1,2,3,4,5,...,n-1,n): 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 ...... .............. 96 96.000000 97 97.000000 98 98.000000 99 99.000000 100 100.000000 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.452347 0.099396 0.464723 0.375515 0.996976 0.714731 0.988093 0.329540 0.805066 0.699374 0.826326 0.466844 0.529437 0.653108 0.489825 0.469243 0.687683 0.441885 0.918780 0.069247 0.889287 0.419631 0.648995 0.070646 Decompose the matrix. Singular values: 1 2.976541 2 0.516445 3 0.306378 4 0.236725 Left Singular Vector Matrix U: -0.233370 -0.131649 0.945662 -0.083536 -0.064577 -0.150939 -0.540358 0.079768 -0.107412 -0.008949 -0.723827 0.407564 -0.476153 -0.327998 -0.028796 0.097613 0.617282 0.523738 -0.343466 -0.654583 -0.281963 -0.029269 -0.111702 -0.600595 -0.401423 0.490966 -0.018468 0.669631 0.147287 -0.356892 -0.384345 0.446314 -0.116247 -0.730857 0.238111 -0.220730 Right Singular Vector Matrix V: -0.613904 0.278609 0.104897 -0.731092 -0.438563 -0.404190 -0.796430 0.099963 -0.612231 0.322822 0.257911 0.674123 -0.236553 -0.809193 0.536823 -0.032712 The product U * S * V' (should equal A): 0.452347 0.099396 0.464723 0.375515 0.996976 0.714731 0.988093 0.329540 0.805066 0.699374 0.826326 0.466844 0.529437 0.653108 0.489825 0.469243 0.687683 0.441885 0.918780 0.069247 0.889287 0.419631 0.648995 0.070646 TEST29 For a triangular matrix, DTRCO computes the LU factors and computes its reciprocal condition number. The matrix size is N = 5 Lower triangular matrix A: 0.671110 0.000000 0.000000 0.000000 0.000000 0.725991 0.820887 0.000000 0.000000 0.000000 0.449453 0.743454 0.353501 0.000000 0.000000 0.187874 0.297061 0.545015 0.259378 0.000000 0.782755 0.280918 0.028896 0.453525 0.573669 Estimate the condition: The reciprocal condition number = 0.035545 Upper triangular matrix A: 0.600879 0.409717 0.996934 0.150509 0.125409 0.000000 0.236094 0.595308 0.779918 0.123166 0.000000 0.000000 0.103921 0.304638 0.788652 0.000000 0.000000 0.000000 0.942283 0.711160 0.000000 0.000000 0.000000 0.000000 0.804172 Estimate the condition: The reciprocal condition number = 0.014385 TEST30 For a triangular matrix, DTRDI computes the determinant or inverse. The matrix size is N = 5 Lower triangular matrix A: 0.673789 0.000000 0.000000 0.000000 0.000000 0.612722 0.457572 0.000000 0.000000 0.000000 0.539099 0.071333 0.197720 0.000000 0.000000 0.878282 0.858094 0.252539 0.791025 0.000000 0.329243 0.058740 0.673482 0.536660 0.260833 The determinant = 1.257734 * 10 ^ -2.000000 The inverse matrix: 1.484143 0.000000 0.000000 0.000000 0.000000 -1.987375 2.185447 0.000000 0.000000 0.000000 8.515604 0.360775 5.057646 0.000000 0.000000 -18.663061 1.107561 0.319255 1.264183 0.000000 -0.054438 2.211965 3.101632 2.057483 3.833864 a = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Upper triangular matrix A: 0.022752 0.490226 0.470256 0.206970 0.737293 0.000000 0.158246 0.179681 0.279856 0.067733 0.000000 0.000000 0.848961 0.661969 0.969632 0.000000 0.000000 0.000000 0.698983 0.344115 0.000000 0.000000 0.000000 0.000000 0.638653 The determinant = 1.364498 * 10 ^ -3.000000 The inverse matrix: 43.952115 -136.157939 4.471583 37.265340 -63.168195 0.000000 6.319263 -1.337458 -1.263450 2.041160 0.000000 0.000000 1.177910 -1.115535 -1.187291 0.000000 0.000000 0.000000 1.430650 -0.770855 0.000000 0.000000 0.000000 0.000000 1.565796 TEST31 For a triangular matrix, DTRSL solves a linear system. 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.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 For a lower triangular matrix A, solve A' * x = b The solution (should be 1,2,3,4,5): 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 For an upper triangular matrix A, solve A * x = b The solution (should be 1,2,3,4,5): 1 1.892272 2 11.574208 3 -14.591229 4 8.026369 5 11.931762 For an upper triangular matrix A, solve A' * x = b The solution (should be 1,2,3,4,5): 1 13.657614 2 3.176787 3 -29.438429 4 9.139127 5 11.988350 linpack_d_test(): Normal end of execution. 03-Jun-2024 13:35:29