>> linplus_test 05-May-2009 09:43:11 LINPLUS_TEST MATLAB version Test the MATLAB LINPLUS routines. TEST0192 For a matrix in the R8CC format, (double precision compressed column sparse) R8CC_WRITE writes the matrix to 3 files. Matrix rows M = 5 Matrix columns N = 5 Nonzeros NZ_NUM = 12 The COL vector: 1 1 2 4 3 6 4 8 5 10 6 13 The ROW vector: 1 1 2 2 3 4 4 1 5 2 6 3 7 5 8 4 9 5 10 1 11 2 12 5 The R8CC matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 15.000000 2 21.000000 22.000000 0.000000 0.000000 25.000000 3 0.000000 0.000000 33.000000 0.000000 0.000000 4 41.000000 0.000000 0.000000 44.000000 0.000000 5 0.000000 0.000000 53.000000 54.000000 55.000000 TEST0193 For a matrix in the R8CC format, (double precision compressed column sparse) R8CC_READ_SIZE reads the sizes of the data; R8CC_READ reads the data. Matrix rows M = 5 Matrix columns N = 5 Nonzeros NZ_NUM = 12 Index base (0/1) = 1 The COL vector: 1 1 2 4 3 6 4 8 5 10 6 13 The ROW vector: 1 1 2 2 3 4 4 1 5 2 6 3 7 5 8 4 9 5 10 1 11 2 12 5 The R8CC matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 15.000000 2 21.000000 22.000000 0.000000 0.000000 25.000000 3 0.000000 0.000000 33.000000 0.000000 0.000000 4 41.000000 0.000000 0.000000 44.000000 0.000000 5 0.000000 0.000000 53.000000 54.000000 55.000000 FILE_DELETE: Deleting old version of "r8cc_a.txt". FILE_DELETE: Deleting old version of "r8cc_col.txt". FILE_DELETE: Deleting old version of "r8cc_row.txt". TEST0194 For a compressed banded matrix, R8VEC_TO_R8CB converts a real vector to a R8CB matrix. R8CB_TO_R8VEC converts a R8CB matrix to a real vector. Matrix rows M = 5 Matrix columns N = 8 Lower bandwidth ML = 2 Upper bandwidth MU = 1 The R8CB indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 2 21.000000 22.000000 23.000000 3 31.000000 32.000000 33.000000 34.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 5 56.000000 1 1 1 0.000000 2 1 2 11.000000 3 1 3 21.000000 4 1 4 31.000000 1 2 5 12.000000 2 2 6 22.000000 3 2 7 32.000000 4 2 8 42.000000 1 3 9 23.000000 2 3 10 33.000000 3 3 11 43.000000 4 3 12 53.000000 1 4 13 34.000000 2 4 14 44.000000 3 4 15 54.000000 4 4 16 0.000000 1 5 17 45.000000 2 5 18 55.000000 3 5 19 0.000000 4 5 20 0.000000 1 6 21 56.000000 2 6 22 0.000000 3 6 23 0.000000 4 6 24 0.000000 1 7 25 0.000000 2 7 26 0.000000 3 7 27 0.000000 4 7 28 0.000000 1 8 29 0.000000 2 8 30 0.000000 3 8 31 0.000000 4 8 32 0.000000 The recovered R8CB indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 2 21.000000 22.000000 23.000000 3 31.000000 32.000000 33.000000 34.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 5 56.000000 TEST0195 For a general banded matrix, R8VEC_TO_R8GB converts a real vector to a R8GB matrix. R8GB_TO_R8VEC converts a R8GB matrix to a real vector. Matrix rows M = 5 Matrix columns N = 8 Lower bandwidth ML = 2 Upper bandwidth MU = 1 The R8GB indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 3 0.000000 4 0.000000 0.000000 5 56.000000 0.000000 0.000000 1 1 1 0.000000 2 1 2 0.000000 3 1 3 0.000000 4 1 4 11.000000 5 1 5 21.000000 6 1 6 31.000000 1 2 7 0.000000 2 2 8 0.000000 3 2 9 12.000000 4 2 10 22.000000 5 2 11 32.000000 6 2 12 42.000000 1 3 13 0.000000 2 3 14 0.000000 3 3 15 23.000000 4 3 16 33.000000 5 3 17 43.000000 6 3 18 53.000000 1 4 19 0.000000 2 4 20 0.000000 3 4 21 34.000000 4 4 22 44.000000 5 4 23 54.000000 6 4 24 0.000000 1 5 25 0.000000 2 5 26 0.000000 3 5 27 45.000000 4 5 28 55.000000 5 5 29 0.000000 6 5 30 0.000000 1 6 31 0.000000 2 6 32 0.000000 3 6 33 56.000000 4 6 34 0.000000 5 6 35 0.000000 6 6 36 0.000000 1 7 37 0.000000 2 7 38 0.000000 3 7 39 0.000000 4 7 40 0.000000 5 7 41 0.000000 6 7 42 0.000000 1 8 43 0.000000 2 8 44 0.000000 3 8 45 0.000000 4 8 46 0.000000 5 8 47 0.000000 6 8 48 0.000000 The recovered R8GB indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 3 0.000000 4 0.000000 0.000000 5 56.000000 0.000000 0.000000 TEST0196 For a general matrix, R8VEC_TO_R8GE converts a real vector to a R8GE matrix. R8GE_TO_R8VEC converts a R8GE matrix to a real vector. Matrix rows M = 4 Matrix columns N = 6 The R8GE indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 21.000000 22.000000 23.000000 24.000000 25.000000 3 31.000000 32.000000 33.000000 34.000000 35.000000 4 41.000000 42.000000 43.000000 44.000000 45.000000 Col: 6 Row --- 1 16.000000 2 26.000000 3 36.000000 4 46.000000 1 1 1 11.000000 2 1 2 21.000000 3 1 3 31.000000 4 1 4 41.000000 1 2 5 12.000000 2 2 6 22.000000 3 2 7 32.000000 4 2 8 42.000000 1 3 9 13.000000 2 3 10 23.000000 3 3 11 33.000000 4 3 12 43.000000 1 4 13 14.000000 2 4 14 24.000000 3 4 15 34.000000 4 4 16 44.000000 1 5 17 15.000000 2 5 18 25.000000 3 5 19 35.000000 4 5 20 45.000000 1 6 21 16.000000 2 6 22 26.000000 3 6 23 36.000000 4 6 24 46.000000 The recovered R8GE indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 21.000000 22.000000 23.000000 24.000000 25.000000 3 31.000000 32.000000 33.000000 34.000000 35.000000 4 41.000000 42.000000 43.000000 44.000000 45.000000 Col: 6 Row --- 1 16.000000 2 26.000000 3 36.000000 4 46.000000 TEST035 For a real tridiagonal system, R83_GS_SL solves a linear system using Gauss-Seidel iteration Matrix order N = 100 Iterations per call = 1000 Solving A * x = b. Current solution estimate: 1 0.252679 2 0.506519 3 0.762101 4 1.020005 5 1.280812 6 1.545100 7 1.813451 8 2.086442 9 2.364653 10 2.648661 Current solution estimate: 1 0.698130 2 1.396838 3 2.096412 4 2.797139 5 3.499303 6 4.203189 7 4.909079 8 5.617253 9 6.327987 10 7.041558 Current solution estimate: 1 0.884923 2 1.770068 3 2.655546 4 3.541468 5 4.427944 6 5.315083 7 6.202992 8 7.091780 9 7.981554 10 8.872419 Solving A' * x = b. Current solution estimate: 1 0.252679 2 0.506519 3 0.762101 4 1.020005 5 1.280812 6 1.545100 7 1.813451 8 2.086442 9 2.364653 10 2.648661 Current solution estimate: 1 0.698130 2 1.396838 3 2.096412 4 2.797139 5 3.499303 6 4.203189 7 4.909079 8 5.617253 9 6.327987 10 7.041558 Current solution estimate: 1 0.884923 2 1.770068 3 2.655546 4 3.541468 5 4.427944 6 5.315083 7 6.202992 8 7.091780 9 7.981554 10 8.872419 TEST037 R83_INDICATOR sets up a R83 indicator matrix. Matrix order N = 10 The R83 indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 2 201.000000 202.000000 203.000000 3 302.000000 303.000000 304.000000 4 403.000000 404.000000 405.000000 5 504.000000 505.000000 6 605.000000 Col: 6 7 8 9 10 Row --- 5 506.000000 6 606.000000 607.000000 7 706.000000 707.000000 708.000000 8 807.000000 808.000000 809.000000 9 908.000000 909.000000 910.000000 10 1009.000000 1010.000000 TEST04 For a real tridiagonal system, R83_JAC_SL solves a linear system using Jacobi iteration Matrix order N = 100 Iterations per call = 1000 Solving A * x = b. Current solution estimate: 1 0.031082 2 0.062164 3 0.094395 4 0.126625 5 0.161175 6 0.195725 7 0.233812 8 0.271898 9 0.314805 10 0.357712 Current solution estimate: 1 0.281638 2 0.563275 3 0.847221 4 1.131167 5 1.419726 6 1.708285 7 2.003761 8 2.299236 9 2.603924 10 2.908612 Current solution estimate: 1 0.537777 2 1.075555 3 1.615051 4 2.154547 5 2.697476 6 3.240404 7 3.788467 8 4.336530 9 4.891413 10 5.446296 Solving A' * x = b. Current solution estimate: 1 0.031082 2 0.062164 3 0.094395 4 0.126625 5 0.161175 6 0.195725 7 0.233812 8 0.271898 9 0.314805 10 0.357712 Current solution estimate: 1 0.281638 2 0.563275 3 0.847221 4 1.131167 5 1.419726 6 1.708285 7 2.003761 8 2.299236 9 2.603924 10 2.908612 Current solution estimate: 1 0.537777 2 1.075555 3 1.615051 4 2.154547 5 2.697476 6 3.240404 7 3.788467 8 4.336530 9 4.891413 10 5.446296 TEST05 For a tridiagonal matrix that can be factored with no pivoting, R83_NP_FA factors, R83_NP_DET computes the determinant. Matrix order N = 10 The factored R83 matrix: Col: 1 2 3 4 5 Row --- 1 0.633966 0.218418 2 0.021479 0.057036 0.956318 3 15.062403 -13.954902 0.829509 4 -0.060255 0.451288 0.561695 5 0.272783 0.601452 6 0.012490 Col: 6 7 8 9 10 Row --- 5 0.415307 6 0.792100 0.066119 7 0.328624 -0.019890 0.257578 8 -45.876883 12.714370 0.109957 9 0.008940 0.349769 0.043829 10 1.005316 0.050483 R83_NP_DET computes determinant = 0.000484 R8GE_NP_DET computes determinant = 0.000484 TEST06 For a tridiagonal matrix that can be factored with no pivoting, R83_NP_FA factors; R83_NP_SL solves a factored system. Matrix order N = 10 The tridiagonal matrix: Col: 1 2 3 4 5 Row --- 1 0.633966 0.218418 2 0.013617 0.061727 0.956318 3 0.859097 0.449539 0.829509 4 0.840847 0.401306 0.561695 5 0.123104 0.754673 6 0.007512 Col: 6 7 8 9 10 Row --- 5 0.415307 6 0.797287 0.066119 7 0.260303 0.001838 0.257578 8 0.912484 0.897504 0.109957 9 0.113664 0.350752 0.043829 10 0.351629 0.094545 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to tranposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST07 R83_NP_FS factors and solves a tridiagonal linear system. Matrix order N = 10 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST08 R83_NP_ML computes A*x or A'*x where A has been factored by R83_FA. Matrix order N = 10 A*x and PLU*x: 1 1.070802 1.070802 2 3.006024 3.006024 3 6.384848 6.384848 4 6.936245 6.936245 5 6.757626 6.757626 6 5.284115 5.284115 7 3.635309 3.635309 8 14.557030 14.557030 9 4.504373 4.504373 10 4.110105 4.110105 A'*x and (PLU)'*x 1 1.360150 1.360150 2 4.091873 4.091873 3 4.388847 4.388847 4 4.682972 4.682972 5 8.346466 8.346466 6 8.627291 8.627291 7 11.477416 11.477416 8 14.795007 14.795007 9 14.300325 14.300325 10 2.877661 2.877661 TEST09 R83P_DET, determinant of a tridiagonal periodic matrix. Matrix order N = 12 The periodic tridiagonal matrix: Col: 1 2 3 4 5 Row --- 1 0.956318 0.561695 2 0.829509 0.415307 0.257578 3 0.066119 0.109957 0.633966 4 0.043829 0.061727 0.401306 5 0.449539 0.754673 6 0.797287 7 8 9 10 11 12 0.218418 Col: 6 7 8 9 10 Row --- 5 0.001838 6 0.897504 0.094545 7 0.350752 0.013617 0.840847 8 0.859097 0.123104 0.260303 9 0.007512 0.912484 0.351629 10 0.113664 0.822887 11 0.267132 Col: 11 12 Row --- 1 0.597917 2 3 4 5 6 7 8 9 10 0.692066 11 0.561662 0.453794 12 0.861216 0.911977 R83P_DET computes the determinant = -4.192409e-05 R8GE_DET computes the determinant = -4.192409e-05 TEST10 R83P_FA factors a tridiagonal periodic system. R83P_SL solves a tridiagonal periodic system. Matrix order N = 10 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST105 R83P_INDICATOR sets up an R83P indicator matrix. Warning: See help sprintf for valid escape sequences. > In linplus_test105 at 23 In linplus_test at 39 Matrix order N = The R83P indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 2 201.000000 202.000000 203.000000 3 302.000000 303.000000 304.000000 4 403.000000 404.000000 405.000000 5 504.000000 505.000000 6 605.000000 7 8 9 10 1001.000000 Col: 6 7 8 9 10 Row --- 1 110.000000 2 3 4 5 506.000000 6 606.000000 607.000000 7 706.000000 707.000000 708.000000 8 807.000000 808.000000 809.000000 9 908.000000 909.000000 910.000000 10 1009.000000 1010.000000 TEST11 R83P_ML computes A*x or A'*X where A has been factored by R83P_FA. Matrix order N = 10 A*x and PLU*x 1 4.751031 4.751031 2 2.432857 2.432857 3 2.997971 2.997971 4 2.384927 2.384927 5 5.582554 5.582554 6 10.033272 10.033272 7 8.926612 8.926612 8 9.341236 9.341236 9 11.788739 11.788739 10 9.470268 9.470268 A'*x and (PLU)'*x 1 9.204759 9.204759 2 4.071498 4.071498 3 4.250339 4.250339 4 4.688539 4.688539 5 5.554043 5.554043 6 6.373901 6.373901 7 11.217532 11.217532 8 12.683676 12.683676 9 17.734230 17.734230 10 14.896107 14.896107 TEST115 R85_INDICATOR sets up a R85 indicator matrix. Matrix order N = 10 The R85 indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 103.000000 2 201.000000 202.000000 203.000000 204.000000 3 301.000000 302.000000 303.000000 304.000000 305.000000 4 402.000000 403.000000 404.000000 405.000000 5 503.000000 504.000000 505.000000 6 604.000000 605.000000 7 705.000000 Col: 6 7 8 9 10 Row --- 4 406.000000 5 506.000000 507.000000 6 606.000000 607.000000 608.000000 7 706.000000 707.000000 708.000000 709.000000 8 806.000000 807.000000 808.000000 809.000000 810.000000 9 907.000000 908.000000 909.000000 910.000000 10 1008.000000 1009.000000 1010.000000 TEST12 R85_NP_FS factors and solves a pentadiagonal linear system, with no pivoting. Matrix order N = 10 The pentadiagonal matrix: Col: 1 2 3 4 5 Row --- 1 0.350752 0.043829 0.218418 2 0.351629 0.094545 0.633966 0.956318 3 0.188955 0.822887 0.013617 0.061727 0.829509 4 0.761492 0.267132 0.859097 0.449539 5 0.396988 0.692066 0.840847 6 0.185314 0.561662 7 0.574366 Col: 6 7 8 9 10 Row --- 4 0.561695 5 0.401306 0.415307 6 0.123104 0.754673 0.066119 7 0.861216 0.007512 0.797287 0.257578 8 0.367027 0.453794 0.260303 0.001838 0.109957 9 0.617205 0.911977 0.912484 0.897504 10 0.361529 0.597917 0.113664 The right hand side: 1 1.620874 2 5.747549 3 4.580672 4 10.106421 5 15.881457 6 13.956661 7 15.842357 8 19.883225 9 16.009274 10 10.093831 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST13 For a border banded matrix: R8BB_FA factors; R8BB_PRINT prints; R8BB_RANDOM randomizes; R8BB_SL solves. Matrix order N = 10 Matrix suborder N1 = 8 Matrix suborder N2 = 2 Lower bandwidth ML = 1 Upper bandwidth MU = 1 The border-banded matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.829509 0.000000 0.000000 0.000000 2 0.956318 0.561695 0.066119 0.000000 0.000000 3 0.000000 0.415307 0.257578 0.043829 0.000000 4 0.000000 0.000000 0.109957 0.633966 0.449539 5 0.000000 0.000000 0.000000 0.061727 0.401306 6 0.000000 0.000000 0.000000 0.000000 0.754673 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.396988 0.574366 0.617205 0.212930 0.117707 10 0.185314 0.367027 0.361529 0.714471 0.299329 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.123104 0.692066 2 0.000000 0.000000 0.000000 0.007512 0.561662 3 0.000000 0.000000 0.000000 0.260303 0.861216 4 0.000000 0.000000 0.000000 0.912484 0.453794 5 0.797287 0.000000 0.000000 0.113664 0.911977 6 0.001838 0.350752 0.000000 0.351629 0.597917 7 0.897504 0.094545 0.859097 0.822887 0.188955 8 0.000000 0.013617 0.840847 0.267132 0.761492 9 0.825003 0.061862 0.088283 0.745303 0.899373 10 0.824660 0.710781 0.777994 0.308675 0.763537 The right hand side vector: 1 9.906037 2 7.962301 3 12.733548 4 17.863719 5 17.179909 6 15.383491 7 22.215145 8 16.841209 9 26.628364 10 32.919302 The FACTORED border-banded matrix: Col: 1 2 3 4 5 Row --- 1 0.956318 0.561695 0.066119 0.000000 0.000000 2 -0.228395 0.701221 -0.015101 0.000000 0.000000 3 0.000000 -0.592263 0.266522 0.043829 0.000000 4 0.000000 0.000000 -0.412562 0.615884 0.449539 5 0.000000 0.000000 0.000000 -0.100225 0.754673 6 0.000000 0.000000 0.000000 0.000000 -0.472060 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.396988 0.574366 0.617205 0.212930 0.117707 10 0.185314 0.367027 0.361529 0.714471 0.299329 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.125967 0.071076 2 0.000000 0.000000 0.000000 -0.181574 -0.853023 3 0.000000 0.000000 0.000000 -0.393040 -2.276121 4 0.000000 0.000000 0.000000 -1.908679 1.809966 5 0.001838 0.350752 0.000000 0.758046 -3.005246 6 0.897504 0.094545 0.859097 -0.376345 0.228679 7 -0.887371 -0.249472 -0.762338 -2.631526 4.760175 8 0.000000 0.054583 0.799237 -0.275079 -0.982712 9 0.825003 0.061862 0.088283 -3.408314 2.841832 10 0.824660 0.710781 0.777994 -0.107477 -0.844588 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST14 For a border banded matrix: R8BB_FA factors; R8BB_SL solves. Matrix order N = 10 Matrix suborder N1 = 0 Matrix suborder N2 = 10 Lower bandwidth ML = 0 Upper bandwidth MU = 0 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST15 For a border banded matrix: R8BB_FA factors; R8BB_SL solves. Matrix order N = 10 Matrix suborder N1 = 10 Matrix suborder N2 = 0 Lower bandwidth ML = 1 Upper bandwidth MU = 1 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST151 R8BB_INDICATOR sets up an indicator matrix. Matrix order N = 8 Matrix suborder N1 = 6 Matrix suborder N2 = 2 Lower bandwidth ML = 1 Upper bandwidth MU = 1 The indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 0.000000 32.000000 33.000000 34.000000 0.000000 4 0.000000 0.000000 43.000000 44.000000 45.000000 5 0.000000 0.000000 0.000000 54.000000 55.000000 6 0.000000 0.000000 0.000000 0.000000 65.000000 7 71.000000 72.000000 73.000000 74.000000 75.000000 8 81.000000 82.000000 83.000000 84.000000 85.000000 Col: 6 7 8 Row --- 1 0.000000 17.000000 18.000000 2 0.000000 27.000000 28.000000 3 0.000000 37.000000 38.000000 4 0.000000 47.000000 48.000000 5 56.000000 57.000000 58.000000 6 66.000000 67.000000 68.000000 7 76.000000 77.000000 78.000000 8 86.000000 87.000000 88.000000 TEST152 R8BLT_INDICATOR sets up a R8BLT indicator matrix. Matrix order N = 6 Lower bandwidth ML = 2 The indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 2 21.000000 22.000000 3 31.000000 32.000000 33.000000 4 42.000000 43.000000 44.000000 5 53.000000 54.000000 55.000000 6 64.000000 65.000000 Col: 6 Row --- 6 66.000000 TEST153 For a band matrix in lower triangular storage, R8BLT_RANDOM sets a random value; R8BLT_SL solves systems; R8BLT_MXV computes matrix-vector products; R8BLT_VXM computes vector-matrix products; Matrix order N = 10 Lower bandwidth ML = 3 The R8BLT matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 2 0.956318 0.829509 3 0.561695 0.415307 0.066119 4 0.257578 0.109957 0.043829 0.633966 5 0.061727 0.449539 0.401306 0.754673 6 0.797287 0.001838 0.897504 7 0.094545 0.013617 8 0.123104 Col: 6 7 8 9 10 Row --- 6 0.350752 7 0.859097 0.840847 8 0.007512 0.260303 0.912484 9 0.113664 0.351629 0.822887 0.267132 10 0.692066 0.561662 0.861216 0.453794 The right hand side: 1 0.218418 2 2.615336 3 1.590666 4 3.144841 5 6.850664 6 8.991249 7 11.486777 8 9.782584 9 12.130674 10 21.626645 Solution to the untransposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 The right hand side: 1 4.846451 2 3.653403 3 7.405089 4 5.215238 5 10.238541 6 9.201267 7 18.053679 8 20.322480 9 11.016348 10 4.537938 Solution to the transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST154 For a real block Toeplitz matrix, R8BTO_INDICATOR sets up an indicator matrix Block order M = 2 Block number L = 3 Matrix order N = 6 The block Toeplitz matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 21.000000 22.000000 23.000000 24.000000 25.000000 3 31.000000 32.000000 11.000000 12.000000 13.000000 4 41.000000 42.000000 21.000000 22.000000 23.000000 5 51.000000 52.000000 31.000000 32.000000 11.000000 6 61.000000 62.000000 41.000000 42.000000 21.000000 Col: 6 Row --- 1 16.000000 2 26.000000 3 14.000000 4 24.000000 5 12.000000 6 22.000000 TEST155 For a real block Toeplitz matrix, R8BTO_MXV computes A * x. R8BTO_VXM computes A'* x. Block order M = 2 Block number L = 3 Matrix order N = 6 The block Toeplitz matrix: Col: 1 2 3 4 5 Row --- 1 1.000000 2.000000 3.000000 4.000000 5.000000 2 5.000000 5.000000 6.000000 6.000000 7.000000 3 7.000000 8.000000 1.000000 2.000000 3.000000 4 8.000000 8.000000 5.000000 5.000000 6.000000 5 9.000000 0.000000 7.000000 8.000000 1.000000 6 9.000000 9.000000 8.000000 8.000000 5.000000 Col: 6 Row --- 1 6.000000 2 7.000000 3 4.000000 4 6.000000 5 2.000000 6 5.000000 The matrix x: Col: 1 2 3 Row --- 1 11.000000 12.000000 13.000000 2 21.000000 22.000000 23.000000 The product A*x: Col: 1 2 3 Row --- 1 380.000000 432.000000 418.000000 2 616.000000 642.000000 740.000000 The product A'*x: Col: 1 2 3 Row --- 1 700.000000 556.000000 498.000000 2 606.000000 592.000000 534.000000 n = 6 mu = 2 TEST1565 R8BUT_INDICATOR sets up a R8BUT indicator matrix. Matrix order N = 6 Upper bandwidth MU = 2 The indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 2 22.000000 23.000000 24.000000 3 33.000000 34.000000 35.000000 4 44.000000 45.000000 5 55.000000 6 Col: 6 Row --- 6 66.000000 TEST1566 For a band matrix in upper triangular storage, R8BUT_RANDOM sets a random value; R8BUT_SL solves systems; R8BUT_MXV computes matrix-vector products; R8BUT_VXM computes vector-matrix products; Matrix order N = 10 Upper bandwidth MU = 3 The R8BUT matrix: Col: 1 2 3 4 5 Row --- 1 0.260303 0.001838 0.109957 0.218418 2 0.912484 0.897504 0.043829 0.956318 3 0.113664 0.350752 0.633966 4 0.351629 0.094545 5 0.822887 6 7 8 Col: 6 7 8 9 10 Row --- 6 0.267132 0.859097 0.401306 0.066119 7 0.692066 0.840847 0.754673 0.257578 8 0.561662 0.123104 0.797287 9 0.861216 0.007512 10 0.453794 The right hand side: 1 1.467523 2 9.474383 3 9.890885 4 6.181470 5 10.665367 6 11.421990 7 20.939084 8 13.574105 9 7.826066 10 4.537938 Solution to the untransposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 The right hand side: 1 0.260303 2 1.826806 3 2.245957 4 2.764848 5 8.307148 6 4.406315 7 14.493523 8 14.863605 9 14.415200 10 12.786889 Solution to the transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST157 For a compact band matrix: R8CB_INDICATOR computes the indicator matrix; Matrix rows M = 8 Matrix columns N = 10 Lower bandwidth ML = 2 Upper bandwidth MU = 3 The R8CB indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 103.000000 104.000000 2 201.000000 202.000000 203.000000 204.000000 205.000000 3 301.000000 302.000000 303.000000 304.000000 305.000000 4 402.000000 403.000000 404.000000 405.000000 5 503.000000 504.000000 505.000000 6 604.000000 605.000000 7 705.000000 Col: 6 7 8 9 10 Row --- 3 306.000000 4 406.000000 407.000000 5 506.000000 507.000000 508.000000 6 606.000000 607.000000 608.000000 609.000000 7 706.000000 707.000000 708.000000 709.000000 710.000000 8 806.000000 807.000000 808.000000 809.000000 810.000000 TEST16 For a compact band matrix, no pivoting: R8CB_NP_FA factors; R8CB_DET computes the determinant; Matrix order N = Lower bandwidth ML = Upper bandwidth MU = The compact band matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.561695 0.109957 0.401306 2 0.956318 0.415307 0.043829 0.754673 0.094545 3 0.829509 0.066119 0.633966 0.797287 0.013617 4 0.257578 0.061727 0.001838 0.859097 5 0.449539 0.897504 0.840847 6 0.350752 0.123104 7 0.007512 Col: 6 7 8 9 10 Row --- 3 0.260303 4 0.912484 0.692066 5 0.113664 0.561662 0.188955 6 0.351629 0.861216 0.761492 0.617205 7 0.822887 0.453794 0.396988 0.361529 0.299329 8 0.267132 0.911977 0.185314 0.212930 0.825003 9 0.597917 0.574366 0.714471 0.824660 10 0.367027 0.117707 0.061862 R8CB_DET computes the determinant = 0.018359 R8GE_DET computes the determinant = 0.018359 TEST17 For a compact band matrix, no pivoting: R8CB_NP_FA factors; R8CB_NP_SL solves. Matrix order N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 2 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST18 For a compact band matrix: R8CB_ML computes A*x or A'*X where A has been factored by R8CB_FA. Matrix order N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 2 A*x and PLU*x 1 2.075793 2.075793 2 5.388305 5.388305 3 5.180761 5.180761 4 8.020592 8.020592 5 8.067618 8.067618 6 12.730819 12.730819 7 8.520670 8.520670 8 15.401687 15.401687 9 20.757831 20.757831 10 13.730111 13.730111 A'*x and (PLU)'*x 1 1.711939 1.711939 2 2.490714 2.490714 3 3.537742 3.537742 4 7.104394 7.104394 5 6.805030 6.805030 6 14.986153 14.986153 7 18.746851 18.746851 8 7.883279 7.883279 9 12.773262 12.773262 10 2.654179 2.654179 TEST19 For a compressed border banded matrix: R8CBB_RANDOM randomly generates; R8CBB_PRINT prints; R8CBB_FA factors (no pivoting); R8CBB_SL solves. Matrix order N = 10 Matrix suborder N1 = 8 Matrix suborder N2 = 2 Lower bandwidth ML = 1 Upper bandwidth MU = 1 The R8CBB matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.829509 0.000000 0.000000 0.000000 2 0.956318 0.561695 0.066119 0.000000 0.000000 3 0.000000 0.415307 0.257578 0.043829 0.000000 4 0.000000 0.000000 0.109957 0.633966 0.449539 5 0.000000 0.000000 0.000000 0.061727 0.401306 6 0.000000 0.000000 0.000000 0.000000 0.754673 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.396988 0.574366 0.617205 0.212930 0.117707 10 0.185314 0.367027 0.361529 0.714471 0.299329 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.123104 0.692066 2 0.000000 0.000000 0.000000 0.007512 0.561662 3 0.000000 0.000000 0.000000 0.260303 0.861216 4 0.000000 0.000000 0.000000 0.912484 0.453794 5 0.797287 0.000000 0.000000 0.113664 0.911977 6 0.001838 0.350752 0.000000 0.351629 0.597917 7 0.897504 0.094545 0.859097 0.822887 0.188955 8 0.000000 0.013617 0.840847 0.267132 0.761492 9 0.825003 0.061862 0.088283 0.745303 0.899373 10 0.824660 0.710781 0.777994 0.308675 0.763537 The factored matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.829509 0.000000 0.000000 0.000000 2 -4.378377 -3.070208 0.066119 0.000000 0.000000 3 0.000000 0.135270 0.266522 0.043829 0.000000 4 0.000000 0.000000 -0.412562 0.615884 0.449539 5 0.000000 0.000000 0.000000 -0.100225 0.356251 6 0.000000 0.000000 0.000000 0.000000 -2.118376 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.396988 0.574366 0.617205 0.212930 0.117707 10 0.185314 0.367027 0.361529 0.714471 0.299329 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.125967 0.071076 2 0.000000 0.000000 0.000000 -0.181574 -0.853023 3 0.000000 0.000000 0.000000 -0.393040 -2.276121 4 0.000000 0.000000 0.000000 -1.908679 1.809966 5 0.797287 0.000000 0.000000 0.758046 -3.005246 6 -1.687115 0.350752 0.000000 -0.376345 0.228679 7 0.531976 0.281136 0.859097 -2.631526 4.760175 8 0.000000 -0.048435 0.799237 -0.275079 -0.982712 9 0.825003 0.061862 0.088283 -0.366315 -0.539156 10 0.824660 0.710781 0.777994 -9.304316 7.858310 The right hand side vector: 1 9.906037 2 7.962301 3 12.733548 4 17.863719 5 17.179909 6 15.383491 7 22.215145 8 16.841209 9 26.628364 10 32.919302 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST193 For a compressed border banded matrix: R8CBB_INDICATOR sets an indicator matrix. Matrix order N = 10 Matrix suborder N1 = 8 Matrix suborder N2 = 2 Lower bandwidth ML = 1 Upper bandwidth MU = 1 The compact border-banded matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 201.000000 202.000000 203.000000 0.000000 0.000000 3 0.000000 302.000000 303.000000 304.000000 0.000000 4 0.000000 0.000000 403.000000 404.000000 405.000000 5 0.000000 0.000000 0.000000 504.000000 505.000000 6 0.000000 0.000000 0.000000 0.000000 605.000000 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 901.000000 902.000000 903.000000 904.000000 905.000000 10 1001.000000 1002.000000 1003.000000 1004.000000 1005.000000 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 109.000000 110.000000 2 0.000000 0.000000 0.000000 209.000000 210.000000 3 0.000000 0.000000 0.000000 309.000000 310.000000 4 0.000000 0.000000 0.000000 409.000000 410.000000 5 506.000000 0.000000 0.000000 509.000000 510.000000 6 606.000000 607.000000 0.000000 609.000000 610.000000 7 706.000000 707.000000 708.000000 709.000000 710.000000 8 0.000000 807.000000 808.000000 809.000000 810.000000 9 906.000000 907.000000 908.000000 909.000000 910.000000 10 1006.000000 1007.000000 1008.000000 1009.000000 1010.000000 TEST195 R8CI_EVAL finds the eigenvalues of a real circulant system. Matrix order N = 5 The circulant matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.829509 0.561695 0.415307 2 0.415307 0.218418 0.956318 0.829509 0.561695 3 0.561695 0.415307 0.218418 0.956318 0.829509 4 0.829509 0.561695 0.415307 0.218418 0.956318 5 0.956318 0.829509 0.561695 0.415307 0.218418 The eigenvalues: 1 -0.461343 + -0.0632919 i 2 -0.461343 + 0.0632919 i 3 -0.483235 + -0.671949 i 4 -0.483235 + 0.671949 i 5 2.98125 TEST197 R8CI_INDICATOR sets up a R8CI indicator matrix. Matrix order N = 5 The circulant matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 15.000000 11.000000 12.000000 13.000000 14.000000 3 14.000000 15.000000 11.000000 12.000000 13.000000 4 13.000000 14.000000 15.000000 11.000000 12.000000 5 12.000000 13.000000 14.000000 15.000000 11.000000 TEST20 R8CI_SL solves a circulant system. Matrix order N = 10 The circulant matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.829509 0.561695 0.415307 2 0.633966 0.218418 0.956318 0.829509 0.561695 3 0.043829 0.633966 0.218418 0.956318 0.829509 4 0.109957 0.043829 0.633966 0.218418 0.956318 5 0.257578 0.109957 0.043829 0.633966 0.218418 6 0.066119 0.257578 0.109957 0.043829 0.633966 7 0.415307 0.066119 0.257578 0.109957 0.043829 8 0.561695 0.415307 0.066119 0.257578 0.109957 9 0.829509 0.561695 0.415307 0.066119 0.257578 10 0.956318 0.829509 0.561695 0.415307 0.066119 Col: 6 7 8 9 10 Row --- 1 0.066119 0.257578 0.109957 0.043829 0.633966 2 0.415307 0.066119 0.257578 0.109957 0.043829 3 0.561695 0.415307 0.066119 0.257578 0.109957 4 0.829509 0.561695 0.415307 0.066119 0.257578 5 0.956318 0.829509 0.561695 0.415307 0.066119 6 0.218418 0.956318 0.829509 0.561695 0.415307 7 0.633966 0.218418 0.956318 0.829509 0.561695 8 0.043829 0.633966 0.218418 0.956318 0.829509 9 0.109957 0.043829 0.633966 0.218418 0.956318 10 0.257578 0.109957 0.043829 0.633966 0.218418 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST21 For a general banded matrix, R8GB_DET computes the determinant. Matrix rows M = 10 Matrix columns N = 10 Lower bandwidth ML = 3 Upper bandwidth MU = 2 A random R8GB matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.415307 0.633966 0.000000 0.000000 2 0.956318 0.066119 0.061727 0.001838 0.000000 3 0.829509 0.257578 0.449539 0.897504 0.840847 4 0.561695 0.109957 0.401306 0.350752 0.123104 5 0.043829 0.754673 0.094545 0.007512 6 0.797287 0.013617 0.260303 7 0.859097 0.912484 8 0.113664 Col: 6 7 8 9 10 Row --- 1 0.000000 2 0.000000 0.000000 3 0.000000 0.000000 0.000000 4 0.351629 0.000000 0.000000 0.000000 5 0.822887 0.453794 0.000000 0.000000 0.000000 6 0.267132 0.911977 0.185314 0.000000 0.000000 7 0.692066 0.597917 0.574366 0.212930 0.000000 8 0.561662 0.188955 0.367027 0.714471 0.825003 9 0.861216 0.761492 0.617205 0.117707 0.824660 10 0.396988 0.361529 0.299329 0.061862 R8GB_DET computes the determinant = 0.002404 R8GE_DET computes the determinant = 0.002404 TEST22 For a general banded matrix, R8GB_FA computes the PLU factors. R8GB_SL solves a factored linear system. Number of matrix rows M = 5 Number of matrix columns N = 5 Lower bandwidth ML = 1 Upper bandwidth MU = 2 The banded matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.829509 0.066119 0.000000 2 0.956318 0.561695 0.257578 0.633966 0.000000 3 0.415307 0.109957 0.061727 0.754673 4 0.043829 0.449539 0.797287 5 0.401306 0.001838 Solution to A*x=b: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 Right hand side of transposed system: 1 2.131053 2 3.198821 3 1.086461 4 5.257800 5 5.462360 Solution to A'x=b: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST23 For a general banded matrix, R8GB_FA factors, using LINPACK conventions; R8GB_TRF factors, using LAPACK conventions; Matrix rows M = 5 Matrix columns N = 5 Lower bandwidth ML = 1 Upper bandwidth MU = 1 The R8GB_FA factors: Col: 1 2 3 4 5 Row --- 1 0.956318 0.561695 0.066119 2 -0.228395 0.701221 -0.015101 0.000000 3 -0.592263 0.266522 0.043829 0.000000 4 -0.412562 0.615884 0.449539 5 -0.100225 0.356251 The R8GB_TRF factors: Col: 1 2 3 4 5 Row --- 1 0.956318 0.561695 0.066119 2 0.228395 0.701221 -0.015101 0.000000 3 0.592263 0.266522 0.043829 0.000000 4 0.412562 0.615884 0.449539 5 0.100225 0.356251 TEST235 For a general banded matrix, R8GB_INDICATOR computes the indicator matrix. Matrix rows M = 10 Matrix columns N = 8 Lower bandwidth ML = 3 Upper bandwidth MU = 2 The banded matrix in R8GE format: Col: 1 2 3 4 5 Row --- 1 -1.000000 -6.000000 -10.000000 -13.000000 -15.000000 2 -2.000000 -7.000000 -11.000000 -14.000000 0.000000 3 -3.000000 -8.000000 -12.000000 0.000000 0.000000 4 -4.000000 -9.000000 13.000000 24.000000 35.000000 5 -5.000000 12.000000 23.000000 34.000000 45.000000 6 11.000000 22.000000 33.000000 44.000000 55.000000 7 21.000000 32.000000 43.000000 54.000000 65.000000 8 31.000000 42.000000 53.000000 64.000000 75.000000 9 41.000000 52.000000 63.000000 74.000000 85.000000 Col: 6 7 8 Row --- 1 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 4 46.000000 57.000000 68.000000 5 56.000000 67.000000 78.000000 6 66.000000 77.000000 88.000000 7 76.000000 87.000000 98.000000 8 86.000000 97.000000 108.000000 9 96.000000 107.000000 -16.000000 The R8GB indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 24.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 35.000000 4 41.000000 42.000000 43.000000 44.000000 45.000000 5 52.000000 53.000000 54.000000 55.000000 6 63.000000 64.000000 65.000000 7 74.000000 75.000000 8 85.000000 Col: 6 7 8 Row --- 1 0.000000 2 0.000000 0.000000 3 0.000000 0.000000 0.000000 4 46.000000 0.000000 0.000000 5 56.000000 57.000000 0.000000 6 66.000000 67.000000 68.000000 7 76.000000 77.000000 78.000000 8 86.000000 87.000000 88.000000 9 96.000000 97.000000 98.000000 10 107.000000 108.000000 TEST24 For a general banded matrix, R8GB_ML computes A*x or A'*X where A has been factored by R8GB_FA. Matrix rows M = 10 Matrix columns N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 2 A*x and PLU*x 1 2.075793 2.075793 2 5.388305 5.388305 3 5.180761 5.180761 4 8.020592 8.020592 5 8.067618 8.067618 6 12.730819 12.730819 7 8.520670 8.520670 8 15.401687 15.401687 9 20.757831 20.757831 10 13.730111 13.730111 A'*x and (PLU)'*x 1 1.711939 1.711939 2 2.490714 2.490714 3 3.537742 3.537742 4 7.104394 7.104394 5 6.805030 6.805030 6 14.986153 14.986153 7 18.746851 18.746851 8 7.883279 7.883279 9 12.773262 12.773262 10 2.654179 2.654179 TEST25 For a general banded matrix, R8GB_PRINT prints the matrix. Matrix rows M = 8 Matrix columns N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 3 The R8GB matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 103.000000 104.000000 0.000000 2 201.000000 202.000000 203.000000 204.000000 205.000000 3 302.000000 303.000000 304.000000 305.000000 4 403.000000 404.000000 405.000000 5 504.000000 505.000000 6 605.000000 Col: 6 7 8 9 10 Row --- 2 0.000000 3 306.000000 0.000000 4 406.000000 407.000000 0.000000 5 506.000000 507.000000 508.000000 0.000000 6 606.000000 607.000000 608.000000 609.000000 0.000000 7 706.000000 707.000000 708.000000 709.000000 710.000000 8 807.000000 808.000000 809.000000 810.000000 TEST26 For a general banded matrix, R8GB_COUNT_NONZEROS counts the nonzero entries. Matrix rows M = 10 Matrix columns N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 2 The R8GB matrix: Col: 1 2 3 4 5 Row --- 1 0.000000 0.829509 0.000000 0.000000 2 0.956318 0.561695 0.000000 0.633966 0.000000 3 0.415307 0.000000 0.000000 0.754673 4 0.000000 0.449539 0.797287 5 0.401306 0.000000 6 0.897504 Col: 6 7 8 9 10 Row --- 3 0.000000 4 0.350752 0.000000 5 0.000000 0.840847 0.000000 6 0.000000 0.000000 0.912484 0.000000 7 0.859097 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.351629 0.692066 0.453794 9 0.822887 0.561662 0.911977 10 0.861216 0.597917 Nonzero entries = 22 TEST265 R8GB_TO_R8GE copies a R8GB matrix to a R8GE matrix. R8GE_TO_R8GB copies a R8GE matrix to a R8GB matrix. Matrix rows M = 5 Matrix columns N = 8 Lower bandwidth ML = 2 Upper bandwidth MU = 1 The R8GB matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 3 0.000000 4 0.000000 0.000000 5 56.000000 0.000000 0.000000 The R8GE matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 0.000000 42.000000 43.000000 44.000000 45.000000 5 0.000000 0.000000 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 1 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 5 56.000000 0.000000 0.000000 The recovered R8GB matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 3 0.000000 4 0.000000 0.000000 5 56.000000 0.000000 0.000000 TEST2655 R8GB_TO_R8S3 copies a R8GB matrix to a R8S3 matrix. Matrix rows M = 5 Matrix columns N = 8 Lower bandwidth ML = 2 Upper bandwidth MU = 1 The R8GB matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 42.000000 43.000000 44.000000 45.000000 5 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 3 0.000000 4 0.000000 0.000000 5 56.000000 0.000000 0.000000 Nonzeros NZ_NUM = 17 The R8S3 matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 0.000000 2 21.000000 22.000000 23.000000 0.000000 0.000000 3 31.000000 32.000000 33.000000 34.000000 0.000000 4 0.000000 42.000000 43.000000 44.000000 45.000000 5 0.000000 0.000000 53.000000 54.000000 55.000000 Col: 6 7 8 Row --- 5 56.000000 0.000000 0.000000 TEST27 For a general banded matrix, R8GB_TRF computes the PLU factors. R8GB_TRS solves a factored linear system. Matrix rows M = 10 Matrix columns N = 10 Lower bandwidth ML = 1 Upper bandwidth MU = 2 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST275 For a general diagonal matrix: R8GD_INDICATOR sets up an indicator matrix. Matrix order N = 10 Number of diagonals NDIAG = 4 The offset vector: 1 -2 2 0 3 1 4 9 The general diagonal matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 0.000000 202.000000 203.000000 0.000000 0.000000 3 301.000000 0.000000 303.000000 304.000000 0.000000 4 0.000000 402.000000 0.000000 404.000000 405.000000 5 0.000000 0.000000 503.000000 0.000000 505.000000 6 0.000000 0.000000 0.000000 604.000000 0.000000 7 0.000000 0.000000 0.000000 0.000000 705.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 10 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.000000 110.000000 2 0.000000 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 0.000000 0.000000 5 506.000000 0.000000 0.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 0.000000 0.000000 7 0.000000 707.000000 708.000000 0.000000 0.000000 8 806.000000 0.000000 808.000000 809.000000 0.000000 9 0.000000 907.000000 0.000000 909.000000 910.000000 10 0.000000 0.000000 1008.000000 0.000000 1010.000000 TEST28 For a general diagonal matrix: R8GD_MXV computes A * x; R8GD_PRINT prints it; R8GD_RANDOM randomly generates one; R8GD_VXM computes A'*x; Matrix order N = 10 Number of diagonals NDIAG = 4 The offset vector: 1 -2 2 0 3 1 4 9 The raw matrix: Col: 1 2 3 4 Row --- 1 0.000000 0.218418 0.956318 0.829509 2 0.000000 0.561695 0.415307 0.000000 3 0.066119 0.257578 0.109957 0.000000 4 0.043829 0.633966 0.061727 0.000000 5 0.449539 0.401306 0.754673 0.000000 6 0.797287 0.001838 0.897504 0.000000 7 0.350752 0.094545 0.013617 0.000000 8 0.859097 0.840847 0.123104 0.000000 9 0.007512 0.260303 0.912484 0.000000 10 0.113664 0.351629 0.000000 0.000000 The general diagonal matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.000000 0.000000 0.000000 2 0.000000 0.561695 0.415307 0.000000 0.000000 3 0.066119 0.000000 0.257578 0.109957 0.000000 4 0.000000 0.043829 0.000000 0.633966 0.061727 5 0.000000 0.000000 0.449539 0.000000 0.401306 6 0.000000 0.000000 0.000000 0.797287 0.000000 7 0.000000 0.000000 0.000000 0.000000 0.350752 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 10 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.000000 0.829509 2 0.000000 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 0.000000 0.000000 5 0.754673 0.000000 0.000000 0.000000 0.000000 6 0.001838 0.897504 0.000000 0.000000 0.000000 7 0.000000 0.094545 0.013617 0.000000 0.000000 8 0.859097 0.000000 0.840847 0.123104 0.000000 9 0.000000 0.007512 0.000000 0.260303 0.912484 10 0.000000 0.000000 0.113664 0.000000 0.351629 A * x: 1 10.426146 2 2.369312 3 1.278679 4 2.932157 5 7.883189 6 9.482706 7 2.524510 8 12.989296 9 11.520151 10 4.425599 A' * x: 1 0.416775 2 2.255024 3 3.851042 4 7.649455 5 4.708707 6 10.657173 7 6.114449 8 7.958738 9 3.327558 10 12.558149 TEST285 For a matrix in general storage, R8GE_CO estimates the condition number. Matrix order N = 4 The L1 condition number is 10.000000 The R8GE_CO estimate is 198.622960 TEST29 For a matrix in general storage, R8GE_DET computes the determinant. Matrix order N = 4 R8GE_DET computes the determinant = 112.000000 Exact determinant = 112.000000 TEST295 For a matrix in general storage, R8GE_DILU returns the DILU factors. Matrix rows M = 9 Matrix columns N = 9 Matrix A: Col: 1 2 3 4 5 Row --- 1 4.000000 -1.000000 0.000000 -1.000000 0.000000 2 -1.000000 4.000000 -1.000000 0.000000 -1.000000 3 0.000000 -1.000000 4.000000 -1.000000 0.000000 4 -1.000000 0.000000 -1.000000 4.000000 -1.000000 5 0.000000 -1.000000 0.000000 -1.000000 4.000000 6 0.000000 0.000000 -1.000000 0.000000 -1.000000 7 0.000000 0.000000 0.000000 -1.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 -1.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 -1.000000 0.000000 0.000000 0.000000 4 0.000000 -1.000000 0.000000 0.000000 5 -1.000000 0.000000 -1.000000 0.000000 6 4.000000 -1.000000 0.000000 -1.000000 7 -1.000000 4.000000 -1.000000 0.000000 8 0.000000 -1.000000 4.000000 -1.000000 9 -1.000000 0.000000 -1.000000 4.000000 DILU factor: 1 0.250000 2 0.266667 3 0.267857 4 0.287179 5 0.290179 6 0.290532 7 0.292202 8 0.292601 9 0.292666 TEST30 For a matrix in general storage, R8GE_FA computes the LU factors, R8GE_SL solves a factored system. Matrix order N = 10 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution: 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 Solution of transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST31 For a matrix in general storage, R8GE_FA computes the LU factors, R8GE_SL solves a factored system. Matrix order N = 5 The matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.066119 0.061727 0.001838 0.859097 2 0.956318 0.257578 0.449539 0.897504 0.840847 3 0.829509 0.109957 0.401306 0.350752 0.123104 4 0.561695 0.043829 0.754673 0.094545 0.007512 5 0.415307 0.633966 0.797287 0.013617 0.260303 The compressed LU factors: Col: 1 2 3 4 5 Row --- 1 0.956318 0.257578 0.449539 0.897504 0.840847 2 -0.228395 0.522106 0.602062 -0.376149 -0.104858 3 -0.867399 0.217324 0.614552 -0.510026 -0.507943 4 -0.587352 0.205820 -0.231419 -0.391459 -0.511487 5 -0.434277 -0.013961 0.080304 -0.610161 0.939815 The pivot vector P: 1 2 2 5 3 4 4 4 5 5 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST315 For a matrix in general storage, R8GE_ILU returns the ILU factors. Matrix rows M = 9 Matrix columns N = 9 Matrix A: Col: 1 2 3 4 5 Row --- 1 4.000000 -1.000000 0.000000 -1.000000 0.000000 2 -1.000000 4.000000 -1.000000 0.000000 -1.000000 3 0.000000 -1.000000 4.000000 -1.000000 0.000000 4 -1.000000 0.000000 -1.000000 4.000000 -1.000000 5 0.000000 -1.000000 0.000000 -1.000000 4.000000 6 0.000000 0.000000 -1.000000 0.000000 -1.000000 7 0.000000 0.000000 0.000000 -1.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 -1.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 -1.000000 0.000000 0.000000 0.000000 4 0.000000 -1.000000 0.000000 0.000000 5 -1.000000 0.000000 -1.000000 0.000000 6 4.000000 -1.000000 0.000000 -1.000000 7 -1.000000 4.000000 -1.000000 0.000000 8 0.000000 -1.000000 4.000000 -1.000000 9 -1.000000 0.000000 -1.000000 4.000000 Factor L: Col: 1 2 3 4 5 Row --- 1 1.000000 0.000000 0.000000 0.000000 0.000000 2 -0.250000 1.000000 0.000000 0.000000 0.000000 3 0.000000 -0.266667 1.000000 0.000000 0.000000 4 -0.250000 0.000000 -0.267857 1.000000 0.000000 5 0.000000 -0.266667 0.000000 -0.287179 1.000000 6 0.000000 0.000000 -0.267857 0.000000 -0.290179 7 0.000000 0.000000 0.000000 -0.287179 0.000000 8 0.000000 0.000000 0.000000 0.000000 -0.290179 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 0.000000 6 1.000000 0.000000 0.000000 0.000000 7 -0.290532 1.000000 0.000000 0.000000 8 0.000000 -0.292202 1.000000 0.000000 9 -0.290532 0.000000 -0.292601 1.000000 Factor U: Col: 1 2 3 4 5 Row --- 1 4.000000 -1.000000 0.000000 -1.000000 0.000000 2 0.000000 3.750000 -1.000000 0.000000 -1.000000 3 0.000000 0.000000 3.733333 -1.000000 0.000000 4 0.000000 0.000000 0.000000 3.482143 -1.000000 5 0.000000 0.000000 0.000000 0.000000 3.446154 6 0.000000 0.000000 0.000000 0.000000 0.000000 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 -1.000000 0.000000 0.000000 0.000000 4 0.000000 -1.000000 0.000000 0.000000 5 -1.000000 0.000000 -1.000000 0.000000 6 3.441964 -1.000000 0.000000 -1.000000 7 0.000000 3.422289 -1.000000 0.000000 8 0.000000 0.000000 3.417619 -1.000000 9 0.000000 0.000000 0.000000 3.416867 Product L*U: Col: 1 2 3 4 5 Row --- 1 4.000000 -1.000000 0.000000 -1.000000 0.000000 2 -1.000000 4.000000 -1.000000 0.250000 -1.000000 3 0.000000 -1.000000 4.000000 -1.000000 0.266667 4 -1.000000 0.250000 -1.000000 4.000000 -1.000000 5 0.000000 -1.000000 0.266667 -1.000000 4.000000 6 0.000000 0.000000 -1.000000 0.267857 -1.000000 7 0.000000 0.000000 0.000000 -1.000000 0.287179 8 0.000000 0.000000 0.000000 0.000000 -1.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 -1.000000 0.000000 0.000000 0.000000 4 0.267857 -1.000000 0.000000 0.000000 5 -1.000000 0.287179 -1.000000 0.000000 6 4.000000 -1.000000 0.290179 -1.000000 7 -1.000000 4.000000 -1.000000 0.290532 8 0.290179 -1.000000 4.000000 -1.000000 9 -1.000000 0.290532 -1.000000 4.000000 TEST317 For a matrix in general storage, R8GE_INDICATOR sets up the indicator matrix. Matrix rows M = 7 Matrix columns N = 5 The R8GE indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 21.000000 22.000000 23.000000 24.000000 25.000000 3 31.000000 32.000000 33.000000 34.000000 35.000000 4 41.000000 42.000000 43.000000 44.000000 45.000000 5 51.000000 52.000000 53.000000 54.000000 55.000000 6 61.000000 62.000000 63.000000 64.000000 65.000000 7 71.000000 72.000000 73.000000 74.000000 75.000000 TEST32 For a matrix in general storage, R8GE_NP_FA computes the LU factors without pivoting, R8GE_NP_SL solves factored systems. Matrix order N = 10 Solution: 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution of transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST33 For a matrix in general storage, R8GE_NP_FA computes LU factors without pivoting, R8GE_NP_INVERSE computes the inverse. Matrix order N = 5 The random matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.066119 0.061727 0.001838 0.859097 2 0.956318 0.257578 0.449539 0.897504 0.840847 3 0.829509 0.109957 0.401306 0.350752 0.123104 4 0.561695 0.043829 0.754673 0.094545 0.007512 5 0.415307 0.633966 0.797287 0.013617 0.260303 The inverse matrix: Col: 1 2 3 4 5 Row --- 1 0.625209 -1.022202 2.849778 -0.868794 -0.084098 2 -0.471548 -0.149728 0.892032 -2.120695 1.679283 3 -0.274368 0.546937 -1.952646 2.057047 0.002856 4 -1.390293 1.758477 -1.706246 0.283212 -0.293107 5 1.064039 0.228349 -0.649235 0.235691 -0.107439 The product: Col: 1 2 3 4 5 Row --- 1 1.000000 -0.000000 0.000000 -0.000000 0.000000 2 0.000000 1.000000 -0.000000 -0.000000 -0.000000 3 0.000000 -0.000000 1.000000 -0.000000 0.000000 4 0.000000 -0.000000 -0.000000 1.000000 0.000000 5 0.000000 -0.000000 -0.000000 -0.000000 1.000000 TEST34 For a matrix in general storage, R8GE_FS factors and solves a linear system. Matrix order N = 10 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST35 For a matrix in general storage, R8GE_INVERSE computes the inverse matrix. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 5.000000 3.000000 3.000000 3.000000 2 3.000000 5.000000 3.000000 3.000000 3 3.000000 3.000000 5.000000 3.000000 4 3.000000 3.000000 3.000000 5.000000 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.000000 -0.000000 -0.000000 -0.000000 2 0.000000 1.000000 -0.000000 -0.000000 3 0.000000 -0.000000 1.000000 0.000000 4 0.000000 -0.000000 -0.000000 1.000000 TEST36 For a matrix in general storage, 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 32.659651 32.659651 2 30.761657 30.761657 3 20.172970 20.172970 4 24.112617 24.112617 5 30.759727 30.759727 6 32.734219 32.734219 7 28.025246 28.025246 8 28.309083 28.309083 9 28.750123 28.750123 10 17.314086 17.314086 A'*x and (PLU)'*x 1 29.518040 29.518040 2 34.253309 34.253309 3 29.981306 29.981306 4 25.981850 25.981850 5 28.713293 28.713293 6 28.372974 28.372974 7 33.487236 33.487236 8 26.612402 26.612402 9 24.841412 24.841412 10 26.538970 26.538970 TEST37 For a matrix in general storage, R8GE_NP_ML computes A*x or A'*X where A has been factored by R8GE_NP_FA. Matrix order N = 10 A*x and PLU*x 1 32.659651 32.659651 2 30.761657 30.761657 3 20.172970 20.172970 4 24.112617 24.112617 5 30.759727 30.759727 6 32.734219 32.734219 7 28.025246 28.025246 8 28.309083 28.309083 9 28.750123 28.750123 10 17.314086 17.314086 A'*x and (PLU)'*x 1 29.518040 29.518040 2 34.253309 34.253309 3 29.981306 29.981306 4 25.981850 25.981850 5 28.713293 28.713293 6 28.372974 28.372974 7 33.487236 33.487236 8 26.612402 26.612402 9 24.841412 24.841412 10 26.538970 26.538970 TEST38 For a matrix in general storage, 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 0.535837 0.535837 2 2.820090 2.820090 3 2.253342 2.253342 4 2.913374 2.913374 5 4.075099 4.075099 A'*x and (PLU)'*x 1 3.295367 3.295367 2 4.241668 4.241668 3 6.821908 6.821908 Matrix is 3 by 5 A*x and PLU*x 1 5.993799 5.993799 2 8.775200 8.775200 3 5.780772 5.780772 A'*x and (PLU)'*x 1 1.847872 1.847872 2 2.659908 2.659908 3 3.221329 3.221329 4 4.060772 4.060772 5 3.507907 3.507907 TEST385 For a matrix in general storage, R8GE_PLU returns the PLU factors of a matrix. Matrix rows M = 5 Matrix columns N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 0.218418 0.066119 0.061727 0.001838 2 0.956318 0.257578 0.449539 0.897504 3 0.829509 0.109957 0.401306 0.350752 4 0.561695 0.043829 0.754673 0.094545 5 0.415307 0.633966 0.797287 0.013617 Factor P: Col: 1 2 3 4 5 Row --- 1 0.000000 0.000000 0.000000 0.000000 1.000000 2 1.000000 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 1.000000 0.000000 4 0.000000 0.000000 1.000000 0.000000 0.000000 5 0.000000 1.000000 0.000000 0.000000 0.000000 Factor L: Col: 1 2 3 4 5 Row --- 1 1.000000 0.000000 0.000000 0.000000 0.000000 2 0.434277 1.000000 0.000000 0.000000 0.000000 3 0.587352 -0.205820 1.000000 0.000000 0.000000 4 0.867399 -0.217324 0.231419 1.000000 0.000000 5 0.228395 0.013961 -0.080304 0.610161 1.000000 Factor U: Col: 1 2 3 4 Row --- 1 0.956318 0.257578 0.449539 0.897504 2 0.000000 0.522106 0.602062 -0.376149 3 0.000000 0.000000 0.614552 -0.510026 4 0.000000 0.000000 0.000000 -0.391459 5 0.000000 0.000000 0.000000 0.000000 Product P*L*U: Col: 1 2 3 4 Row --- 1 0.218418 0.066119 0.061727 0.001838 2 0.956318 0.257578 0.449539 0.897504 3 0.829509 0.109957 0.401306 0.350752 4 0.561695 0.043829 0.754673 0.094545 5 0.415307 0.633966 0.797287 0.013617 TEST39 For a matrix in general storage, R8GE_POLY computes the characteristic polynomial. Matrix order N = 12 I, P(I), True P(I) 1 1.000000 1.000000 2 -23.000000 -23.000000 3 231.000000 231.000000 4 -1330.000000 -1330.000000 5 4845.000000 4845.000000 6 -11628.000000 -11628.000000 7 18564.000000 18564.000000 8 -19448.000000 -19448.000000 ...... .............. .............. 13 1.000000 1.000000 TEST40 For a matrix in general storage, 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 0.000000 2 0.142857 -0.000000 3 0.125000 0.000000 4 0.111111 0.000000 5 0.100000 0.000000 6 0.090909 0.000000 Iterative refinement step 1 I, DX: 1 0.000000 2 0.000000 3 0.000000 4 0.000000 5 0.000000 6 0.000000 i, x, b-A*x 1 0.166667 0.000000 2 0.142857 -0.000000 3 0.125000 -0.000000 4 0.111111 -0.000000 5 0.100000 0.000000 6 0.090909 -0.000000 Iterative refinement step 2 I, DX: 1 -0.000000 2 -0.000000 3 -0.000000 4 -0.000000 5 -0.000000 6 -0.000000 i, x, b-A*x 1 0.166667 -0.000000 2 0.142857 -0.000000 3 0.125000 0.000000 4 0.111111 -0.000000 5 0.100000 0.000000 6 0.090909 -0.000000 Iterative refinement step 3 I, DX: 1 0.000000 2 0.000000 3 0.000000 4 0.000000 5 0.000000 6 0.000000 i, x, b-A*x 1 0.166667 -0.000000 2 0.142857 0.000000 3 0.125000 -0.000000 4 0.111111 0.000000 5 0.100000 -0.000000 6 0.090909 0.000000 Iterative refinement step 4 I, DX: 1 -0.000000 2 -0.000000 3 -0.000000 4 -0.000000 5 -0.000000 6 -0.000000 i, x, b-A*x 1 0.166667 -0.000000 2 0.142857 0.000000 3 0.125000 -0.000000 4 0.111111 0.000000 5 0.100000 -0.000000 6 0.090909 0.000000 Iterative refinement step 5 I, DX: 1 -0.000000 2 -0.000000 3 -0.000000 4 -0.000000 5 -0.000000 6 -0.000000 i, x, b-A*x 1 0.166667 -0.000000 2 0.142857 0.000000 3 0.125000 -0.000000 4 0.111111 0.000000 5 0.100000 -0.000000 6 0.090909 0.000000 TEST41 For a matrix in general storage, R8GE_TRF computes the LU factors, R8GE_TRS solves a factored system. Number of matrix rows M = 5 Number of matrix columns N = 5 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST42 For a matrix in general storage, R8GE_NP_TRF factors without pivoting, R8GE_NP_TRS solves factored systems. R8GE_NP_TRM computes A*X for factored A. Matrix rows M = 10 Matrix columns N = 10 Solution: 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution of transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST422 For a matrix in the R8CC format, (double precision Harwell-Boeing Unsymmetric Assembled) R8CC_GET gets an entry; R8CC_IJK gets K from (I,J) R8CC_INC increments an entry; R8CC_KIJ gets (I,J) from K; R8CC_SET sets an entry; Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: 1 1 2 4 3 6 4 8 5 10 6 13 The ROWIND vector: 1 1 2 2 3 4 4 1 5 2 6 3 7 5 8 4 9 5 10 1 11 2 12 5 The initial R8CC matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.561695 0.000000 0.000000 0.633966 2 0.956318 0.415307 0.000000 0.000000 0.061727 3 0.000000 0.000000 0.066119 0.000000 0.000000 4 0.829509 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.000000 0.257578 0.043829 0.449539 R8CC_IJK locates some (I,J) entries. I J K 3 4 -1 4 1 3 5 2 -1 1 1 1 5 5 12 1 1 1 2 5 11 1 2 4 5 2 -1 4 3 -1 5 3 7 5 3 7 1 4 -1 2 1 2 3 2 -1 4 2 -1 2 4 -1 1 2 4 5 5 12 1 4 -1 R8CC_KIJ locates some K entries. K I J 2 2 1 10 1 5 9 5 4 4 1 2 11 2 5 10 1 5 10 1 5 5 2 2 12 5 5 7 5 3 1 1 1 7 5 3 1 1 1 5 2 2 4 1 2 11 2 5 1 1 1 1 1 1 2 2 1 2 2 1 R8CC_SET sets 10 entries at random. I J K NEW_VALUE 2 2 5 101.000000 2 1 2 102.000000 4 1 3 103.000000 4 1 3 104.000000 4 4 8 105.000000 1 5 10 106.000000 4 4 8 107.000000 4 1 3 108.000000 1 5 10 109.000000 5 4 9 110.000000 R8CC_INC increments 10 entries at random. I J K NEW_VALUE 3 3 6 21.066119 2 5 11 22.061727 5 5 12 23.449539 2 5 11 46.061727 5 3 7 25.257578 1 1 1 26.218418 3 3 6 48.066119 1 2 4 28.561695 2 5 11 75.061727 5 4 9 140.000000 R8CC_GET retrieves 10 entries. I J K VALUE 2 2 5 101.000000 2 1 2 102.000000 1 5 10 109.000000 5 5 12 23.449539 5 4 9 140.000000 3 3 6 48.066119 4 4 8 107.000000 2 2 5 101.000000 5 3 7 25.257578 1 5 10 109.000000 The final R8CC matrix: Col: 1 2 3 4 5 Row --- 1 26.218418 28.561695 0.000000 0.000000 109.000000 2 102.000000 101.000000 0.000000 0.000000 75.061727 3 0.000000 0.000000 48.066119 0.000000 0.000000 4 108.000000 0.000000 0.000000 107.000000 0.000000 5 0.000000 0.000000 25.257578 140.000000 23.449539 TEST423 R8CC_INDICATOR sets up the indicator matrix; Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The R8CC indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 15.000000 2 21.000000 22.000000 0.000000 0.000000 25.000000 3 0.000000 0.000000 33.000000 0.000000 0.000000 4 41.000000 0.000000 0.000000 44.000000 0.000000 5 0.000000 0.000000 53.000000 54.000000 55.000000 TEST425 R8CC_MXV multiplies a R8CC matrix by a vector; R8CC_VXM multiplies a vector by a R8CC matrix; Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The R8CC matrix, in R8GE form: Col: 1 2 3 4 5 Row --- 1 0.218418 0.561695 0.000000 0.000000 0.633966 2 0.956318 0.415307 0.000000 0.000000 0.061727 3 0.000000 0.000000 0.066119 0.000000 0.000000 4 0.829509 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.000000 0.257578 0.043829 0.449539 The vector x: 1 1.000000 2 0.000000 3 0.000000 4 0.000000 5 -1.000000 The product A * x: 1 -0.415547 2 0.894590 3 0.000000 4 0.829509 5 -0.449539 The product A' * x: 1 0.218418 2 0.561695 3 -0.257578 4 -0.043829 5 0.184427 TEST426 R8CC_PRINT prints a R8CC matrix. Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The R8CC matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.561695 0.000000 0.000000 0.633966 2 0.956318 0.415307 0.000000 0.000000 0.061727 3 0.000000 0.000000 0.066119 0.000000 0.000000 4 0.829509 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.000000 0.257578 0.043829 0.449539 TEST428 For a matrix in lower triangular storage, R8LT_INDICATOR sets up an indicator matrix; Matrix rows M = 6 Matrix columns N = 5 The R8LT indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 2 21.000000 22.000000 3 31.000000 32.000000 33.000000 4 41.000000 42.000000 43.000000 44.000000 5 51.000000 52.000000 53.000000 54.000000 55.000000 6 61.000000 62.000000 63.000000 64.000000 65.000000 TEST43 For a matrix in lower triangular storage, R8LT_SL solves systems; R8LT_MXV computes matrix-vector products; R8LT_VXM computes vector-matrix products; Matrix order N = 10 The lower triangular matrix: Col: 1 2 3 4 5 Row --- 1 1.000000 2 1.000000 2.000000 3 1.000000 2.000000 3.000000 4 1.000000 2.000000 3.000000 4.000000 5 1.000000 2.000000 3.000000 4.000000 5.000000 6 1.000000 2.000000 3.000000 4.000000 5.000000 7 1.000000 2.000000 3.000000 4.000000 5.000000 8 1.000000 2.000000 3.000000 4.000000 5.000000 9 1.000000 2.000000 3.000000 4.000000 5.000000 10 1.000000 2.000000 3.000000 4.000000 5.000000 Col: 6 7 8 9 10 Row --- 6 6.000000 7 6.000000 7.000000 8 6.000000 7.000000 8.000000 9 6.000000 7.000000 8.000000 9.000000 10 6.000000 7.000000 8.000000 9.000000 10.000000 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to the transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST44 For a matrix in lower triangular storage, R8LT_DET computes the determinant. R8LT_INVERSE computes the inverse. R8LT_MXM computes matrix products. R8LT_RANDOM sets a random value. Matrix order N = 5 Matrix A: Col: 1 2 3 4 5 Row --- 1 0.218418 2 0.956318 0.829509 3 0.561695 0.415307 0.066119 4 0.257578 0.109957 0.043829 0.633966 5 0.061727 0.449539 0.401306 0.754673 0.797287 Determinant is 0.006055 Inverse matrix B: Col: 1 2 3 4 5 Row --- 1 4.578371 2 -5.278274 1.205532 3 -5.740366 -7.572226 15.124306 4 -0.547837 0.314412 -1.045614 1.577372 5 6.029526 2.834073 -6.622938 -1.493065 1.254254 Product A * B: Col: 1 2 3 4 5 Row --- 1 1.000000 2 -0.000000 1.000000 3 -0.000000 -0.000000 1.000000 4 0.000000 0.000000 0.000000 1.000000 5 -0.000000 0.000000 0.000000 -0.000000 1.000000 TEST445 R8PBL_INDICATOR sets up a R8PBL indicator matrix. Matrix order N = 9 Bandwidth MU = 3 The R8PBL indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 21.000000 31.000000 41.000000 2 21.000000 22.000000 32.000000 42.000000 52.000000 3 31.000000 32.000000 33.000000 43.000000 53.000000 4 41.000000 42.000000 43.000000 44.000000 54.000000 5 52.000000 53.000000 54.000000 55.000000 6 63.000000 64.000000 65.000000 7 74.000000 75.000000 8 85.000000 Col: 6 7 8 9 Row --- 3 63.000000 4 64.000000 74.000000 5 65.000000 75.000000 85.000000 6 66.000000 76.000000 86.000000 96.000000 7 76.000000 77.000000 87.000000 97.000000 8 86.000000 87.000000 88.000000 98.000000 9 96.000000 97.000000 98.000000 99.000000 TEST45 R8PBU_CG applies the conjugate gradient method to a symmetric positive definite banded linear system. Matrix order N = 50 Upper bandwidth MU = 1 The symmetric banded matrix: Col: 1 2 3 4 5 Row --- 1 2.000000 -1.000000 2 -1.000000 2.000000 -1.000000 3 -1.000000 2.000000 -1.000000 4 -1.000000 2.000000 -1.000000 5 -1.000000 2.000000 6 -1.000000 Col: 6 7 8 9 10 Row --- 5 -1.000000 6 2.000000 -1.000000 7 -1.000000 2.000000 -1.000000 8 -1.000000 2.000000 -1.000000 9 -1.000000 2.000000 -1.000000 10 -1.000000 2.000000 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Maximum residual = 0.000000 TEST46 R8PBU_DET, determinant of a positive definite symmetric banded matrix. Matrix order N = 10 Upper bandwidth MU = 3 The R8PBU matrix: Col: 1 2 3 4 5 Row --- 1 2.538559 0.218418 0.956318 0.829509 2 0.218418 2.431799 0.561695 0.415307 0.066119 3 0.956318 0.561695 2.159814 0.257578 0.109957 4 0.829509 0.415307 0.257578 3.592123 0.633966 5 0.066119 0.109957 0.633966 5.055428 6 0.043829 0.061727 0.401306 7 0.449539 0.754673 8 0.797287 Col: 6 7 8 9 10 Row --- 3 0.043829 4 0.061727 0.449539 5 0.401306 0.754673 0.797287 6 2.238969 0.001838 0.897504 0.350752 7 0.001838 3.694305 0.094545 0.013617 0.859097 8 0.897504 0.094545 4.315322 0.840847 0.123104 9 0.350752 0.013617 0.840847 2.275763 0.007512 10 0.859097 0.123104 0.007512 1.453377 The R8PBU factored matrix: Col: 1 2 3 4 5 Row --- 1 1.593286 0.137087 0.600217 0.520628 2 0.137087 1.553385 0.308625 0.221411 0.042564 3 0.600217 0.308625 1.305490 -0.094405 0.074164 4 0.520628 0.221411 -0.094405 1.806415 0.349611 5 0.042564 0.074164 0.349611 2.219434 6 0.033573 0.035926 0.174034 7 0.248857 0.300829 8 0.359230 Col: 6 7 8 9 10 Row --- 3 0.033573 4 0.035926 0.248857 5 0.174034 0.300829 0.359230 6 1.485349 -0.040029 0.562148 0.236141 7 -0.040029 1.881562 0.004773 0.012261 0.456587 8 0.562148 0.004773 1.967293 0.359907 0.061468 9 0.236141 0.012261 0.359907 1.445793 -0.013977 10 0.456587 0.061468 -0.013977 1.113971 R8PBU_DET computes the determinant = 13158.441270 R8GE_DET computes the determinant = 13158.441270 TEST47 For a banded positive definite symmetric matrix, R8PBU_FA computes the LU factors. R8PBU_RANDOM sets a random value. R8PBU_SL solves a linear system. Matrix order N = 50 Upper bandwidth MU = 1 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST48 R8PBU_ML computes A*x where A has been factored by R8PBU_FA. Matrix order N = 10 Upper bandwidth MU = 3 A*x and PLU*x 1 9.162385 9.162385 2 8.758924 8.758924 3 10.402220 10.402220 4 23.488315 23.488315 5 42.343958 42.343958 6 26.168411 26.168411 7 40.912564 40.912564 8 53.354513 53.354513 9 29.483599 29.483599 10 21.599888 21.599888 TEST485 R8PBU_INDICATOR sets up a R8PBU indicator matrix. Matrix order N = 9 Bandwidth MU = 3 The R8PBU indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 2 12.000000 22.000000 23.000000 24.000000 25.000000 3 13.000000 23.000000 33.000000 34.000000 35.000000 4 14.000000 24.000000 34.000000 44.000000 45.000000 5 25.000000 35.000000 45.000000 55.000000 6 36.000000 46.000000 56.000000 7 47.000000 57.000000 8 58.000000 Col: 6 7 8 9 Row --- 3 36.000000 4 46.000000 47.000000 5 56.000000 57.000000 58.000000 6 66.000000 67.000000 68.000000 69.000000 7 67.000000 77.000000 78.000000 79.000000 8 68.000000 78.000000 88.000000 89.000000 9 69.000000 79.000000 89.000000 99.000000 TEST49 R8PBU_SOR, SOR routine for iterative solution of A*x=b. Matrix order N = 50 Upper bandwidth MU = 1 SOR iteration. Relaxation factor OMEGA = 0.250000 Iterations taken = 5081 Solution: 1 0.001623 2 0.067310 3 0.132722 4 0.197589 5 0.261647 6 0.324632 7 0.386286 8 0.446356 9 0.504596 10 0.560767 Maximum error = 0.000100 SOR iteration. Relaxation factor OMEGA = 0.750000 Iterations taken = 1693 Solution: 1 0.001623 2 0.067309 3 0.132721 4 0.197588 5 0.261645 6 0.324630 7 0.386284 8 0.446354 9 0.504594 10 0.560764 Maximum error = 0.000100 SOR iteration. Relaxation factor OMEGA = 1.000000 Iterations taken = 1269 Solution: 1 0.001624 2 0.067312 3 0.132725 4 0.197593 5 0.261652 6 0.324638 7 0.386293 8 0.446365 9 0.504605 10 0.560777 Maximum error = 0.000100 TEST50 R8PO_FA factors a positive definite symmetric linear system, R8PO_SL solves a factored system. Matrix order N = 10 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution: 1 1.000000 2 1.000000 3 1.000000 4 1.000000 5 1.000000 6 1.000000 7 1.000000 8 1.000000 9 1.000000 10 1.000000 TEST505 R8PO_FA factors a positive definite symmetric linear system, Matrix order N = 5 The matrix A: Col: 1 2 3 4 5 Row --- 1 1.000000 1.000000 1.000000 1.000000 1.000000 2 1.000000 2.000000 2.000000 2.000000 2.000000 3 1.000000 2.000000 3.000000 3.000000 3.000000 4 1.000000 2.000000 3.000000 4.000000 4.000000 5 1.000000 2.000000 3.000000 4.000000 5.000000 The factor R (a R8UT matrix): Col: 1 2 3 4 5 Row --- 1 1.000000 1.000000 1.000000 1.000000 1.000000 2 1.000000 1.000000 1.000000 1.000000 3 1.000000 1.000000 1.000000 4 1.000000 1.000000 5 1.000000 The product R' * R: Col: 1 2 3 4 5 Row --- 1 1.000000 1.000000 1.000000 1.000000 1.000000 2 1.000000 2.000000 2.000000 2.000000 2.000000 3 1.000000 2.000000 3.000000 3.000000 3.000000 4 1.000000 2.000000 3.000000 4.000000 4.000000 5 1.000000 2.000000 3.000000 4.000000 5.000000 TEST51 For a symmetric positive definite matrix factored by R8PO_FA, R8PO_DET computes the determinant; R8PO_INVERSE computes the inverse. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row --- 1 1.000000 1.000000 1.000000 1.000000 2 1.000000 2.000000 2.000000 2.000000 3 1.000000 2.000000 3.000000 3.000000 4 1.000000 2.000000 3.000000 4.000000 Matrix determinant = 1.000000 Inverse matrix B: Col: 1 2 3 4 Row --- 1 2.000000 -1.000000 0.000000 -0.000000 2 -1.000000 2.000000 -1.000000 -0.000000 3 0.000000 -1.000000 2.000000 -1.000000 4 -0.000000 -0.000000 -1.000000 1.000000 Product A * B: Col: 1 2 3 4 Row --- 1 1.000000 0.000000 0.000000 0.000000 2 0.000000 1.000000 0.000000 0.000000 3 0.000000 0.000000 1.000000 0.000000 4 0.000000 0.000000 0.000000 1.000000 TEST515 For a positive definite symmetric matrix, R8PO_FA computes the Cholesky factor. R8PO_SL solves a factored linear system. R8PO_MXV multiplies unfactored A * x R8PO_ML multiplies factored A * x Matrix order N = 5 The matrix A: Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 Right hand side, computed by R8PO_MXV 1 0.566030 2 5.201501 3 6.205960 4 16.255486 5 17.062599 Solution (should be 1,2,3...) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 Right hand side, computed by R8PO_ML 1 0.566030 2 5.201501 3 6.205960 4 16.255486 5 17.062599 Solution (should be 1,2,3...) 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST517 R8PO_INDICATOR sets up a R8PO indicator matrix. Matrix order N = 5 The R8PO indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 12.000000 22.000000 23.000000 24.000000 25.000000 3 13.000000 23.000000 33.000000 34.000000 35.000000 4 14.000000 24.000000 34.000000 44.000000 45.000000 5 15.000000 25.000000 35.000000 45.000000 55.000000 TEST52 R8PO_RANDOM computes a random positive definite symmetric matrix. R8PO_TO_R8GE converts a R8PO matrix to R8GE format. Matrix order N = 5 The random R8PO matrix: Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 The random R8PO matrix (printed by R8GE_PRINT): Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.000000 0.268432 0.208725 0.350545 0.521707 3 0.000000 0.000000 0.488639 0.540951 0.426804 4 0.000000 0.000000 0.000000 1.658476 1.450211 5 0.000000 0.000000 0.000000 0.000000 1.777743 The random R8GE matrix (printed by R8GE_PRINT): Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 TEST525 R8PP_FA factors a R8PP system, R8PP_SL solves a R8PP system. Matrix order N = 5 The R8PP matrix: Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 The desired solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 The right hand side: 1 0.566030 2 5.201501 3 6.205960 4 16.255486 5 17.062599 The R8PP matrix has been factored. Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST527 R8PP_INDICATOR sets up a R8PP indicator matrix. Matrix order N = 5 The R8PP indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 12.000000 22.000000 23.000000 24.000000 25.000000 3 13.000000 23.000000 33.000000 34.000000 35.000000 4 14.000000 24.000000 34.000000 44.000000 45.000000 5 15.000000 25.000000 35.000000 45.000000 55.000000 TEST53 R8PP_RANDOM, compute a random positive definite symmetric packed matrix. Matrix order N = 5 The matrix (printed by R8PP_PRINT): Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 The random R8PP matrix (printed by R8GE_PRINT): Col: 1 2 3 4 5 Row --- 1 0.003810 0.027749 0.024772 0.046584 0.049214 2 0.027749 0.268432 0.208725 0.350545 0.521707 3 0.024772 0.208725 0.488639 0.540951 0.426804 4 0.046584 0.350545 0.540951 1.658476 1.450211 5 0.049214 0.521707 0.426804 1.450211 1.777743 TEST534 For a R8S3 system, R8S3_WRITE writes the matrix to a file. Matrix order N = 100 Matrix nonzeros NZ_NUM = 298 Initial 10x10 block of R8S3 matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 201.000000 202.000000 203.000000 0.000000 0.000000 3 0.000000 302.000000 303.000000 304.000000 0.000000 4 0.000000 0.000000 403.000000 404.000000 405.000000 5 0.000000 0.000000 0.000000 504.000000 505.000000 6 0.000000 0.000000 0.000000 0.000000 605.000000 Col: 6 7 8 9 10 Row --- 5 506.000000 0.000000 0.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 0.000000 0.000000 7 706.000000 707.000000 708.000000 0.000000 0.000000 8 0.000000 807.000000 808.000000 809.000000 0.000000 9 0.000000 0.000000 908.000000 909.000000 910.000000 10 0.000000 0.000000 0.000000 1009.000000 1010.000000 R8S3_WRITE wrote the matrix data to "r8s3_matrix.txt" . TEST535 For a R8S3 system, R8S3_READ_SIZE reads the size of the matrix. R8S3_READ reads the matrix. R8S3_READ_SIZE reports matrix size data: Matrix order N = 100 Matrix nonzeros NZ_NUM = 298 Initial 10x10 block of recovered R8S3 matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 201.000000 202.000000 203.000000 0.000000 0.000000 3 0.000000 302.000000 303.000000 304.000000 0.000000 4 0.000000 0.000000 403.000000 404.000000 405.000000 5 0.000000 0.000000 0.000000 504.000000 505.000000 6 0.000000 0.000000 0.000000 0.000000 605.000000 Col: 6 7 8 9 10 Row --- 5 506.000000 0.000000 0.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 0.000000 0.000000 7 706.000000 707.000000 708.000000 0.000000 0.000000 8 0.000000 807.000000 808.000000 809.000000 0.000000 9 0.000000 0.000000 908.000000 909.000000 910.000000 10 0.000000 0.000000 0.000000 1009.000000 1010.000000 Deleting the matrix data file "r8s3_matrix.txt" TEST54 R8SD_CG applies the conjugate gradient method to a symmetric positive definite linear system stored by diagonals. Matrix order N = 100 Number of diagonals is 3 First 10 rows and columns of matrix: Col: 1 2 3 4 5 Row --- 1 4.000000 -1.000000 0.000000 0.000000 0.000000 2 -1.000000 4.000000 -1.000000 0.000000 0.000000 3 0.000000 -1.000000 4.000000 -1.000000 0.000000 4 0.000000 0.000000 -1.000000 4.000000 -1.000000 5 0.000000 0.000000 0.000000 -1.000000 4.000000 6 0.000000 0.000000 0.000000 0.000000 -1.000000 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 10 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 0.000000 0.000000 5 -1.000000 0.000000 0.000000 0.000000 0.000000 6 4.000000 -1.000000 0.000000 0.000000 0.000000 7 -1.000000 4.000000 -1.000000 0.000000 0.000000 8 0.000000 -1.000000 4.000000 -1.000000 0.000000 9 0.000000 0.000000 -1.000000 4.000000 -1.000000 10 0.000000 0.000000 0.000000 -1.000000 4.000000 Right hand side: 1 11.000000 2 20.000000 3 30.000000 4 40.000000 5 50.000000 6 60.000000 7 70.000000 8 80.000000 9 90.000000 10 211.000000 Solution: 1 11.000000 2 21.000000 3 31.000000 4 41.000000 5 51.000000 6 61.000000 7 71.000000 8 81.000000 9 91.000000 10 101.000000 Maximum residual = 0.000000 Second attempt at solution: 1 11.000000 2 21.000000 3 31.000000 4 41.000000 5 51.000000 6 61.000000 7 71.000000 8 81.000000 9 91.000000 10 101.000000 Maximum residual of second attempt = 0.000000 TEST55 R8SD_CG is used for linear equation solving in a demonstration of inverse iteration to compute eigenvalues and eigenvectors of a symmetric matrix stored by diagonals. Matrix order N = 100 Here are 25 of the smallest eigenvalues: I, J, eigenvalue(I,J): 1 1 0.162028 1 2 0.398507 1 3 0.771293 1 4 1.250184 1 5 1.796384 2 1 0.398507 2 2 0.634986 2 3 1.007771 2 4 1.486663 2 5 2.032863 3 1 0.771293 3 2 1.007771 3 3 1.380557 3 4 1.859449 3 5 2.405649 4 1 1.250184 4 2 1.486663 4 3 1.859449 4 4 2.338340 4 5 2.884540 5 1 1.796384 5 2 2.032863 5 3 2.405649 5 4 2.884540 5 5 3.430741 Lambda estimate = 0.000000 Converged on step 2 TEST555 R8SD_INDICATOR sets up a R8SD indicator matrix. Matrix order N = 10 Matrix diagonals NDIAG = 3 The R8SD indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 104.000000 0.000000 2 102.000000 202.000000 203.000000 0.000000 205.000000 3 0.000000 203.000000 303.000000 304.000000 0.000000 4 104.000000 0.000000 304.000000 404.000000 405.000000 5 0.000000 205.000000 0.000000 405.000000 505.000000 6 0.000000 0.000000 306.000000 0.000000 506.000000 7 0.000000 0.000000 0.000000 407.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 508.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 10 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 10 Row --- 1 0.000000 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 0.000000 3 306.000000 0.000000 0.000000 0.000000 0.000000 4 0.000000 407.000000 0.000000 0.000000 0.000000 5 506.000000 0.000000 508.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 609.000000 0.000000 7 607.000000 707.000000 708.000000 0.000000 710.000000 8 0.000000 708.000000 808.000000 809.000000 0.000000 9 609.000000 0.000000 809.000000 909.000000 910.000000 10 0.000000 710.000000 0.000000 910.000000 1010.000000 TEST56 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.048738 2 0.900681 -0.003405 -0.045284 0.097928 0.209060 3 0.190252 0.091259 0.356081 -0.281754 0.024822 4 0.482296 -0.005680 0.283504 0.224374 0.478787 5 -0.284400 -0.144488 -0.498077 0.595864 0.130874 6 -0.604187 -0.167760 -0.554103 -0.189652 -0.245859 7 -0.020036 0.518989 0.623970 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.155440 0.286048 7 0.193524 0.819502 A*x and PLU*x 1 6.233203 6.233203 2 5.643112 5.643112 3 4.011776 4.011776 4 11.687357 11.687357 5 0.185197 0.185197 6 -1.654945 -1.654945 7 13.802584 13.802584 The Sherman Morrison matrix: Col: 1 2 3 4 5 Row --- 1 0.372211 0.044650 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.039753 4 -0.460832 -0.492993 0.751566 -0.048742 0.068133 5 0.554236 -0.047725 0.716446 0.448273 0.646527 6 -0.803782 -0.483181 0.429272 0.202573 -0.129083 7 -0.627499 0.073878 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.034844 0.651523 6 0.222917 0.143123 7 0.392929 0.434966 A'*x and (PLU)'*x 1 -7.614159 -7.614159 2 -4.000930 -4.000930 3 17.655986 17.655986 4 13.306426 13.306426 5 2.107553 2.107553 6 7.988618 7.988618 7 7.871876 7.871876 TEST57 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.026933 2 0.877654 0.193737 0.351650 0.845924 0.737188 3 0.586159 -0.087540 0.098478 0.191185 -0.197573 4 -0.007797 -0.418356 0.045990 -0.278876 -0.742942 5 0.230434 0.483928 0.567228 -0.107606 0.016685 The right hand side vector B: 1 4.221684 2 0.424679 3 3.294717 4 0.199627 5 -1.979756 Solution to A' * X = B: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 The Sherman-Morrison matrix A: Col: 1 2 3 4 5 Row --- 1 0.251659 0.319285 -0.091513 0.034604 0.292301 2 -0.018372 0.214294 -0.364887 0.694459 0.889569 3 0.754919 0.612363 0.284029 0.087766 0.763226 4 0.212156 0.225367 0.394769 0.763444 0.752990 5 0.169856 0.201542 0.788678 0.744086 0.406239 The right hand side vector B: 1 2.215609 2 6.541239 3 6.998926 4 8.665925 5 7.946512 Solution to A * X = B: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 TEST5705 R8SP_IJ_TO_K returns the R8SP index of (I,J). Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 10 I J K 1 1 -1 1 2 1 1 3 -1 1 4 -1 1 5 2 2 1 3 2 2 -1 2 3 -1 2 4 -1 2 5 4 3 1 -1 3 2 -1 3 3 -1 3 4 -1 3 5 -1 4 1 5 4 2 6 4 3 7 4 4 -1 4 5 -1 5 1 -1 5 2 -1 5 3 -1 5 4 8 5 5 -1 6 1 -1 6 2 -1 6 3 -1 6 4 9 6 5 -1 7 1 10 7 2 -1 7 3 -1 7 4 -1 7 5 -1 TEST571 R8SP_INDICATOR sets up a R8SP indicator matrix; Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 10 The R8SP indicator matrix: Col: 1 2 3 4 5 Row --- 1 0.000000 12.000000 0.000000 0.000000 15.000000 2 21.000000 0.000000 0.000000 0.000000 25.000000 4 41.000000 42.000000 43.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 54.000000 0.000000 6 0.000000 0.000000 0.000000 64.000000 0.000000 7 71.000000 0.000000 0.000000 0.000000 0.000000 TEST572 R8SP_MXV multiplies a R8SP matrix by a vector; R8SP_VXM multiplies a vector by a R8SP matrix; Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 10 The R8SP matrix, in R8GE form: Col: 1 2 3 4 5 Row --- 1 0.000000 0.218418 0.000000 0.000000 0.956318 2 0.829509 0.000000 0.000000 0.000000 0.561695 3 0.000000 0.000000 0.000000 0.000000 0.000000 4 0.415307 0.066119 0.257578 0.000000 0.000000 5 0.000000 0.000000 0.000000 0.109957 0.000000 6 0.000000 0.000000 0.000000 0.043829 0.000000 7 0.633966 0.000000 0.000000 0.000000 0.000000 The vector x: 1 1.000000 2 0.000000 3 0.000000 4 0.000000 5 -1.000000 The product A * x: 1 -0.956318 2 0.267814 3 0.000000 4 0.415307 5 0.000000 6 0.000000 7 0.633966 The vector x: 1 1.000000 2 0.000000 3 0.000000 4 0.000000 5 0.000000 6 0.000000 7 -1.000000 The product A' * x: 1 -0.633966 2 0.218418 3 0.000000 4 0.000000 5 0.956318 TEST5724 For a R8SP system, R8SP_WRITE writes the matrix to a file. Matrix rows M = 100 Matrix columns N = 100 Matrix nonzeros NZ_NUM = 298 Initial 10x10 block of R8SP matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 201.000000 202.000000 203.000000 0.000000 0.000000 3 0.000000 302.000000 303.000000 304.000000 0.000000 4 0.000000 0.000000 403.000000 404.000000 405.000000 5 0.000000 0.000000 0.000000 504.000000 505.000000 6 0.000000 0.000000 0.000000 0.000000 605.000000 Col: 6 7 8 9 10 Row --- 5 506.000000 0.000000 0.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 0.000000 0.000000 7 706.000000 707.000000 708.000000 0.000000 0.000000 8 0.000000 807.000000 808.000000 809.000000 0.000000 9 0.000000 0.000000 908.000000 909.000000 910.000000 10 0.000000 0.000000 0.000000 1009.000000 1010.000000 R8SP_WRITE wrote the matrix data to "r8sp_matrix.txt" . TEST535 For a R8SP system, R8SP_READ_SIZE reads the size of the matrix. R8SP_READ reads the matrix. R8SP_READ_SIZE reports matrix size data: Matrix rows M = 100 Matrix columns N = 100 Matrix nonzeros NZ_NUM = 298 Initial 10x10 block of recovered R8SP matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 0.000000 0.000000 0.000000 2 201.000000 202.000000 203.000000 0.000000 0.000000 3 0.000000 302.000000 303.000000 304.000000 0.000000 4 0.000000 0.000000 403.000000 404.000000 405.000000 5 0.000000 0.000000 0.000000 504.000000 505.000000 6 0.000000 0.000000 0.000000 0.000000 605.000000 Col: 6 7 8 9 10 Row --- 5 506.000000 0.000000 0.000000 0.000000 0.000000 6 606.000000 607.000000 0.000000 0.000000 0.000000 7 706.000000 707.000000 708.000000 0.000000 0.000000 8 0.000000 807.000000 808.000000 809.000000 0.000000 9 0.000000 0.000000 908.000000 909.000000 910.000000 10 0.000000 0.000000 0.000000 1009.000000 1010.000000 Deleting the matrix data file "r8sp_matrix.txt" TEST573 R8SR_INDICATOR sets up a R8SR indicator matrix; Matrix order N = 5 The R8SR indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 0.000000 0.000000 15.000000 2 0.000000 22.000000 0.000000 0.000000 25.000000 3 31.000000 0.000000 33.000000 0.000000 0.000000 4 41.000000 0.000000 0.000000 44.000000 0.000000 5 0.000000 52.000000 53.000000 0.000000 55.000000 TEST574 R8SR_MXV multiplies a R8SR matrix by a vector; R8SR_VXM multiplies a vector by a R8SR matrix; Matrix order N = 5 The R8SR matrix, in R8GE form: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.000000 0.000000 0.829509 2 0.000000 0.561695 0.000000 0.000000 0.415307 3 0.257578 0.000000 0.066119 0.000000 0.000000 4 0.043829 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.061727 0.449539 0.000000 0.633966 The vector x: 1 1.000000 2 0.000000 3 0.000000 4 0.000000 5 -1.000000 The product A * x: 1 -0.611091 2 -0.415307 3 0.257578 4 0.043829 5 -0.633966 The product A' * x: 1 0.218418 2 0.894590 3 -0.449539 4 0.000000 5 0.195544 TEST5745 R8SR_PRINT prints a R8SR matrix. Matrix order N = 5 The R8SR matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.000000 0.000000 0.829509 2 0.000000 0.561695 0.000000 0.000000 0.415307 3 0.257578 0.000000 0.066119 0.000000 0.000000 4 0.043829 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.061727 0.449539 0.000000 0.633966 TEST575 R8SR_RANDOM randomizes a R8SR matrix Matrix order N = 5 The R8SR matrix, in R8GE form: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.000000 0.000000 0.829509 2 0.000000 0.561695 0.000000 0.000000 0.415307 3 0.257578 0.000000 0.066119 0.000000 0.000000 4 0.043829 0.000000 0.000000 0.109957 0.000000 5 0.000000 0.061727 0.449539 0.000000 0.633966 TEST577 For a symmetric skyline storage matrix, R8SS_INDICATOR computes an indicator matrix. Matrix order N = 9 The R8SS indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 12.000000 22.000000 23.000000 24.000000 25.000000 3 13.000000 23.000000 33.000000 34.000000 35.000000 4 14.000000 24.000000 34.000000 44.000000 45.000000 5 15.000000 25.000000 35.000000 45.000000 55.000000 6 16.000000 26.000000 36.000000 46.000000 56.000000 7 17.000000 27.000000 37.000000 47.000000 57.000000 8 18.000000 28.000000 38.000000 48.000000 58.000000 9 19.000000 29.000000 39.000000 49.000000 59.000000 Col: 6 7 8 9 Row --- 1 16.000000 17.000000 18.000000 19.000000 2 26.000000 27.000000 28.000000 29.000000 3 36.000000 37.000000 38.000000 39.000000 4 46.000000 47.000000 48.000000 49.000000 5 56.000000 57.000000 58.000000 59.000000 6 66.000000 67.000000 68.000000 69.000000 7 67.000000 77.000000 78.000000 79.000000 8 68.000000 78.000000 88.000000 89.000000 9 69.000000 79.000000 89.000000 99.000000 TEST58 For a symmetric skyline storage matrix, R8SS_MXV computes A*x, R8SS_PRINT prints it. Matrix order N = 9 Number of nonzero entries stored is 20 Diagonal storage indices: 1 1 2 2 3 5 4 9 5 12 6 15 7 16 8 19 9 20 The R8SS matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 0.000000 13.000000 14.000000 0.000000 2 0.000000 22.000000 23.000000 24.000000 0.000000 3 13.000000 23.000000 33.000000 34.000000 35.000000 4 14.000000 24.000000 34.000000 44.000000 45.000000 5 0.000000 0.000000 35.000000 45.000000 55.000000 6 0.000000 0.000000 0.000000 46.000000 56.000000 7 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 9 0.000000 0.000000 0.000000 0.000000 0.000000 Col: 6 7 8 9 Row --- 1 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 0.000000 3 0.000000 0.000000 0.000000 0.000000 4 46.000000 0.000000 0.000000 0.000000 5 56.000000 0.000000 0.000000 0.000000 6 66.000000 0.000000 68.000000 0.000000 7 0.000000 77.000000 78.000000 0.000000 8 68.000000 78.000000 88.000000 0.000000 9 0.000000 0.000000 0.000000 99.000000 R8SS_MXV verse R8GE_MXV 1 106.000000 106.000000 2 209.000000 209.000000 3 469.000000 469.000000 4 841.000000 841.000000 5 896.000000 896.000000 6 1404.000000 1404.000000 7 1163.000000 1163.000000 8 1658.000000 1658.000000 9 891.000000 891.000000 TEST581 R8STO_INDICATOR sets up a R8STO indicator matrix. Matrix order N = 4 The R8STO indicator matrix: Col: 1 2 3 4 Row --- 1 11.000000 12.000000 13.000000 14.000000 2 12.000000 11.000000 12.000000 13.000000 3 13.000000 12.000000 11.000000 12.000000 4 14.000000 13.000000 12.000000 11.000000 TEST583 R8STO_INVERSE computes the inverse of a positive definite symmetric Toeplitz matrix. Matrix order N = 5 The symmetric Toeplitz matrix A: Col: 1 2 3 4 5 Row --- 1 4.000000 2.000000 0.800000 0.400000 0.100000 2 2.000000 4.000000 2.000000 0.800000 0.400000 3 0.800000 2.000000 4.000000 2.000000 0.800000 4 0.400000 0.800000 2.000000 4.000000 2.000000 5 0.100000 0.400000 0.800000 2.000000 4.000000 The inverse matrix B: Col: 1 2 3 4 5 Row --- 1 0.335767 -0.180346 0.029910 -0.019056 0.013186 2 -0.180346 0.432116 -0.195663 0.038971 -0.019056 3 0.029910 -0.195663 0.433699 -0.195663 0.029910 4 -0.019056 0.038971 -0.195663 0.432116 -0.180346 5 0.013186 -0.019056 0.029910 -0.180346 0.335767 Maximum discrepancy in A * B - I is 3.596142e-16 TEST585 R8STO_YW_SL solves the Yule-Walker equations for a symmetric Toeplitz system. Matrix order N = 5 The symmetric Toeplitz matrix A: Col: 1 2 3 4 5 Row --- 1 1.000000 0.500000 0.200000 0.100000 0.050000 2 0.500000 1.000000 0.500000 0.200000 0.100000 3 0.200000 0.500000 1.000000 0.500000 0.200000 4 0.100000 0.200000 0.500000 1.000000 0.500000 5 0.050000 0.100000 0.200000 0.500000 1.000000 The right hand side, B: 1 -0.500000 2 -0.200000 3 -0.100000 4 -0.050000 5 -0.020000 The computed solution, X: 1 -0.535896 2 0.086048 3 -0.038439 4 0.003548 5 0.004104 The residual A*X - B: 1 0.000000 2 0.000000 3 0.000000 4 -0.000000 5 -0.000000 TEST587 R8STO_SL solves a positive definite symmetric Toeplitz system. Matrix order N = 5 The symmetric Toeplitz matrix A: Col: 1 2 3 4 5 Row --- 1 1.000000 0.500000 0.200000 0.100000 0.050000 2 0.500000 1.000000 0.500000 0.200000 0.100000 3 0.200000 0.500000 1.000000 0.500000 0.200000 4 0.100000 0.200000 0.500000 1.000000 0.500000 5 0.050000 0.100000 0.200000 0.500000 1.000000 The right hand side vector B: 1 -0.716227 2 -0.156477 3 0.831471 4 0.584415 5 0.918985 The solution X: 1 -0.775228 2 -0.368536 3 1.131358 4 -0.285598 5 0.911127 Norm of residual error A * X - B = 3.521788e-16 TEST589 R8TO_INDICATOR sets up a R8TO indicator matrix. Matrix order N = 10 The R8TO indicator matrix: Col: 1 2 3 4 5 Row --- 1 101.000000 102.000000 103.000000 104.000000 105.000000 2 201.000000 101.000000 102.000000 103.000000 104.000000 3 301.000000 201.000000 101.000000 102.000000 103.000000 4 401.000000 301.000000 201.000000 101.000000 102.000000 5 501.000000 401.000000 301.000000 201.000000 101.000000 6 601.000000 501.000000 401.000000 301.000000 201.000000 7 701.000000 601.000000 501.000000 401.000000 301.000000 8 801.000000 701.000000 601.000000 501.000000 401.000000 9 901.000000 801.000000 701.000000 601.000000 501.000000 10 1001.000000 901.000000 801.000000 701.000000 601.000000 Col: 6 7 8 9 10 Row --- 1 106.000000 107.000000 108.000000 109.000000 110.000000 2 105.000000 106.000000 107.000000 108.000000 109.000000 3 104.000000 105.000000 106.000000 107.000000 108.000000 4 103.000000 104.000000 105.000000 106.000000 107.000000 5 102.000000 103.000000 104.000000 105.000000 106.000000 6 101.000000 102.000000 103.000000 104.000000 105.000000 7 201.000000 101.000000 102.000000 103.000000 104.000000 8 301.000000 201.000000 101.000000 102.000000 103.000000 9 401.000000 301.000000 201.000000 101.000000 102.000000 10 501.000000 401.000000 301.000000 201.000000 101.000000 TEST59 R8TO_SL solves a Toeplitz system. Matrix order N = 10 The Toeplitz matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.829509 0.561695 0.415307 2 0.061727 0.218418 0.956318 0.829509 0.561695 3 0.449539 0.061727 0.218418 0.956318 0.829509 4 0.401306 0.449539 0.061727 0.218418 0.956318 5 0.754673 0.401306 0.449539 0.061727 0.218418 6 0.797287 0.754673 0.401306 0.449539 0.061727 7 0.001838 0.797287 0.754673 0.401306 0.449539 8 0.897504 0.001838 0.797287 0.754673 0.401306 9 0.350752 0.897504 0.001838 0.797287 0.754673 10 0.094545 0.350752 0.897504 0.001838 0.797287 Col: 6 7 8 9 10 Row --- 1 0.066119 0.257578 0.109957 0.043829 0.633966 2 0.415307 0.066119 0.257578 0.109957 0.043829 3 0.561695 0.415307 0.066119 0.257578 0.109957 4 0.829509 0.561695 0.415307 0.066119 0.257578 5 0.956318 0.829509 0.561695 0.415307 0.066119 6 0.218418 0.956318 0.829509 0.561695 0.415307 7 0.061727 0.218418 0.956318 0.829509 0.561695 8 0.449539 0.061727 0.218418 0.956318 0.829509 9 0.401306 0.449539 0.061727 0.218418 0.956318 10 0.754673 0.401306 0.449539 0.061727 0.218418 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST60 For an upper triangular matrix, R8UT_DET computes the determinant. R8UT_INVERSE computes the inverse. R8UT_MXM computes matrix products. Matrix order N = 5 The matrix A: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.829509 0.561695 0.415307 2 0.066119 0.257578 0.109957 0.043829 3 0.633966 0.061727 0.449539 4 0.401306 0.754673 5 0.797287 Determinant is 0.002929 The inverse matrix B: Col: 1 2 3 4 5 Row --- 1 4.578371 -66.219910 20.914344 8.518916 -18.600442 2 15.124306 -6.144947 -3.198828 5.661174 3 1.577372 -0.242625 -0.659722 4 2.491862 -2.358677 5 1.254254 The product A * B: Col: 1 2 3 4 5 Row --- 1 1.000000 -0.000000 0.000000 0.000000 -0.000000 2 1.000000 0.000000 0.000000 0.000000 3 1.000000 0.000000 0.000000 4 1.000000 0.000000 5 1.000000 TEST605 For an upper triangular matrix, R8UT_INDICATOR sets up an indicator matrix. Matrix rows M = 8 Matrix columns N = 5 The R8UT indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.000000 12.000000 13.000000 14.000000 15.000000 2 22.000000 23.000000 24.000000 25.000000 3 33.000000 34.000000 35.000000 4 44.000000 45.000000 5 55.000000 TEST61 For an upper triangular matrix, R8UT_SL solves systems; R8UT_MXV computes matrix-vector products. R8UT_VXM computes vector-matrix products. Matrix order N = 10 The upper triangular matrix: Col: 1 2 3 4 5 Row --- 1 1.000000 2.000000 3.000000 4.000000 5.000000 2 2.000000 3.000000 4.000000 5.000000 3 3.000000 4.000000 5.000000 4 4.000000 5.000000 5 5.000000 Col: 6 7 8 9 10 Row --- 1 6.000000 7.000000 8.000000 9.000000 10.000000 2 6.000000 7.000000 8.000000 9.000000 10.000000 3 6.000000 7.000000 8.000000 9.000000 10.000000 4 6.000000 7.000000 8.000000 9.000000 10.000000 5 6.000000 7.000000 8.000000 9.000000 10.000000 6 6.000000 7.000000 8.000000 9.000000 10.000000 7 7.000000 8.000000 9.000000 10.000000 8 8.000000 9.000000 10.000000 9 9.000000 10.000000 10 10.000000 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 6 6.000000 7 7.000000 8 8.000000 9 9.000000 10 10.000000 TEST62 R8VM_DET, determinant of a Vandermonde matrix. Matrix order N = 10 The Vandermonde matrix: Col: 1 2 3 4 5 Row --- 1 1.000000 1.000000 1.000000 1.000000 1.000000 2 0.218418 0.956318 0.829509 0.561695 0.415307 3 0.047707 0.914543 0.688086 0.315502 0.172480 4 0.010420 0.874594 0.570773 0.177216 0.071632 5 0.002276 0.836389 0.473462 0.099541 0.029749 6 0.000497 0.799854 0.392741 0.055912 0.012355 7 0.000109 0.764914 0.325782 0.031405 0.005131 8 0.000024 0.731501 0.270239 0.017640 0.002131 9 0.000005 0.699547 0.224166 0.009908 0.000885 10 0.000001 0.668989 0.185948 0.005566 0.000368 Col: 6 7 8 9 10 Row --- 1 1.000000 1.000000 1.000000 1.000000 1.000000 2 0.066119 0.257578 0.109957 0.043829 0.633966 3 0.004372 0.066346 0.012090 0.001921 0.401913 4 0.000289 0.017089 0.001329 0.000084 0.254799 5 0.000019 0.004402 0.000146 0.000004 0.161534 6 0.000001 0.001134 0.000016 0.000000 0.102407 7 0.000000 0.000292 0.000002 0.000000 0.064922 8 0.000000 0.000075 0.000000 0.000000 0.041159 9 0.000000 0.000019 0.000000 0.000000 0.026093 10 0.000000 0.000005 0.000000 0.000000 0.016542 R8VM_DET computes the determinant = -4.220628e-25 R8GE_DET computes the determinant = -4.220628e-25 TEST63 R8VM_SL solves a Vandermonde system. Matrix order N = 5 Solution: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 Solution to transposed system: 1 1.000000 2 2.000000 3 3.000000 4 4.000000 5 5.000000 LINPLUS_TEST Normal end of execution. 05-May-2009 09:43:15 >>