August 27 2016 9:30:06.183 PM LINPACK_S_PRB FORTRAN90 version Test the LINPACK_S library. TEST01 For single precision real arithmetic (S) 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 single precision real arithmetic (S) 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 single precision real arithmetic (S) SCHUD updates a Cholesky decomposition. STRSL solves a triangular linear system. 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 single precision real arithmetic (S) and general band storage (GB), 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.233017E-01 TEST05 For single precision real arithmetic (S) and general band storage (GB), 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 entries of the solution: (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 single precision real arithmetic (S) and general band storage (GB), SGBFA factors the matrix, SGBDI 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.50001 1.00000 128 1.29000 2.00000 TEST07 For single precision real arithmetic (S) and general band storage (GB), 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 entries of the solution: (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 For single precision real arithmetic (S) and general matrix storage (GE), SGECO factors the 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 For single precision real arithmetic (S) and general matrix storage (GE), SGEFA factors the matrix; SGEDI computes the inverse and determinant of a factored matrix. The matrix size is N = 3 The matrix A: 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 0.00000 Factor the matrix Get the inverse and determinant The determinant = 2.70000 * 10 ** 1.00000 The inverse matrix inverse(A): -1.77778 0.888889 -0.111111 1.55556 -0.777778 0.222222 -0.111111 0.222222 -0.111111 The product inverse(A) * A: 1.00000 0.00000 0.00000 0.119209E-06 1.00000 0.00000 -0.596046E-07 -0.596046E-07 1.00000 TEST10 For single precision real arithmetic (S) and general matrix storage (GE), SGEFA factors the 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 For single precision real arithmetic (S) and general matrix storage (GE), 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 entries of the solution: (All of them should be 1.) 1 0.999992 2 0.999991 3 0.999991 4 0.999990 5 0.999992 ...... .............. 96 0.999991 97 0.999991 98 0.999991 99 0.999991 100 0.999991 TEST12 For single precision real arithmetic (S) and general tridiagonal storage (GT), 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 single precision real arithmetic (S) and positive definite symmetric band storage (PB), SPBCO estimates the reciprocal condition number. The matrix size is N = 10 Estimate the condition. Reciprocal condition = 0.204918E-01 TEST14 For single precision real arithmetic (S) and positive definite symmetric band storage (PB), 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 single precision real arithmetic (S) and positive definite symmetric band storage (PB), 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 5 entries of the solution: (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 single precision real arithmetic (S) and positive definite symmetric storage (PO), SPOCO estimates the reciprocal condition number. The matrix size is N = 5 Estimate the condition. Reciprocal condition = 0.675676E-01 TEST17 For single precision real arithmetic (S) and positive definite symmetric storage (PO), 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 single precision real arithmetic (S) and positive definite symmetric storage (PO), 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 entries of the solution: (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 single precision real arithmetic (S) and positive definite symmetric packed storage (PP), SPPCO estimates the reciprocal condition number. The matrix size is N = 5 Estimate the condition number. Reciprocal condition number = 0.675676E-01 TEST20 For single precision real arithmetic (S) and positive definite symmetric packed storage (PP), 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 single precision real arithmetic (S) and positive definite symmetric packed storage (PP), 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 entries of the solution: (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 single precision real arithmetic (S) and positive definite symmetric tridiagonal (PT), 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 entries of the solution: (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 SQRDC_TEST SQRDC 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.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.596046E-07 1.00000 -0.596046E-07 1.00000 0.00000 1.00000 1.00000 SQRSL_TEST SQRSL 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 single precision real arithmetic (S) and symmetric indefinite storage (SI), SSICO estimates the reciprocal condition number. The matrix size is N = 100 Estimate the condition. Estimated reciprocal condition = 0.245050E-03 TEST25 For single precision real arithmetic (S) and symmetric indefinite storage (SI), 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 entries of the 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.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST26 For single precision real arithmetic (S) and symmetric indefinite packed storage (SP), SSPCO estimates the reciprocal condition number. The matrix size is N = 100 Estimate the condition. Estimated reciprocal condition = 0.245050E-03 TEST27 For single precision real arithmetic (S) and symmetric indefinite packed storage (SP), 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 entries of the 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.0000 97 97.0000 98 98.0000 99 99.0000 100 100.000 TEST28 For single precision real arithmetic (S) and 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 single precision real arithmetic (S) and triangular storage (TR), 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 single precision real arithmetic (S) and triangular storage (TR), 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 single precision real arithmetic (S) and triangular storage (TR), 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_PRB Normal end of execution. August 27 2016 9:30:06.187 PM