15-May-2025 08:59:07 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.788822 0.355853 0.122682 0.941619 0.649031 0.957604 0.915475 0.386165 0.832339 0.624274 0.652594 0.066209 0.273249 0.404706 0.879632 0.015607 0.640264 0.559328 0.147838 0.064243 0.587249 0.024127 0.337933 0.755848 Decompose the matrix. Singular values: 1 2.560715 2 1.121692 3 0.597257 4 0.329844 Left Singular Vector Matrix U: -0.408928 0.658555 0.081298 0.235315 -0.155080 -0.559510 -0.576407 -0.277467 -0.119644 0.642252 -0.130059 0.383470 -0.457629 -0.240937 0.290916 -0.577520 -0.560653 0.005656 -0.321515 -0.435093 -0.510167 -0.181473 0.366289 -0.529104 -0.298660 -0.043597 0.672061 -0.057994 0.671524 0.054101 -0.313909 0.489959 -0.427208 -0.402882 0.244114 0.506941 Right Singular Vector Matrix V: -0.601784 0.249429 0.449779 -0.611016 -0.502952 -0.330228 0.427115 0.674953 -0.511399 -0.493941 -0.675552 -0.195249 -0.351235 0.764694 -0.398624 0.364658 The product U * S * V' (should equal A): 0.788822 0.355853 0.122682 0.941619 0.649031 0.957604 0.915475 0.386165 0.832339 0.624274 0.652594 0.066209 0.273249 0.404706 0.879632 0.015607 0.640264 0.559328 0.147838 0.064243 0.587249 0.024127 0.337933 0.755848 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.895701 0.000000 0.000000 0.000000 0.000000 0.179245 0.260875 0.000000 0.000000 0.000000 0.488471 0.626496 0.264706 0.000000 0.000000 0.622606 0.656998 0.273075 0.911729 0.000000 0.235531 0.269205 0.774399 0.033633 0.612830 Estimate the condition: The reciprocal condition number = 0.024641 Upper triangular matrix A: 0.312984 0.219305 0.592898 0.799980 0.399359 0.000000 0.806883 0.410840 0.511372 0.239809 0.000000 0.000000 0.548417 0.497352 0.887747 0.000000 0.000000 0.000000 0.375511 0.126959 0.000000 0.000000 0.000000 0.000000 0.502338 Estimate the condition: The reciprocal condition number = 0.068722 TEST30 For a triangular matrix, DTRDI computes the determinant or inverse. The matrix size is N = 5 Lower triangular matrix A: 0.909479 0.000000 0.000000 0.000000 0.000000 0.769184 0.558766 0.000000 0.000000 0.000000 0.526283 0.958956 0.672150 0.000000 0.000000 0.965451 0.098174 0.159227 0.404425 0.000000 0.544751 0.028592 0.346654 0.217626 0.013328 The determinant = 1.841180 * 10 ^ -3.000000 The inverse matrix: 1.099531 0.000000 0.000000 0.000000 0.000000 -1.513588 1.789658 0.000000 0.000000 0.000000 0.334125 1.426700 1.487763 0.000000 0.000000 -7.105698 0.620302 0.393713 2.472647 0.000000 252.974811 31.183044 28.609058 16.328288 75.029189 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.809616 0.335196 0.570886 0.257500 0.801498 0.000000 0.430890 0.660074 0.845496 0.375883 0.000000 0.000000 0.181866 0.062787 0.537386 0.000000 0.000000 0.000000 0.764956 0.607338 0.000000 0.000000 0.000000 0.000000 0.663941 The determinant = 3.222287 * 10 ^ -2.000000 The inverse matrix: 1.235153 -0.960844 -0.389868 0.678230 -1.251940 0.000000 2.320776 -8.423123 -1.873758 7.217714 0.000000 0.000000 5.498540 -0.451317 -4.037614 0.000000 0.000000 0.000000 1.307264 -1.195817 0.000000 0.000000 0.000000 0.000000 1.506159 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 -13.340750 2 401.464601 3 29.287217 4 -221.996678 5 87.042774 For an upper triangular matrix A, solve A' * x = b The solution (should be 1,2,3,4,5): 1 10.329716 2 12.816601 3 -25.350312 4 -19.656521 5 493.093062 linpack_d_test(): Normal end of execution. 15-May-2025 08:59:08