Tue Jun 4 12:18:13 2024 linpack_d_test(): python version: 3.10.12 numpy version: 1.26.4 Test linpack_d(). dgeco_test() dgeco() computes the condition number of a matrix stored in general format. The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgeco() factors and analyzes the matrix The reciprocal condition number RCOND: 0.024644549763033173 dgedet_test() dgedet() computes the determinant of a matrix stored in general format, after it has been factored by dgefa(). The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgefa() factors the matrix dgedet() computes the determinant: The determinant DET: 26.999999999999993 dgefa_test() dgefa() computes pivot vector and LU factors of a matrix stored in general format. The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgefa() factors the matrix The matrix ALU: [[ 7. 8. 0. ] [-0.57142857 0.85714286 3. ] [-0.14285714 -0.5 4.5 ]] The pivot vector IPVT: [2 2 2] dgeinv_test() dgeinv() computes inverse of a matrix stored in general format, which has been factored by dgefa(). The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgefa() factors the matrix dgeinv() computes the inverse matrix The inverse matrix AINV: [[-1.77777778 0.88888889 -0.11111111] [ 1.55555556 -0.77777778 0.22222222] [-0.11111111 0.22222222 -0.11111111]] The product A * AINV: [[ 1.00000000e+00 5.55111512e-17 -4.16333634e-17] [ 5.55111512e-17 1.00000000e+00 -8.32667268e-17] [ 1.77635684e-15 -8.88178420e-16 1.00000000e+00]] dgesl_test() dgesl() solves a linear system involving a matrix stored in general format, after dgefa() has computed the LU factorization; The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgefa() factors the matrix The right hand side B [14. 32. 23.] dgesl() solves the linear system. Computed solution X (should be (1,2,3)) [1. 2. 3.] dgeslt_test() dgeslt() solves a transposed linear system involving a matrix stored in general format, after dgefa() has computed the LU factorization; The number of equations is N = 3 The matrix A: [[1. 2. 3.] [4. 5. 6.] [7. 8. 0.]] dgefa() factors the matrix The right hand side B [30. 36. 15.] dgeslt() solves the linear system. Computed solution X (should be (1,2,3)) [1. 2. 3.] dpofa_test(): dpofa() computes the LU factors of a positive definite symmetric matrix, Matrix A: [[ 2. -1. 0. 0. 0.] [-1. 2. -1. 0. 0.] [ 0. -1. 2. -1. 0.] [ 0. 0. -1. 2. -1.] [ 0. 0. 0. -1. 2.]] Call DPOFA to factor the matrix. Upper triangular factor U: [[ 1.41421356 -0.70710678 0. 0. 0. ] [ 0. 1.22474487 -0.81649658 0. 0. ] [ 0. 0. 1.15470054 -0.8660254 0. ] [ 0. 0. 0. 1.11803399 -0.89442719] [ 0. 0. 0. 0. 1.09544512]] Product Ut * U: [[ 2. -1. 0. 0. 0.] [-1. 2. -1. 0. 0.] [ 0. -1. 2. -1. 0.] [ 0. 0. -1. 2. -1.] [ 0. 0. 0. -1. 2.]] 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. 1. 0.] [1. 0. 1.] [0. 1. 1.]] Decompose the matrix. The packed matrix A which describes Q and R: [[-1.41421356 -0.70710678 -0.70710678] [ 0.70710678 1.22474487 0.40824829] [ 0. -0.81649658 1.15470054]] The QRAUX vector, containing some additional information defining Q: [1.70710678 1.57735027 0. ] The R factor: [[-1.41421356 -0.70710678 -0.70710678] [ 0. 1.22474487 0.40824829] [ 0. 0. 1.15470054]] The Q factor: [[-0.70710678 0.40824829 -0.57735027] [-0.70710678 -0.40824829 0.57735027] [ 0. 0.81649658 0.57735027]] The product Q * R: [[ 1.00000000e+00 1.00000000e+00 -8.79548322e-17] [ 1.00000000e+00 -6.78135690e-17 1.00000000e+00] [ 0.00000000e+00 1.00000000e+00 1.00000000e+00]] 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. 1. 1.] [ 1. 2. 4.] [ 1. 3. 9.] [ 1. 4. 16.] [ 1. 5. 25.]] Decompose the matrix. X X(expected): -3.02 -3.02 4.49143 4.49143 -0.728571 -0.728571 drotg_test(): drotg() generates a real Givens rotation ( C S ) * ( A ) = ( R ) ( -S C ) ( B ) ( 0 ) A = 0.380585 B = 0.547 C = 0.571128 S = 0.820861 R = 0.666374 Z = 1.75092 C*A+S*B = 0.666374 -S*A+C*B = 0 A = 0.148146 B = 0.0377506 C = 0.969034 S = 0.246928 R = 0.152881 Z = 0.246928 C*A+S*B = 0.152881 -S*A+C*B = 0 A = 0.938989 B = 0.40509 C = 0.918198 S = 0.396121 R = 1.02264 Z = 0.396121 C*A+S*B = 1.02264 -S*A+C*B = 0 A = 0.452921 B = 0.657613 C = 0.567219 S = 0.823567 R = 0.798494 Z = 1.76299 C*A+S*B = 0.798494 -S*A+C*B = 0 A = 0.810181 B = 0.477368 C = 0.861566 S = 0.507645 R = 0.940359 Z = 0.507645 C*A+S*B = 0.940359 -S*A+C*B = 0 dsvdc_test(): dsvdc() computes the singular value decomposition for an MxN matrix A in general storage. A = U * S * V' Matrix rows M = 6 Matrix columns N = 4 The matrix A: [[9.02849016e-01 1.01604620e-01 5.55519295e-01 3.61058243e-02] [4.12290979e-01 9.52541968e-01 2.85692193e-01 4.99509598e-03] [9.34433305e-01 8.04762700e-01 7.19351840e-01 1.04168206e-01] [1.46381936e-04 3.93430518e-01 4.20993322e-01 3.65749545e-01] [4.24484322e-01 4.06640466e-01 7.88305806e-02 3.22745728e-01] [5.15428619e-01 5.31528286e-01 3.38215270e-01 1.84460706e-01]] Decompose the matrix. Singular values: [2.24780656 0.76929854 0.45513544 0.3319285 0. 0. 0. ] Left singular vectors U: [[-0.39967275 0.74275686 -0.08816052 -0.03762156 -0.44314888 -0.28810651] [-0.43039349 -0.52885484 0.51461205 -0.15477986 -0.37977989 -0.31946652] [-0.63432081 0.1095318 0.07689286 -0.26623101 0.70837427 0.08399005] [-0.21434168 -0.36869201 -0.83692408 -0.27151196 -0.12627601 -0.16738444] [-0.26537601 -0.12436111 -0.13470333 0.88954689 0.16363125 -0.27909864] [-0.36917945 -0.07230567 -0.05387709 0.1968158 -0.3389268 0.83783522]] Right singular vectors V: [[-0.63794946 0.60417852 0.26223789 0.39902392] [-0.60037403 -0.74639328 0.28656978 -0.01805144] [-0.46147392 0.19607831 -0.50055749 -0.70571759] [-0.14004758 -0.1985414 -0.77366094 0.58516385]] Product U * S * V should equal A: [[9.02849016e-01 1.01604620e-01 5.55519295e-01 3.61058243e-02] [4.12290979e-01 9.52541968e-01 2.85692193e-01 4.99509598e-03] [9.34433305e-01 8.04762700e-01 7.19351840e-01 1.04168206e-01] [1.46381936e-04 3.93430518e-01 4.20993322e-01 3.65749545e-01] [4.24484322e-01 4.06640466e-01 7.88305806e-02 3.22745728e-01] [5.15428619e-01 5.31528286e-01 3.38215270e-01 1.84460706e-01]] linpack_d_test(): Normal end of execution. Tue Jun 4 12:18:14 2024