02 June 2016 09:09:30 AM R8SM_PRB C++ version Test the R8SM library. R8SM_INDICATOR_TEST R8SM_INDICATOR sets up an R8SM indicator matrix; M = 5 N = 4 The R8SM 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 R8SM_ML_TEST R8SM_ML computes A*x or A'*X where A is a Sherman Morrison matrix. Matrix rows M = 7 Matrix columns N = 7 The Sherman Morrison matrix: Col: 1 2 3 4 5 Row --- 1 -0.523259 -0.519701 0.169118 0.505236 0.0487381 2 0.900681 -0.00340474 -0.0452836 0.0979281 0.20906 3 0.190252 0.0912587 0.356081 -0.281754 0.0248217 4 0.482296 -0.00568034 0.283504 0.224374 0.478787 5 -0.2844 -0.144488 -0.498077 0.595864 0.130874 6 -0.604187 -0.16776 -0.554103 -0.189652 -0.245859 7 -0.0200361 0.518989 0.62397 0.226007 0.622209 Col: 6 7 Row --- 1 0.134385 0.602509 2 0.154183 0.360426 3 0.361971 0.200264 4 0.347365 0.712898 5 -0.251987 0.103843 6 0.15544 0.286048 7 0.193524 0.819502 A*x and PLU*x 1 6.2332 6.2332 2 5.64311 5.64311 3 4.01178 4.01178 4 11.6874 11.6874 5 0.185197 0.185197 6 -1.65495 -1.65495 7 13.8026 13.8026 The Sherman Morrison matrix: Col: 1 2 3 4 5 Row --- 1 0.372211 0.04465 0.806618 0.931129 0.533214 2 -0.234486 -0.116704 0.580868 0.879274 0.123585 3 0.256648 0.260123 0.212966 0.507635 0.0397534 4 -0.460832 -0.492993 0.751566 -0.0487418 0.0681334 5 0.554236 -0.0477249 0.716446 0.448273 0.646527 6 -0.803782 -0.483181 0.429272 0.202573 -0.129083 7 -0.627499 0.0738779 0.840658 0.833144 -0.217538 Col: 6 7 Row --- 1 0.577074 0.266591 2 0.242808 0.325956 3 0.473955 0.296694 4 0.397568 -0.274456 5 -0.0348438 0.651523 6 0.222917 0.143123 7 0.392929 0.434966 A'*x and (PLU)'*x 1 -7.61416 -7.61416 2 -4.00093 -4.00093 3 17.656 17.656 4 13.3064 13.3064 5 2.10755 2.10755 6 7.98862 7.98862 7 7.87188 7.87188 R8SM_MTV_TEST R8SM_MTV computes b=A'*x, where A is an R8SM matrix; M = 5 N = 4 The R8SM 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 The vector x: 1 1 2 2 3 3 4 4 5 5 The result b=A'*x: 1 565 2 580 3 595 4 610 R8SM_MV_TEST R8SM_MV computes b=A*x, where A is an R8SM matrix; M = 5 N = 4 The R8SM 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 The vector x: 1 1 2 2 3 3 4 4 The result b=A*x: 1 130 2 230 3 330 4 430 5 530 R8SM_PRINT_TEST R8SM_PRINT prints an R8SM matrix; M = 5 N = 4 The R8SM 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 R8SM_PRINT_SOME_TEST R8SM_PRINT_SOME prints some of an R8SM matrix; M = 9 N = 9 Rows 2-5, Cols 3-7: Col: 3 4 5 6 7 Row --- 2 23 24 25 26 27 3 33 34 35 36 37 4 43 44 45 46 47 5 53 54 55 56 57 R8SM_RANDOM_TEST R8SM_RANDOM sets up a random R8SM matrix; M = 5 N = 4 The random R8SM matrix: Col: 1 2 3 4 Row --- 1 -0.565494 -0.0315297 -0.240356 -0.705102 2 0.189058 0.162004 0.153873 0.205581 3 0.717179 0.0959643 0.358019 0.249452 4 0.554841 0.0429751 0.752032 0.0883629 5 0.177785 0.604379 0.705757 -0.200583 R8SM_SL_TEST R8SM_SL implements the Sherman-Morrison method for solving a perturbed linear system. Matrix rows M = 5 Matrix columns N = 5 The Sherman-Morrison matrix A: Col: 1 2 3 4 5 Row --- 1 -0.413081 -0.446389 -0.724118 -0.412241 0.0269327 2 0.877654 0.193737 0.35165 0.845924 0.737188 3 0.586159 -0.0875398 0.0984781 0.191185 -0.197573 4 -0.0077973 -0.418356 0.0459899 -0.278876 -0.742942 5 0.230434 0.483928 0.567228 -0.107606 0.0166845 The right hand side vector B: 1 4.22168 2 0.424679 3 3.29472 4 0.199627 5 -1.97976 Solution to A' * X = B: 1 1 2 2 3 3 4 4 5 5 The Sherman-Morrison matrix A: Col: 1 2 3 4 5 Row --- 1 0.251659 0.319285 -0.0915133 0.0346037 0.292301 2 -0.0183719 0.214294 -0.364887 0.694459 0.889569 3 0.754919 0.612363 0.284029 0.0877659 0.763226 4 0.212156 0.225367 0.394769 0.763444 0.75299 5 0.169856 0.201542 0.788678 0.744086 0.406239 The right hand side vector B: 1 2.21561 2 6.54124 3 6.99893 4 8.66593 5 7.94651 Solution to A * X = B: 1 1 2 2 3 3 4 4 5 5 R8SM_TO_R8GE_TEST R8SM_TO_R8GE converts an R8SM matrix to R8GE format; M = 5 N = 4 The R8SM 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 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 R8SM_ZEROS_TEST R8SM_ZEROS sets up a zero R8SM matrix; M = 5 N = 4 The R8SM zero matrix: 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 R8SM_PRB Normal end of execution. 02 June 2016 09:09:30 AM