08-Jan-2022 09:08:35 r83_test(): MATLAB version Test r83(). R83_CG_TEST R83_CG applies CG to an R83 matrix. Number of variables N = 10 Norm of residual ||Ax-b|| = 3.90319e-15 Norm of error ||x1-x2|| = 1.37803e-15 R83_CR_FA_TEST R83_CR_FA factors a real tridiagonal matrix; Once the matrix has been factored, we can call R83_CR_SL to solve a linear system. Matrix order N = 5 Demonstrate multiple system solution method. System matrix A: 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 Solve linear system number #1 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 Solve linear system number #2 Solution: 1: 1 2: 1 3: 1 4: 1 5: 1 R83_CR_SL_TEST R83_CR_SL solves a factored system after R83_CR_FA has factored it. Matrix order N = 5 Demonstrate multiple system solution method. Input matrix A: 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 Solution: 1: 1 2: 2 3: 3 4: 4 5: 5 R83_CR_SLS_TEST R83_CR_SLS solves multiple linear systems A*x1:xn=b1:bn after R83_CR_FA has factored it. Matrix order N = 5 Demonstrate multiple system solution method. Input matrix A: 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 Right hand sides b1:b2 Col: 1 2 Row --- 1 0 1 2 0 0 3 0 0 4 0 0 5 6 1 Solutions x1:x2 Col: 1 2 Row --- 1 1 1 2 2 1 3 3 1 4 4 1 5 5 1 R83_DIF2_TEST R83_DIF2 sets an R83 matrix to the second difference. We check three cases, MN. Second difference in R83 format: Col: 1 2 3 4 5 Row --- 1: 2 -1 2: -1 2 -1 3: -1 2 -1 Second difference in R83 format: 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 Second difference in R83 format: Col: 1 2 3 Row --- 1: 2 -1 2: -1 2 -1 3: -1 2 4: -1 R83_GS_SL_TEST R83_GS_SL applies Gauss-Seidel iteration with an R83 matrix to solve a linear system A*x=b. Current solution estimate: 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 solution estimate: 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 solution estimate: 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 R83_INDICATOR_TEST R83_INDICATOR sets an R83 indicator matrix. We check three cases, MN. R83 indicator matrix: Col: 1 2 3 4 5 Row --- 1: 11 12 2: 21 22 23 3: 32 33 34 R83 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 R83 indicator matrix: Col: 1 2 3 Row --- 1: 11 12 2: 21 22 23 3: 32 33 4: 43 R83_JAC_SL_TEST R83_JAC_SL applies Jacobi iteration with an R83 matrix to solve a linear system A*x=b. Current 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 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 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 R83_MTV_TEST R83_MV computes b=A'*x, where A is an R83 matrix. We check three cases, MN. Product comparison: 1: 2.0988 2.0988 2: 4.32876 4.32876 3: 1.54906 1.54906 4: 2.74721 2.74721 5: 0 0 Product comparison: 1: 2.71119 2.71119 2: 3.27455 3.27455 3: 6.93515 6.93515 4: 7.07569 7.07569 5: 4.21498 4.21498 Product comparison: 1: 0.585679 0.585679 2: 2.71081 2.71081 3: 6.14184 6.14184 R83_MV_TEST R83_MV computes b=A*x, where A is an R83 matrix. We check three cases, MN. Product comparison: 1: 0.797563 0.797563 2: 2.5304 2.5304 3: 4.84204 4.84204 Product comparison: 1: 2.15569 2.15569 2: 3.22671 3.22671 3: 3.8407 3.8407 4: 7.12231 7.12231 5: 2.4806 2.4806 Product comparison: 1: 1.76318 1.76318 2: 4.53112 4.53112 3: 3.42345 3.42345 4: 0.415873 0.415873 5: 0 0 R83_PRINT_TEST R83_PRINT prints an R83 matrix. R83 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 R83_PRINT_SOME_TEST R83_PRINT_SOME prints some of an R83 matrix. Rows 2-5, Cols 2-4: Col: 2 3 4 Row --- 2: 22 23 3: 32 33 34 4: 43 44 5: 54 R83_RANDOM_TEST R83_RANDOM randomizes an R83 matrix. We check three cases, MN. Random R83 matrix: Col: 1 2 3 4 5 Row --- 1: 0.149294 0.840717 2: 0.257508 0.254282 0.243525 3: 0.814285 0.929264 0.349984 Random R83 matrix: Col: 1 2 3 4 5 Row --- 1: 0.196595 0.616045 2: 0.251084 0.473289 0.830829 3: 0.35166 0.585264 0.917194 4: 0.549724 0.285839 0.753729 5: 0.7572 0.380446 Random R83 matrix: Col: 1 2 3 Row --- 1: 0.567822 0.0539501 2: 0.0758543 0.530798 0.934011 3: 0.779167 0.129906 4: 0.568824 R83_RES_TEST R83_RES computes b-A*x, where A is an R83 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 R83_TO_R8GE_TEST R83_TO_R8GE converts an R83 matrix to R8GE format. We check three cases, MN. R83 matrix: Col: 1 2 3 4 5 Row --- 1: 0.0844358 0.25987 2: 0.399783 0.800068 0.910648 3: 0.431414 0.181847 0.263803 R8GE matrix: Col: 1 2 3 4 5 Row --- 1 0.0844358 0.25987 0 0 0 2 0.399783 0.800068 0.910648 0 0 3 0 0.431414 0.181847 0.263803 0 R83 matrix: Col: 1 2 3 4 5 Row --- 1: 0.145539 0.869292 2: 0.136069 0.579705 0.144955 3: 0.54986 0.853031 0.350952 4: 0.622055 0.51325 0.0759667 5: 0.401808 0.239916 R8GE matrix: Col: 1 2 3 4 5 Row --- 1 0.145539 0.869292 0 0 0 2 0.136069 0.579705 0.144955 0 0 3 0 0.54986 0.853031 0.350952 0 4 0 0 0.622055 0.51325 0.0759667 5 0 0 0 0.401808 0.239916 R83 matrix: Col: 1 2 3 Row --- 1: 0.123319 0.239953 2: 0.183908 0.417267 0.902716 3: 0.0496544 0.944787 4: 0.490864 R8GE matrix: Col: 1 2 3 Row --- 1 0.123319 0.239953 0 2 0.183908 0.417267 0.902716 3 0 0.0496544 0.944787 4 0 0 0.490864 5 0 0 0 R83_ZEROS_TEST R83_ZEROS zeros an R83 matrix. We check three cases, MN. Zeroed R83 matrix: Col: 1 2 3 4 5 Row --- 1: 0 0 2: 0 0 0 3: 0 0 0 Zeroed R83 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 Zeroed R83 matrix: Col: 1 2 3 Row --- 1: 0 0 2: 0 0 0 3: 0 0 4: 0 r83_test(): Normal end of execution. 08-Jan-2022 09:08:36