17 August 2022 11:44:21 PM R83V_TEST C++ version Test the R83V library. R83_CG_TEST R83_CG applies CG to an R83 matrix. Number of variables N = 10 Norm of residual ||Ax-b|| = 8.47455e-16 Norm of error ||x1-x2|| = 4.1616e-16 R83V_COPY_TEST R83V_COPY copies an R83V matrix. We check three cases, MN. R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 B = copy of A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 B = copy of A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 R83V matrix A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 B = copy of A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 R83V_CR_FA_TEST: R83V_CR_FA factors an R83V matrix using cyclic reduction; Matrix order N = 10 The matrix is NOT symmetric. The matrix: Col: 1 2 3 4 5 Row --- 1 4 2 2 1 8 3 3 2 12 4 4 3 16 5 5 4 20 6 5 Col: 6 7 8 9 10 Row --- 5 6 6 24 7 7 6 28 8 8 7 32 9 9 8 36 10 10 9 40 Solution: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 R83V_CR_SL_TEST: R83V_CR_SL solves a linear system factored by R83V_CR_FA. Matrix order N = 10 The matrix is NOT symmetric. The matrix: Col: 1 2 3 4 5 Row --- 1 4 2 2 1 8 3 3 2 12 4 4 3 16 5 5 4 20 6 5 Col: 6 7 8 9 10 Row --- 5 6 6 24 7 7 6 28 8 8 7 32 9 9 8 36 10 10 9 40 Solution: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 R83V_CR_SLS_TEST R83V_CR_SLS solves multiple linear systems A*x=b1:bn with R83V matrix using cyclic reduction, after factorization by R83V_CR_FA. Matrix order N = 5 Number of linear systems = 2 Demonstrate multiple system solution method. System matrix: Col: 1 2 3 4 5 Row --- 1 2 -1 2 -1 2 -1 3 -1 2 -1 4 -1 2 -1 5 -1 2 RHS: Col: 1 2 Row --- 1 0 1 2 0 0 3 0 0 4 0 0 5 6 1 Solutions: Col: 1 2 Row --- 1 1 1 2 2 1 3 3 1 4 4 1 5 5 1 R83V_DIF2_TEST R83V_DIF2 sets up an R83V second difference matrix. We check three cases, MN. The R83V DIF2 matrix: Col: 1 2 3 4 5 Row --- 1 2 -1 2 -1 2 -1 3 -1 2 -1 The R83V DIF2 matrix: Col: 1 2 3 4 5 Row --- 1 2 -1 2 -1 2 -1 3 -1 2 -1 4 -1 2 -1 5 -1 2 The R83V DIF2 matrix: Col: 1 2 3 Row --- 1 2 -1 2 -1 2 -1 3 -1 2 4 -1 R83V_FS_TEST R83V_FS factors and solves a linear system for an R83V matrix. Matrix order N = 10 The right hand side: 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 11 Solution: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 R83V_GS_SL_TEST R83V_GS_SL solves a linear system using Gauss-Seidel iteration for an R83V matrix. Matrix order N = 10 Iterations per call = 25 The right hand side: 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 11 Current estimated solution: 1 0.634606 2 1.3265 3 2.09566 4 2.95451 5 3.90741 6 4.95088 7 6.07442 8 7.2619 9 8.4933 10 9.74665 Current estimated solution: 1 0.953567 2 1.9145 3 2.88533 4 3.86757 5 4.86173 6 5.86733 7 6.88302 8 7.90675 9 8.93599 10 9.968 Current estimated solution: 1 0.994126 2 1.98918 3 2.98549 4 3.98325 5 4.98251 6 5.98322 7 6.9852 8 7.9882 9 8.9919 10 9.99595 R83V_INDICATOR_TEST R83V_INDICATOR sets up an R83V indicator matrix. We check three cases, MN. The R83V indicator matrix: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 The R83V indicator matrix: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 The R83V indicator matrix: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 R83V_JAC_SL_TEST R83V_JAC_SL solves a linear system using Jacobi iteration, for an R83V matrix. Matrix order N = 10 Iterations per call = 25 The right hand side: 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 11 Current estimated solution: 1 0.315171 2 0.727797 3 1.14042 4 1.82758 5 2.51474 6 3.59047 7 4.6662 8 6.1282 9 7.5902 10 9.2951 Current estimated solution: 1 0.757545 2 1.51509 3 2.34936 4 3.18363 5 4.14729 6 5.11094 7 6.21581 8 7.32068 9 8.53366 10 9.74665 Current estimated solution: 1 0.910021 2 1.83432 3 2.75863 4 3.72124 5 4.68386 6 5.69666 7 6.70946 8 7.76839 9 8.82731 10 9.91366 R83V_MTV_TEST R83V_MTV computes b=A'*x, where A is an R83V matrix. We check three cases, MN. Product comparison: 0: 1.26635 1.26635 1: 4.05846 4.05846 2: 1.76108 1.76108 3: 0.32987 0.32987 4: 0 0 Product comparison: 0: 0.852144 0.852144 1: 3.63516 3.63516 2: 4.21422 4.21422 3: 4.59692 4.59692 4: 1.82437 1.82437 Product comparison: 0: 0.998532 0.998532 1: 3.95714 3.95714 2: 3.73631 3.73631 R83V_MV_TEST R83V_MV computes b=A*x, where A is an R83V matrix. We check three cases, MN. Product comparison: 0: 0.961747 0.961747 1: 2.11454 2.11454 2: 3.59838 3.59838 Product comparison: 0: 1.68324 1.68324 1: 0.535837 0.535837 2: 4.48352 4.48352 3: 4.93489 4.93489 4: 2.46593 2.46593 Product comparison: 0: 1.07685 1.07685 1: 1.3789 1.3789 2: 2.11099 2.11099 3: 2.48853 2.48853 4: 0 0 R83V_PRINT_TEST R83V_PRINT prints an R83V matrix. The R83V matrix: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 R83V_PRINT_SOME_TEST R83V_PRINT_SOME prints some of an R83V matrix. Rows 2-5, Cols 2-4: Col: 2 3 4 Row --- 2 22 23 3 32 33 34 4 43 44 5 54 R83V_RANDOM_TEST R83V_RANDOM sets up an R83V random matrix. We check three cases, MN. The R83V random matrix: Col: 1 2 3 4 5 Row --- 1 0.829509 0.0661187 2 0.218418 0.561695 0.257578 3 0.956318 0.415307 0.109957 The R83V random matrix: Col: 1 2 3 4 5 Row --- 1 0.415307 0.633966 2 0.218418 0.0661187 0.0617272 3 0.956318 0.257578 0.449539 4 0.829509 0.109957 0.401306 5 0.561695 0.043829 The R83V random matrix: Col: 1 2 3 Row --- 1 0.561695 0.257578 2 0.218418 0.415307 0.109957 3 0.956318 0.0661187 4 0.829509 R83V_RES_TEST R83V_RES computes b-A*x, where A is an R83V 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 R83V_TO_R8GE_TEST R83V_TO_R8GE copies an R83V matrix to an R8GE matrix. We check three cases, MN. R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 R8GE version of A: Col: 1 2 3 4 5 Row --- 1 11 12 0 0 0 2 21 22 23 0 0 3 0 32 33 34 0 R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 R8GE version of A: Col: 1 2 3 4 5 Row --- 1 11 12 0 0 0 2 21 22 23 0 0 3 0 32 33 34 0 4 0 0 43 44 45 5 0 0 0 54 55 R83V matrix A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 R8GE version of A: Col: 1 2 3 Row --- 1 11 12 0 2 21 22 23 3 0 32 33 4 0 0 43 5 0 0 0 R83V_TO_R8VEC_TEST R83V_TO_R8VEC copies an R83V matrix to an R8VEC. We check three cases, MN. R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 Vector version of A: 1 11 2 21 3 12 4 22 5 32 6 23 7 33 8 34 R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 Vector version of A: 1 11 2 21 3 12 4 22 5 32 6 23 7 33 8 43 9 34 10 44 11 54 12 45 13 55 R83V matrix A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 Vector version of A: 1 11 2 21 3 12 4 22 5 32 6 23 7 33 8 43 R83V_TRANSPOSE_TEST R83V_TRANSPOSE makes a transposed copy of an R83V matrix. We check three cases, MN. R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 B = copy of A: Col: 1 2 3 Row --- 1 11 21 2 12 22 32 3 23 33 4 34 R83V matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 B = copy of A: Col: 1 2 3 4 5 Row --- 1 11 21 2 12 22 32 3 23 33 43 4 34 44 54 5 45 55 R83V matrix A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 B = copy of A: Col: 1 2 3 4 5 Row --- 1 11 21 2 12 22 32 3 23 33 43 R83V_ZEROS_TEST R83V_ZEROS sets up an R83V zero matrix. We check three cases, MN. The R83V zero matrix: Col: 1 2 3 4 5 Row --- 1 0 0 2 0 0 0 3 0 0 0 The R83V zero matrix: Col: 1 2 3 4 5 Row --- 1 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 The R83V zero matrix: Col: 1 2 3 Row --- 1 0 0 2 0 0 0 3 0 0 4 0 R8GE_TO_R83V_TEST R8GE_TO_R83V copies an R8GE matrix to an R83V matrix. We check three cases, MN. R8GE matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 13 14 15 2 21 22 23 24 25 3 31 32 33 34 35 R83V copy of (some of ) matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 R8GE matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 13 14 15 2 21 22 23 24 25 3 31 32 33 34 35 4 41 42 43 44 45 5 51 52 53 54 55 R83V copy of (some of ) matrix A: Col: 1 2 3 4 5 Row --- 1 11 12 2 21 22 23 3 32 33 34 4 43 44 45 5 54 55 R8GE matrix A: Col: 1 2 3 Row --- 1 11 12 13 2 21 22 23 3 31 32 33 4 41 42 43 5 51 52 53 R83V copy of (some of ) matrix A: Col: 1 2 3 Row --- 1 11 12 2 21 22 23 3 32 33 4 43 R8VEC_TO_R83V_TEST R8VEC_TO_R83V copies an R8VEC to an R83V matrix. We check three cases, MN. R8VEC: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 R83V matrix: Col: 1 2 3 4 5 Row --- 1 1 3 2 2 4 6 3 5 7 8 R8VEC: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 R83V matrix: Col: 1 2 3 4 5 Row --- 1 1 3 2 2 4 6 3 5 7 9 4 8 10 12 5 11 13 R8VEC: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 R83V matrix: Col: 1 2 3 Row --- 1 1 3 2 2 4 6 3 5 7 4 8 R83V_TEST Normal end of execution. 17 August 2022 11:44:21 PM