22 September 2015 8:23:35.536 AM R8SP_PRB FORTRAN90 version: Test the R8SP library. R8SP_CG_TEST R8SP_CG applies the conjugate gradient method to a linear system with R8SP matrix. Matrix rows M = 50 Matrix columns N = 50 Matrix nonzeros = 148 Rows 1:10, Cols 1:10: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 2.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 2.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 2.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 2.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 Col: 6 7 8 9 10 Row --- 5 -1.00000 0.00000 0.00000 0.00000 0.00000 6 2.00000 -1.00000 0.00000 0.00000 0.00000 7 -1.00000 2.00000 -1.00000 0.00000 0.00000 8 0.00000 -1.00000 2.00000 -1.00000 0.00000 9 0.00000 0.00000 -1.00000 2.00000 -1.00000 10 0.00000 0.00000 0.00000 -1.00000 2.00000 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 ...... .............. 50 50.000000 Maximum residual = 0.568434E-13 R8SP_DIAGONAL_TEST R8SP_DIAGONAL rearranges an R8SP matrix so that the diagonal is listed first. Matrix order M = 6 Matrix order N = 6 Matrix nonzeros NZ_NUM = 20 Before rearrangement: K ROW(K) COL(K) A(K) 1 1 5 15.0000 2 3 6 36.0000 3 4 2 42.0000 4 6 2 62.0000 5 5 3 53.0000 6 2 4 24.0000 7 6 4 64.0000 8 3 5 35.0000 9 1 1 11.0000 10 2 6 26.0000 11 4 4 44.0000 12 6 6 66.0000 13 5 5 55.0000 14 4 1 41.0000 15 4 6 46.0000 16 3 3 33.0000 17 6 1 61.0000 18 2 2 22.0000 19 3 1 31.0000 20 4 3 43.0000 After rearrangement: K ROW(K) COL(K) A(K) 1 1 1 11.0000 2 2 2 22.0000 3 3 3 33.0000 4 4 4 44.0000 5 5 5 55.0000 6 6 6 66.0000 7 6 4 64.0000 8 3 5 35.0000 9 1 5 15.0000 10 2 6 26.0000 11 6 2 62.0000 12 2 4 24.0000 13 5 3 53.0000 14 4 1 41.0000 15 4 6 46.0000 16 4 2 42.0000 17 6 1 61.0000 18 3 6 36.0000 19 3 1 31.0000 20 4 3 43.0000 R8SP_DIF2_TEST R8SP_DIF2 sets up the second difference as an R8SP matrix; Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 14 The R8SP matrix: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 2.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 2.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 2.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 2.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 R8SP_IJ_TO_K_TEST 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 R8SP_INDICATOR_TEST 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.00000 12.0000 0.00000 0.00000 15.0000 2 21.0000 0.00000 0.00000 0.00000 25.0000 4 41.0000 42.0000 43.0000 0.00000 0.00000 5 0.00000 0.00000 0.00000 54.0000 0.00000 6 0.00000 0.00000 0.00000 64.0000 0.00000 7 71.0000 0.00000 0.00000 0.00000 0.00000 R8SP_JAC_SL_TEST R8SP_JAC_SL uses Jacobi iteration to solve a linear system with an R8SP matrix. Matrix order M = 10 Matrix order N = 10 Matrix nonzeros NZ_NUM = 28 Iterations per call = 25 Current solution estimate: 1 0.315171 2 0.727797 3 1.14042 4 1.82758 5 2.51474 6 3.59047 7 4.66620 8 6.12820 9 7.59020 10 9.29510 Current solution estimate: 1 0.757545 2 1.51509 3 2.34936 4 3.18363 5 4.14729 6 5.11094 7 6.21581 8 7.32068 9 8.53366 10 9.74665 Current solution estimate: 1 0.910021 2 1.83432 3 2.75863 4 3.72124 5 4.68386 6 5.69666 7 6.70946 8 7.76839 9 8.82731 10 9.91366 R8SP_MTV_TEST R8SP_MTV computes b=A'*x, where A is an 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.00000 0.218418 0.00000 0.00000 0.956318 2 0.829509 0.00000 0.00000 0.00000 0.561695 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.415307 0.661187E-01 0.257578 0.00000 0.00000 5 0.00000 0.00000 0.00000 0.109957 0.00000 6 0.00000 0.00000 0.00000 0.438290E-01 0.00000 7 0.633966 0.00000 0.00000 0.00000 0.00000 The vector x: 1 1.00000 2 0.00000 3 0.00000 4 0.00000 5 0.00000 6 0.00000 7 -1.00000 The product A' * x: 1 -0.633966 2 0.218418 3 0.00000 4 0.00000 5 0.956318 R8SP_MV_TEST R8SP_MV multiplies an R8SP matrix by a vector; 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.00000 0.218418 0.00000 0.00000 0.956318 2 0.829509 0.00000 0.00000 0.00000 0.561695 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.415307 0.661187E-01 0.257578 0.00000 0.00000 5 0.00000 0.00000 0.00000 0.109957 0.00000 6 0.00000 0.00000 0.00000 0.438290E-01 0.00000 7 0.633966 0.00000 0.00000 0.00000 0.00000 The vector x: 1 1.00000 2 0.00000 3 0.00000 4 0.00000 5 -1.00000 The product A * x: 1 -0.956318 2 0.267814 3 0.00000 4 0.415307 5 0.00000 6 0.00000 7 0.633966 R8SP_PRINT_TEST R8SP_PRINT prints a R8SP matrix; In this example, we have listed several matrix locations TWICE. R8SP_PRINT should compute the sum of these values. In particular, we want A(1,2) = 112 and A(3,4) = 234. Matrix rows M = 5 Matrix columns N = 7 Matrix nonzeros = 12 The R8SP matrix: Col: 1 2 3 4 5 Row --- 1 0.00000 112.000 0.00000 14.0000 0.00000 2 21.0000 0.00000 0.00000 24.0000 0.00000 3 0.00000 0.00000 0.00000 234.000 0.00000 4 0.00000 0.00000 0.00000 0.00000 45.0000 5 51.0000 52.0000 0.00000 0.00000 0.00000 Col: 6 7 Row --- 1 0.00000 17.0000 4 46.0000 0.00000 R8SP_RANDOM_TEST R8SP_RANDOM randomizes a R8SP indicator matrix; Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 10 The R8SP matrix: Col: 1 2 3 4 5 Row --- 1 0.00000 0.218418 0.00000 0.00000 0.956318 2 0.829509 0.00000 0.00000 0.00000 0.561695 4 0.415307 0.661187E-01 0.257578 0.00000 0.00000 5 0.00000 0.00000 0.00000 0.109957 0.00000 6 0.00000 0.00000 0.00000 0.438290E-01 0.00000 7 0.633966 0.00000 0.00000 0.00000 0.00000 R8SP_READ_TEST R8SP_READ_SIZE reads the size of an R8SP matrix. R8SP_READ reads an R8SP matrix from a file. 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.000 102.000 0.00000 0.00000 0.00000 2 201.000 202.000 203.000 0.00000 0.00000 3 0.00000 302.000 303.000 304.000 0.00000 4 0.00000 0.00000 403.000 404.000 405.000 5 0.00000 0.00000 0.00000 504.000 505.000 6 0.00000 0.00000 0.00000 0.00000 605.000 Col: 6 7 8 9 10 Row --- 5 506.000 0.00000 0.00000 0.00000 0.00000 6 606.000 607.000 0.00000 0.00000 0.00000 7 706.000 707.000 708.000 0.00000 0.00000 8 0.00000 807.000 808.000 809.000 0.00000 9 0.00000 0.00000 908.000 909.000 910.000 10 0.00000 0.00000 0.00000 1009.00 1010.00 R8SP_RES_TEST R8SP_RES computes r=b-A*x, where A is an R8S3 matrix. Matrix order M = 5 Matrix order N = 4 Matrix nonzeros NZ_NUM = 11 x: 1 1.00000 2 2.00000 3 3.00000 4 4.00000 r=b-A*x: 1 0.00000 2 0.00000 3 0.00000 4 0.00000 5 0.00000 R8SP_TO_R8GE_TEST R8SP_TO_R8GE converts an R8SP matrix to R8GE format. Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 14 The R8SP matrix: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 2.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 2.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 2.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 2.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 The R8GE matrix: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 2.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 2.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 2.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 2.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 7 0.00000 0.00000 0.00000 0.00000 0.00000 R8SP_TO_R8NCF_TEST R8SP_TO_R8NCF converts an R8SP matrix to R8NCF format. Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 14 The R8SP matrix: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 2.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 2.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 2.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 2.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 The R8NCF matrix: Col: 1 2 3 4 5 Row --- 1 2.00000 -1.00000 0. 0. 0. 2 -1.00000 2.00000 -1.00000 0. 0. 3 0. -1.00000 2.00000 -1.00000 0. 4 0. 0. -1.00000 2.00000 -1.00000 5 0. 0. 0. -1.00000 2.00000 6 0. 0. 0. 0. -1.00000 R8SP_WRITE_TEST R8SP_WRITE writes an R8SP matrix to a file. Matrix rows M = 100 Matrix columns N = 100 Matrix nonzeros NZ_NUM = 298 Initial 10x10 block of R8S3 matrix: Col: 1 2 3 4 5 Row --- 1 101.000 102.000 0.00000 0.00000 0.00000 2 201.000 202.000 203.000 0.00000 0.00000 3 0.00000 302.000 303.000 304.000 0.00000 4 0.00000 0.00000 403.000 404.000 405.000 5 0.00000 0.00000 0.00000 504.000 505.000 6 0.00000 0.00000 0.00000 0.00000 605.000 Col: 6 7 8 9 10 Row --- 5 506.000 0.00000 0.00000 0.00000 0.00000 6 606.000 607.000 0.00000 0.00000 0.00000 7 706.000 707.000 708.000 0.00000 0.00000 8 0.00000 807.000 808.000 809.000 0.00000 9 0.00000 0.00000 908.000 909.000 910.000 10 0.00000 0.00000 0.00000 1009.00 1010.00 R8SP_WRITE wrote the matrix data to "r8sp_matrix.txt". R8SP_ZEROS_TEST R8SP_ZEROS zeros up a R8SP indicator matrix; Matrix rows M = 7 Matrix columns N = 5 Matrix nonzeros = 10 The R8SP zero matrix: Col: 1 2 3 4 5 Row --- R8SP_PRB Normal end of execution. 22 September 2015 8:23:35.554 AM