20200122 084301.653 linpack_s_test FORTRAN77 version Test the LINPACK_S library. TEST01 For real, general storage, SCHDC 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 real, general storage, SCHEX 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.596046E-07 0.00000 0.00000 -1.00000 2.00000 0.00000 0.00000 -1.00000 0.596046E-07 0.00000 2.00000 -1.00000 0.00000 0.00000 0.00000 -1.00000 2.00000 TEST03 For real, general storage, SCHUD updates a Cholesky decomposition. In this example, we use SCHUD 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 0.999949 2 2.00000 3 3.00003 4 3.99999 5 4.99997 ...... .............. 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 TEST04 For a banded matrix in general format, SGBCO 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.204918E-01 TEST05 For a banded matrix in general format, SGBFA factors the matrix, SGBSL 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 values: (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, SGBFA factors the matrix, SGBDI computes the determinant as det = MANTISSA * 10**EXPONENT Find the determinant of the -1,2,-1 matrix for N by powers of 2 from 2 to 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.50001 1.00000 128 1.29000 2.00000 TEST07 For a banded matrix in general format, SGBFA factors the matrix, SGBSL 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 0.999999 2 0.999999 3 0.999999 4 0.999999 5 0.999999 ...... .............. 96 1.00000 97 0.999999 98 0.999999 99 1.00000 100 0.999999 TEST08 SGECO factors a general matrix and computes its reciprocal condition number; SGESL 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 SGESL (Should be (1,2,3)) 1.00000 2.00000 3.00000 Call SGESL for a new right hand side for the same, factored matrix. Solve a linear system. Solution returned by SGESL (should be (1,0,0)) 1.00000 0.00000 0.00000 Call SGESL for transposed problem. Call SGESL to solve a transposed linear system. Solution returned by SGESL (should be (-1,0,1)) -1.00000 0.105964E-06 1.00000 TEST09 SGEFA factors a general matrix; SGEDI 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 SGEFA factors a general matrix; SGESL 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. SGESL returns the solution: (Should be (1,2,3)) 1.00000 2.00000 3.00000 TEST11 SGEFA factors a general matrix; SGESL 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 0.999990 2 0.999988 3 0.999990 4 0.999990 5 0.999990 ...... .............. 96 0.999989 97 0.999989 98 0.999989 99 0.999989 100 0.999989 TEST12 For a general tridiagonal matrix, SGTSL 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 solution: (Should be (1,2,3,4,5,...,n-1,n)) 1 1.00000 2 2.00000 3 3.00001 4 4.00001 5 5.00001 ...... .............. 96 96.0001 97 97.0001 98 98.0001 99 99.0000 100 100.000 TEST13 For a positive definite symmetric band matrix, SPBCO 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, SPBDI 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.29998 1.00000 64 6.49989 1.00000 128 1.28997 2.00000 TEST15 For a positive definite symmetric band matrix, SPBFA computes the LU factors. SPBSL solves a factored linear system. The matrix size is N = 10 Factor the matrix. Solve the linear system. The first and last solution entries: (All should be 1): 1 1.00000 2 1.00000 3 1.00000 4 1.00000 5 0.999999 ...... .............. 6 0.999999 7 1.00000 8 1.00000 9 1.00000 10 1.00000 TEST16 For a positive definite symmetric matrix, SPOCO 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, SPOFA computes the LU factors, SPODI 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, SPOFA computes the LU factors. SPOSL 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 ...... .............. 15 15.0000 16 16.0000 17 17.0000 18 18.0000 19 19.0000 20 20.0000 TEST19 For a positive definite symmetric packed matrix, SPPCO 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, SPPFA factors the matrix. SPPDI 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, SPPFA factors the matrix. SPPSL 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, SPTSL 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 0.999999 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 TEST23 For a general matrix, SQRDC computes the QR decomposition of a matrix, but does not return Q and R explicitly. Recover Q and R using SQRSL. 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, describing 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 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.596046E-07 1.00000 -0.596046E-07 1.00000 0.00000 1.00000 1.00000 TEST24 For a symmetric indefinite matrix, SSICO 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, SSIFA factors the matrix, SSISL 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.00001 4 4.00001 5 5.00001 ...... .............. 96 96.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST26 For a symmetric indefinite packed matrix, SSPCO 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, SSPFA factors the matrix, SSPSL 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.00001 4 4.00001 5 5.00001 ...... .............. 96 96.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST28 For an MxN matrix A in general storage, SSVDC computes the singular value decomposition: A = U * S * V' Matrix rows M = 6 Matrix columns N = 4 The matrix A: 0.2184 0.2576 0.4013 0.0945 0.9563 0.1100 0.7547 0.0136 0.8295 0.0438 0.7973 0.8591 0.5617 0.6340 0.0018 0.8408 0.4153 0.0617 0.8975 0.1231 0.0661 0.4495 0.3508 0.0075 Decompose the matrix. Singular values: 1 2.22898 2 1.03175 3 0.606304 4 0.441098 Left Singular Vector Matrix U: -0.2149 0.0703 0.3516 0.1415 -0.5697 -0.6933 -0.4939 0.3994 0.0408 -0.7659 -0.0327 0.0848 -0.6210 -0.1220 -0.5412 0.3511 -0.3416 0.2581 -0.3787 -0.8039 0.2117 -0.1950 0.3196 -0.1592 -0.3942 0.4170 0.1135 0.4246 0.6525 -0.2275 -0.1594 0.0218 0.7240 0.2274 -0.1725 0.6071 Right Singular Vector Matrix V: -0.6377 0.0186 -0.1965 -0.7446 -0.2122 -0.4046 0.8873 -0.0625 -0.6122 0.5940 0.1595 0.4970 -0.4167 -0.6951 -0.3855 0.4412 The product U * S * V' (should equal A): 0.2184 0.2576 0.4013 0.0945 0.9563 0.1100 0.7547 0.0136 0.8295 0.0438 0.7973 0.8591 0.5617 0.6340 0.0018 0.8408 0.4153 0.0617 0.8975 0.1231 0.0661 0.4495 0.3508 0.0075 TEST29 For a triangular matrix, STRCO computes the LU factors and computes its reciprocal condition number. The matrix size is N = 5 Lower triangular matrix A: 0.218418 0.00000 0.00000 0.00000 0.00000 0.956318 0.257578 0.00000 0.00000 0.00000 0.829509 0.109957 0.401306 0.00000 0.00000 0.561695 0.438290E-01 0.754673 0.945448E-01 0.00000 0.415307 0.633966 0.797287 0.136169E-01 0.260303 Estimate the condition: The reciprocal condition number = 0.481996E-02 Upper triangular matrix A: 0.912484 0.692066 0.597917 0.574366 0.714471 0.00000 0.561662 0.188955 0.367027 0.117707 0.00000 0.00000 0.761492 0.617205 0.299329 0.00000 0.00000 0.00000 0.361529 0.825003 0.00000 0.00000 0.00000 0.00000 0.824660 Estimate the condition: The reciprocal condition number = 0.614011E-01 TEST30 For a triangular matrix, STRDI computes the determinant or inverse. The matrix size is N = 5 Lower triangular matrix A: 0.218418 0.00000 0.00000 0.00000 0.00000 0.956318 0.257578 0.00000 0.00000 0.00000 0.829509 0.109957 0.401306 0.00000 0.00000 0.561695 0.438290E-01 0.754673 0.945448E-01 0.00000 0.415307 0.633966 0.797287 0.136169E-01 0.260303 The determinant = 5.55636 * 10 ** -4.00000 The inverse matrix: 4.57837 0.00000 0.00000 0.00000 0.00000 -16.9983 3.88232 0.00000 0.00000 0.00000 -4.80612 -1.06375 2.49186 0.00000 0.00000 19.0430 6.69124 -19.8905 10.5770 0.00000 47.8190 -6.54723 -6.59187 -0.553301 3.84168 Upper triangular matrix A: 0.912484 0.692066 0.597917 0.574366 0.714471 0.00000 0.561662 0.188955 0.367027 0.117707 0.00000 0.00000 0.761492 0.617205 0.299329 0.00000 0.00000 0.00000 0.361529 0.825003 0.00000 0.00000 0.00000 0.00000 0.824660 The determinant = 1.16355 * 10 ** -1.00000 The inverse matrix: 1.09591 -1.35035 -0.525426 0.526812 -1.09305 0.00000 1.78043 -0.441791 -1.05328 0.959944 0.00000 0.00000 1.31321 -2.24193 1.76620 0.00000 0.00000 0.00000 2.76603 -2.76718 0.00000 0.00000 0.00000 0.00000 1.21262 TEST31 For a triangular matrix, STRSL 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.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 0.999999 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_s_test Normal end of execution. 20200122 084301.655