08-Jan-2022 09:08:55 r8ge_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test r8ge(). I4_LOG_10_TEST I4_LOG_10: whole part of log base 10, X, I4_LOG_10 0 0 1 0 2 0 3 0 9 0 10 1 11 1 99 1 101 2 -1 0 -2 0 -3 0 -9 0 I4VEC_PRINT_TEST I4VEC_PRINT prints an I4VEC The I4VEC: 1: 91 2: 92 3: 93 4: 94 R8_SIGN_TEST R8_SIGN returns the sign of an R8. R8 R8_SIGN(R8) -1.250000 -1.000000 -0.250000 -1.000000 0.000000 1.000000 0.500000 1.000000 9.000000 1.000000 R8GE_CG_TEST(): R8GE_CG applies CG to an R8GE matrix. Number of variables N = 10 Norm of residual ||Ax-b|| = 3.90319e-15 Norm of error ||x1-x2|| = 1.37803e-15 R8GE_CO_TEST R8GE_CO estimates the condition number of an R8GE matrix. Matrix order N = 4 The L1 condition number is 10.000000 The R8GE_CO estimate is 7.000000 R8GE_DET_TEST R8GE_DET computes the determinant of an R8GE matrix. R8GE_DET computes the determinant = 112.000000 Exact determinant = 112.000000 R8GE_DIF2_TEST R8GE_DIF2 returns the second difference matrix. DIF2 matrix: Col: 1 2 3 4 Row --- 1 2 -1 0 0 2 -1 2 -1 0 3 0 -1 2 -1 4 0 0 -1 2 5 0 0 0 -1 R8GE_DILU_TEST R8GE_DILU returns the DILU factors of an R8GE matrix. Matrix rows M = 9 Matrix columns N = 9 Matrix A: Col: 1 2 3 4 5 Row --- 1 4 -1 0 -1 0 2 -1 4 -1 0 -1 3 0 -1 4 -1 0 4 -1 0 -1 4 -1 5 0 -1 0 -1 4 6 0 0 -1 0 -1 7 0 0 0 -1 0 8 0 0 0 0 -1 9 0 0 0 0 0 Col: 6 7 8 9 Row --- 1 0 0 0 0 2 0 0 0 0 3 -1 0 0 0 4 0 -1 0 0 5 -1 0 -1 0 6 4 -1 0 -1 7 -1 4 -1 0 8 0 -1 4 -1 9 -1 0 -1 4 DILU factor: 1: 0.25 2: 0.266667 3: 0.267857 4: 0.287179 5: 0.290179 6: 0.290532 7: 0.292202 8: 0.292601 9: 0.292666 R8GE_FA_TEST R8GE_FA computes the LU factors of an R8GE matrix, so that R8GE_SL can solve the factored system. Matrix order N = 10 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 Solution: 1: 1 2: 1 3: 1 4: 1 5: 1 6: 1 7: 1 8: 1 9: 1 10: 1 Solution of transposed system: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R8GE_FS_TEST R8GE_FS factors and solves a linear system involving an R8GE matrix. Matrix order N = 10 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R8GE_FSS_TEST R8GE_FSS factors and solves multiple linear systems associated with an R8GE matrix. Matrix order N = 10 Solution: Col: 1 2 3 Row --- 1 1 1 1 2 1 2 2 3 1 3 3 4 1 4 1 5 1 5 2 6 1 6 3 7 1 7 1 8 1 8 2 9 1 9 3 10 1 10 1 R8GE_HILBERT_TEST R8GE_HILBERT returns the Hilbert matrix. Hilbert matrix: Col: 1 2 3 4 Row --- 1 1 0.5 0.333333 0.25 2 0.5 0.333333 0.25 0.2 3 0.333333 0.25 0.2 0.166667 4 0.25 0.2 0.166667 0.142857 5 0.2 0.166667 0.142857 0.125 R8GE_HILBERT_INVERSE_TEST R8GE_HILBERT_INVERSE computes the inverse of the Hilbert matrix, stored as an R8GE matrix. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 1 0.5 0.333333 0.25 2 0.5 0.333333 0.25 0.2 3 0.333333 0.25 0.2 0.166667 4 0.25 0.2 0.166667 0.142857 Inverse matrix B: Col: 1 2 3 4 Row --- 1 16 -120 240 -140 2 -120 1200 -2700 1680 3 240 -2700 6480 -4200 4 -140 1680 -4200 2800 Product A * B: Col: 1 2 3 4 Row --- 1 1 0 0 0 2 0 1 0 0 3 0 0 1 -5.68434e-14 4 0 0 0 1 R8GE_IDENTITY_TEST R8GE_IDENTITY returns an identity matrix. Identity matrix: Col: 1 2 3 4 Row --- 1 1 0 0 0 2 0 1 0 0 3 0 0 1 0 4 0 0 0 1 5 0 0 0 0 R8GE_ILU_TEST R8GE_ILU returns the ILU factors of an R8GE matrix. Matrix rows M = 9 Matrix columns N = 9 Matrix A: Col: 1 2 3 4 5 Row --- 1 4 -1 0 -1 0 2 -1 4 -1 0 -1 3 0 -1 4 -1 0 4 -1 0 -1 4 -1 5 0 -1 0 -1 4 6 0 0 -1 0 -1 7 0 0 0 -1 0 8 0 0 0 0 -1 9 0 0 0 0 0 Col: 6 7 8 9 Row --- 1 0 0 0 0 2 0 0 0 0 3 -1 0 0 0 4 0 -1 0 0 5 -1 0 -1 0 6 4 -1 0 -1 7 -1 4 -1 0 8 0 -1 4 -1 9 -1 0 -1 4 Factor L: Col: 1 2 3 4 5 Row --- 1 1 0 0 0 0 2 -0.25 1 0 0 0 3 0 -0.266667 1 0 0 4 -0.25 0 -0.267857 1 0 5 0 -0.266667 0 -0.287179 1 6 0 0 -0.267857 0 -0.290179 7 0 0 0 -0.287179 0 8 0 0 0 0 -0.290179 9 0 0 0 0 0 Col: 6 7 8 9 Row --- 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4 0 0 0 0 5 0 0 0 0 6 1 0 0 0 7 -0.290532 1 0 0 8 0 -0.292202 1 0 9 -0.290532 0 -0.292601 1 Factor U: Col: 1 2 3 4 5 Row --- 1 4 -1 0 -1 0 2 0 3.75 -1 0 -1 3 0 0 3.73333 -1 0 4 0 0 0 3.48214 -1 5 0 0 0 0 3.44615 6 0 0 0 0 0 7 0 0 0 0 0 8 0 0 0 0 0 9 0 0 0 0 0 Col: 6 7 8 9 Row --- 1 0 0 0 0 2 0 0 0 0 3 -1 0 0 0 4 0 -1 0 0 5 -1 0 -1 0 6 3.44196 -1 0 -1 7 0 3.42229 -1 0 8 0 0 3.41762 -1 9 0 0 0 3.41687 Product L*U: Col: 1 2 3 4 5 Row --- 1 4 -1 0 -1 0 2 -1 4 -1 0.25 -1 3 0 -1 4 -1 0.266667 4 -1 0.25 -1 4 -1 5 0 -1 0.266667 -1 4 6 0 0 -1 0.267857 -1 7 0 0 0 -1 0.287179 8 0 0 0 0 -1 9 0 0 0 0 0 Col: 6 7 8 9 Row --- 1 0 0 0 0 2 0 0 0 0 3 -1 0 0 0 4 0.267857 -1 0 0 5 -1 0.287179 -1 0 6 4 -1 0.290179 -1 7 -1 4 -1 0.290532 8 0.290179 -1 4 -1 9 -1 0.290532 -1 4 R8GE_INDICATOR_TEST R8GE_INDICATOR returns an indicator matrix. Indicator matrix: Col: 1 2 3 4 Row --- 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 R8GE_INVERSE_TEST R8GE_INVERSE computes the inverse of an R8GE matrix. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 5 3 3 3 2 3 5 3 3 3 3 3 5 3 4 3 3 3 5 Inverse matrix B: Col: 1 2 3 4 Row --- 1 0.392857 -0.107143 -0.107143 -0.107143 2 -0.107143 0.392857 -0.107143 -0.107143 3 -0.107143 -0.107143 0.392857 -0.107143 4 -0.107143 -0.107143 -0.107143 0.392857 Product matrix: Col: 1 2 3 4 Row --- 1 1 -1.11022e-16 0 0 2 3.33067e-16 1 0 0 3 4.44089e-16 -1.11022e-16 1 2.22045e-16 4 4.44089e-16 -1.11022e-16 0 1 R8GE_ML_TEST R8GE_ML computes A*x or A'*X where A has been factored by R8GE_FA. Matrix order N = 10 A*x and PLU*x 1: 26.3052 26.3052 2: 26.9661 26.9661 3: 31.1341 31.1341 4: 27.0458 27.0458 5: 29.4102 29.4102 6: 24.7155 24.7155 7: 28.6311 28.6311 8: 20.039 20.039 9: 19.9774 19.9774 10: 22.0765 22.0765 A'*x and (PLU)'*x 1: 29.127 29.127 2: 25.5867 25.5867 3: 27.7436 27.7436 4: 26.5577 26.5577 5: 24.0636 24.0636 6: 27.6102 27.6102 7: 26.8611 26.8611 8: 25.57 25.57 9: 32.3008 32.3008 10: 30.0899 30.0899 R8GE_MM_TEST R8GE_MM computes a matrix-matrix product C = A * B. A: Col: 1 2 3 Row --- 1 1 0 0 2 1 1 0 3 1 2 1 4 1 3 3 B: Col: 1 2 3 4 Row --- 1 1 1 1 1 2 0 1 2 3 3 0 0 1 3 C = A*B: Col: 1 2 3 4 Row --- 1 1 1 1 1 2 1 2 3 4 3 1 3 6 10 4 1 4 10 19 R8GE_MTM_TEST R8GE_MTM computes a matrix-matrix product C = A' * B. A': Row: 1 2 3 Col 1: 1 1 1 2: 0 1 2 3: 0 0 1 4: 0 0 0 B: Col: 1 2 3 4 Row --- 1 1 0 0 0 2 1 1 0 0 3 1 2 1 0 C = A'*B: Col: 1 2 3 4 Row --- 1 3 3 1 0 2 3 5 2 0 3 1 2 1 0 4 0 0 0 0 R8GE_MTV_TEST R8GE_MTV computes a product b=A'*x for an R8GE matrix. The R8GE matrix A: Col: 1 2 3 4 Row --- 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 Vector x: 1: 1 2: 2 3: 3 4: 4 5: 5 Vector b = A'*x: 1: 565 2: 580 3: 595 4: 610 R8GE_MU_TEST R8GE_MU computes A*x or A'*X where A has been factored by R8GE_TRF. Matrix rows M = 5 Matrix columns N = 3 A*x and PLU*x 1: 3.74587 3.74587 2: 2.42978 2.42978 3: 1.85293 1.85293 4: 3.23096 3.23096 5: 2.53337 2.53337 A'*x and (PLU)'*x 1: 7.01839 7.01839 2: 8.8872 8.8872 3: 8.85135 8.85135 Matrix is 3 by 5 A*x and PLU*x 1: 6.45435 6.45435 2: 8.03171 8.03171 3: 7.9497 7.9497 A'*x and (PLU)'*x 1: 1.95422 1.95422 2: 3.12954 3.12954 3: 3.37901 3.37901 4: 3.98824 3.98824 5: 2.15792 2.15792 R8GE_MV_TEST R8GE_MV computes a product b=A*x for an R8GE matrix. The R8GE matrix A: Col: 1 2 3 4 Row --- 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 Vector x: 1: 1 2: 2 3: 3 4: 4 Vector b = A*x: 1: 130 2: 230 3: 330 4: 430 5: 530 R8GE_PLU_TEST R8GE_PLU returns the PLU factors of an R8GE matrix. Matrix rows M = 5 Matrix columns N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 0.790407 0.833501 0.514423 0.406955 2 0.949304 0.768854 0.884281 0.748706 3 0.327565 0.167254 0.588026 0.825584 4 0.671264 0.86198 0.154752 0.789963 5 0.438645 0.989872 0.199863 0.318524 Factor P: Col: 1 2 3 4 5 Row --- 1 0 0 0 0 1 2 1 0 0 0 0 3 0 0 0 1 0 4 0 0 1 0 0 5 0 1 0 0 0 Factor L: Col: 1 2 3 4 5 Row --- 1 1 0 0 0 0 2 0.46207 1 0 0 0 3 0.707112 0.501592 1 0 0 4 0.345059 -0.154499 -0.685143 1 0 5 0.832618 0.304659 0.432577 -0.435099 1 Factor U: Col: 1 2 3 4 Row --- 1 0.949304 0.768854 0.884281 0.748706 2 0 0.634608 -0.208737 -0.0274303 3 0 0 -0.365833 0.274303 4 0 0 0 0.750935 5 0 0 0 0 Product P*L*U: Col: 1 2 3 4 Row --- 1 0.790407 0.833501 0.514423 0.406955 2 0.949304 0.768854 0.884281 0.748706 3 0.327565 0.167254 0.588026 0.825584 4 0.671264 0.86198 0.154752 0.789963 5 0.438645 0.989872 0.199863 0.318524 R8GE_POLY_TEST R8GE_POLY computes the characteristic polynomial of an R8GE matrix. Matrix order N = 12 I, P(I), True P(I) 1: 1 1 2: -23 -23 3: 231 231 4: -1330 -1330 5: 4845 4845 6: -11628 -11628 7: 18564 18564 8: -19448 -19448 ...... .............. .............. 13: 1 1 R8GE_PRINT_TEST R8GE_PRINT prints an R8GE matrix. The R8GE matrix: Col: 1 2 3 4 Row --- 1 11 12 13 14 2 21 22 23 24 3 31 32 33 34 4 41 42 43 44 5 51 52 53 54 6 61 62 63 64 R8GE_PRINT_SOME_TEST R8GE_PRINT_SOME prints some of an R8GE matrix. The R8GE matrix, rows 2:4, cols 1:2: Col: 1 2 Row --- 2 21 22 3 31 32 4 41 42 R8GE_RANDOM_TEST R8GE_RANDOM returns a random R8GE matrix. Random matrix: Col: 1 2 3 4 Row --- 1 0.534064 0.495177 0.850713 0.815397 2 0.0899507 0.18971 0.56056 0.879014 3 0.111706 0.495006 0.929609 0.988912 4 0.136293 0.147608 0.696667 0.000522375 5 0.678652 0.0549741 0.582791 0.865439 R8GE_RES_TEST R8GE_RES computes b-A*x, where A is an R8GE matrix. We check three cases, MN. Residual A*x-b: 1: 0 2: 0 3: 0 Residual A*x-b: 1: 0 2: 0 3: 0 4: 0 5: 0 Residual A*x-b: 1: 0 2: 0 3: 0 4: 0 5: 0 R8GE_SL_TEST R8GE_SL solves a linear system that was factored by R8GE_FA. Matrix order N = 10 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 Solution: 1: 1 2: 1 3: 1 4: 1 5: 1 6: 1 7: 1 8: 1 9: 1 10: 1 Solution of transposed system: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R8GE_SL_IT_TEST R8GE_SL_IT applies one step of iterative refinement to a R8GE_SL solution. Matrix order N = 6 i, x, b-A*x 1: 0.166667 1.13687e-13 2: 0.142857 -9.09495e-13 3: 0.125 1.45519e-11 4: 0.111111 -5.82077e-11 5: 0.1 0 6: 0.0909091 -1.45519e-11 Iterative refinement step 1 I, DX: 1 -1.24677e-11 2 -1.03287e-11 3 -8.79936e-12 4 -7.66042e-12 5 -6.78115e-12 6 -6.08241e-12 i, x, b-A*x 1: 0.166667 -5.68434e-14 2: 0.142857 1.81899e-12 3: 0.125 -2.91038e-11 4: 0.111111 2.91038e-11 5: 0.1 0 6: 0.0909091 7.27596e-12 Iterative refinement step 2 I, DX: 1 -3.60008e-13 2 1.62139e-13 3 3.75167e-13 4 4.65078e-13 5 4.99681e-13 6 5.07613e-13 i, x, b-A*x 1: 0.166667 -1.7053e-13 2: 0.142857 9.09495e-13 3: 0.125 -1.45519e-11 4: 0.111111 8.73115e-11 5: 0.1 -2.91038e-11 6: 0.0909091 3.63798e-11 Iterative refinement step 3 I, DX: 1 1.7504e-11 2 1.43887e-11 3 1.22018e-11 4 1.05912e-11 5 9.35679e-12 6 8.38066e-12 i, x, b-A*x 1: 0.166667 0 2: 0.142857 0 3: 0.125 -2.18279e-11 4: 0.111111 0 5: 0.1 0 6: 0.0909091 -1.45519e-11 Iterative refinement step 4 I, DX: 1 -9.70128e-12 2 -7.53581e-12 3 -6.18456e-12 4 -5.25486e-12 5 -4.57346e-12 6 -4.05139e-12 i, x, b-A*x 1: 0.166667 0 2: 0.142857 1.81899e-12 3: 0.125 2.91038e-11 4: 0.111111 0 5: 0.1 -8.73115e-11 6: 0.0909091 0 Iterative refinement step 5 I, DX: 1 -6.85153e-12 2 -6.66963e-12 3 -6.19756e-12 4 -5.6995e-12 5 -5.24042e-12 6 -4.83331e-12 i, x, b-A*x 1: 0.166667 0 2: 0.142857 0 3: 0.125 0 4: 0.111111 0 5: 0.1 5.82077e-11 6: 0.0909091 7.27596e-12 R8GE_TO_R8VEC_TEST R8GE_TO_R8VEC converts an R8GE matrix to an R8VEC vector. R8GE matrix: Col: 1 2 3 Row --- 1 11 12 13 2 21 22 23 3 31 32 33 4 41 42 43 Corresponding R8VEC vector: 1: 11 2: 21 3: 31 4: 41 5: 12 6: 22 7: 32 8: 42 9: 13 10: 23 11: 33 12: 43 R8GE_TRANSPOSE_PRINT_TEST R8GE_TRANSPOSE_PRINT prints an R8GE, transposed. Matrix row order M = 7 Matrix column order N = 12 The transposed matrix A: Row: 1 2 3 4 5 Col 1: 101 201 301 401 501 2: 102 202 302 402 502 3: 103 203 303 403 503 4: 104 204 304 404 504 5: 105 205 305 405 505 6: 106 206 306 406 506 7: 107 207 307 407 507 8: 108 208 308 408 508 9: 109 209 309 409 509 10: 110 210 310 410 510 11: 111 211 311 411 511 12: 112 212 312 412 512 Row: 6 7 Col 1: 601 701 2: 602 702 3: 603 703 4: 604 704 5: 605 705 6: 606 706 7: 607 707 8: 608 708 9: 609 709 10: 610 710 11: 611 711 12: 612 712 R8GE_TRANSPOSE_PRINT_SOME_TEST R8GE_TRANSPOSE_PRINT_SOME prints some of an R8GE, transposed. Matrix row order M = 9 Matrix column order N = 9 Rows 4-6, Cols 3-8: Row: 4 5 6 Col 3: 43 53 63 4: 44 54 64 5: 45 55 65 6: 46 56 66 7: 47 57 67 8: 48 58 68 R8GE_TRF_TEST R8GE_TRF computes the LU factors of an R8GE matrix, so that R8GE_TRS can solve the factored system. Number of matrix rows M = 5 Number of matrix columns N = 5 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 Solution to transposed system: 1: 1 2: 2 3: 3 4: 4 5: 5 R8GE_TRS_TEST R8GE_TRS solves a linear system that has been factored by R8GE_TRF. Number of matrix rows M = 5 Number of matrix columns N = 5 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 Solution to transposed system: 1: 1 2: 2 3: 3 4: 4 5: 5 R8GE_ZEROS_TEST R8GE_ZEROS zeros out space for an R8GE matrix. Matrix order M, N = 5, 4 Matrix A: Col: 1 2 3 4 Row --- 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4 0 0 0 0 5 0 0 0 0 R8VEC_INDICATOR1_TEST R8VEC_INDICATOR1 returns a 1-based indicator vector. The indicator1 vector: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 R8VEC_PRINT_TEST R8VEC_PRINT prints an R8VEC. The R8VEC: 1: 123.456 2: 5e-06 3: -1e+06 4: 3.14159 R8VEC_PRINT_SOME_TEST R8VEC_PRINT_SOME prints some of an R8VEC. No more than 10 lines of this vector: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 ...... .............. 100 100 R8GE_TO_R8VEC_TEST R8GE_TO_R8VEC converts an R8GE matrix to an R8VEC vector. Corresponding R8VEC vector: 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10 11: 11 12: 12 R8GE matrix: Col: 1 2 3 Row --- 1 1 5 9 2 2 6 10 3 3 7 11 4 4 8 12 R8VEC2_PRINT_SOME_TEST R8VEC2_PRINT_SOME prints some of a pair of R8VEC's. Square and square root: 1: 1 1 2: 4 1.41421 3: 9 1.73205 4: 16 2 5: 25 2.23607 6: 36 2.44949 7: 49 2.64575 8: 64 2.82843 ...... .............. .............. 20: 400 4.47214 r8ge_test(): Normal end of execution. 08-Jan-2022 09:08:55