17 July 2016 3:21:13.010 PM R8SD_PRB FORTRAN90 version: Test the R8SD library. R8SD_CG_TEST 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.00000 -1.00000 0.00000 0.00000 0.00000 2 -1.00000 4.00000 -1.00000 0.00000 0.00000 3 0.00000 -1.00000 4.00000 -1.00000 0.00000 4 0.00000 0.00000 -1.00000 4.00000 -1.00000 5 0.00000 0.00000 0.00000 -1.00000 4.00000 6 0.00000 0.00000 0.00000 0.00000 -1.00000 7 0.00000 0.00000 0.00000 0.00000 0.00000 8 0.00000 0.00000 0.00000 0.00000 0.00000 9 0.00000 0.00000 0.00000 0.00000 0.00000 10 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 6 7 8 9 10 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.00000 0.00000 0.00000 0.00000 0.00000 5 -1.00000 0.00000 0.00000 0.00000 0.00000 6 4.00000 -1.00000 0.00000 0.00000 0.00000 7 -1.00000 4.00000 -1.00000 0.00000 0.00000 8 0.00000 -1.00000 4.00000 -1.00000 0.00000 9 0.00000 0.00000 -1.00000 4.00000 -1.00000 10 0.00000 0.00000 0.00000 -1.00000 4.00000 Right hand side: 1: 11.0000 2: 20.0000 3: 30.0000 4: 40.0000 5: 50.0000 6: 60.0000 7: 70.0000 8: 80.0000 ........ .............. 100: 231.000 Solution: 1: 11.0000 2: 21.0000 3: 31.0000 4: 41.0000 5: 51.0000 6: 61.0000 7: 71.0000 8: 81.0000 ........ .............. 100: 110.000 Maximum residual = 0.284217E-12 Second attempt at solution: 1: 11.0000 2: 21.0000 3: 31.0000 4: 41.0000 5: 51.0000 6: 61.0000 7: 71.0000 8: 81.0000 ........ .............. 100: 110.000 Maximum residual of second attempt = 0.568434E-13 R8SD_CG_TEST2 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.25018 1 5 1.79638 2 1 0.398507 2 2 0.634986 2 3 1.00777 2 4 1.48666 2 5 2.03286 3 1 0.771293 3 2 1.00777 3 3 1.38056 3 4 1.85945 3 5 2.40565 4 1 1.25018 4 2 1.48666 4 3 1.85945 4 4 2.33834 4 5 2.88454 5 1 1.79638 5 2 2.03286 5 3 2.40565 5 4 2.88454 5 5 3.43074 Lambda estimate = 0.162028 Converged on step 7 Lambda estimate = 0.771293 Converged on step 11 Lambda estimate = 0.398507 Converged on step 31 R8SD_DIF2_TEST R8SD_DIF2 sets up an R8SD second difference matrix. Matrix order N = 5 Matrix diagonals NDIAG = 2 The R8SD second difference 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 R8SD_INDICATOR_TEST R8SD_INDICATOR sets up an R8SD indicator matrix. Matrix order N = 5 Matrix diagonals NDIAG = 3 The R8SD indicator matrix: Col: 1 2 3 4 5 Row --- 1 11.0000 12.0000 0.00000 14.0000 0.00000 2 12.0000 22.0000 23.0000 0.00000 25.0000 3 0.00000 23.0000 33.0000 34.0000 0.00000 4 14.0000 0.00000 34.0000 44.0000 45.0000 5 0.00000 25.0000 0.00000 45.0000 55.0000 R8SD_MV_TEST R8SD_MV computes b=A*x, where A is an R8SD matrix. Matrix order N = 10 Matrix diagonals NDIAG = 3 The R8SD matrix: Col: 1 2 3 4 5 Row --- 1 101.000 102.000 0.00000 104.000 0.00000 2 102.000 202.000 203.000 0.00000 205.000 3 0.00000 203.000 303.000 304.000 0.00000 4 104.000 0.00000 304.000 404.000 405.000 5 0.00000 205.000 0.00000 405.000 505.000 6 0.00000 0.00000 306.000 0.00000 506.000 7 0.00000 0.00000 0.00000 407.000 0.00000 8 0.00000 0.00000 0.00000 0.00000 508.000 9 0.00000 0.00000 0.00000 0.00000 0.00000 10 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 6 7 8 9 10 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 306.000 0.00000 0.00000 0.00000 0.00000 4 0.00000 407.000 0.00000 0.00000 0.00000 5 506.000 0.00000 508.000 0.00000 0.00000 6 606.000 607.000 0.00000 609.000 0.00000 7 607.000 707.000 708.000 0.00000 710.000 8 0.00000 708.000 808.000 809.000 0.00000 9 609.000 0.00000 809.000 909.000 910.000 10 0.00000 710.000 0.00000 910.000 1010.00 The vector x: 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 6.00000 7 7.00000 8 8.00000 9 9.00000 10 10.0000 The product b=A*x 1 721.000 2 2140.00 3 4367.00 4 7506.00 5 11655.0 6 16814.0 7 22983.0 8 21241.0 9 27407.0 10 23260.0 R8SD_PRINT_TEST R8SD_PRINT prints an R8SD matrix. Matrix order N = 10 Matrix diagonals NDIAG = 3 The R8SD matrix: Col: 1 2 3 4 5 Row --- 1 101.000 102.000 0.00000 104.000 0.00000 2 102.000 202.000 203.000 0.00000 205.000 3 0.00000 203.000 303.000 304.000 0.00000 4 104.000 0.00000 304.000 404.000 405.000 5 0.00000 205.000 0.00000 405.000 505.000 6 0.00000 0.00000 306.000 0.00000 506.000 7 0.00000 0.00000 0.00000 407.000 0.00000 8 0.00000 0.00000 0.00000 0.00000 508.000 9 0.00000 0.00000 0.00000 0.00000 0.00000 10 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 6 7 8 9 10 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 306.000 0.00000 0.00000 0.00000 0.00000 4 0.00000 407.000 0.00000 0.00000 0.00000 5 506.000 0.00000 508.000 0.00000 0.00000 6 606.000 607.000 0.00000 609.000 0.00000 7 607.000 707.000 708.000 0.00000 710.000 8 0.00000 708.000 808.000 809.000 0.00000 9 609.000 0.00000 809.000 909.000 910.000 10 0.00000 710.000 0.00000 910.000 1010.00 R8SD_PRINT_SOME_TEST R8SD_PRINT_SOME prints some of an R8SD matrix. Matrix order N = 10 Matrix diagonals NDIAG = 3 Rows 2-8, Cols 3-7: Col: 3 4 5 6 7 Row --- 2 203.000 0.00000 205.000 0.00000 0.00000 3 303.000 304.000 0.00000 306.000 0.00000 4 304.000 404.000 405.000 0.00000 407.000 5 0.00000 405.000 505.000 506.000 0.00000 6 306.000 0.00000 506.000 606.000 607.000 7 0.00000 407.000 0.00000 607.000 707.000 8 0.00000 0.00000 508.000 0.00000 708.000 R8SD_RANDOM_TEST R8SD_RANDOM randomizes an R8SD matrix. Matrix order N = 15 Matrix diagonals NDIAG = 3 The random R8SD matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.00000 0.829509 0.00000 2 0.956318 0.561695 0.415307 0.00000 0.661187E-01 3 0.00000 0.415307 0.257578 0.109957 0.00000 4 0.829509 0.00000 0.109957 0.633966 0.617272E-01 5 0.00000 0.661187E-01 0.00000 0.617272E-01 0.401306 6 0.00000 0.00000 0.438290E-01 0.00000 0.754673 7 0.00000 0.00000 0.00000 0.449539 0.00000 8 0.00000 0.00000 0.00000 0.00000 0.797287 9 0.00000 0.00000 0.00000 0.00000 0.00000 10 0.00000 0.00000 0.00000 0.00000 0.00000 11 0.00000 0.00000 0.00000 0.00000 0.00000 12 0.00000 0.00000 0.00000 0.00000 0.00000 13 0.00000 0.00000 0.00000 0.00000 0.00000 14 0.00000 0.00000 0.00000 0.00000 0.00000 15 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 6 7 8 9 10 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 0.438290E-01 0.00000 0.00000 0.00000 0.00000 4 0.00000 0.449539 0.00000 0.00000 0.00000 5 0.754673 0.00000 0.797287 0.00000 0.00000 6 0.183837E-02 0.897504 0.00000 0.350752 0.00000 7 0.897504 0.945448E-01 0.136169E-01 0.00000 0.859097 8 0.00000 0.136169E-01 0.840847 0.123104 0.00000 9 0.350752 0.00000 0.123104 0.260303 0.912484 10 0.00000 0.859097 0.00000 0.912484 0.351629 11 0.00000 0.00000 0.751236E-02 0.00000 0.822887 12 0.00000 0.00000 0.00000 0.113664 0.00000 13 0.00000 0.00000 0.00000 0.00000 0.267132 14 0.00000 0.00000 0.00000 0.00000 0.00000 15 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 11 12 13 14 15 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.00000 0.00000 0.00000 0.00000 0.00000 5 0.00000 0.00000 0.00000 0.00000 0.00000 6 0.00000 0.00000 0.00000 0.00000 0.00000 7 0.00000 0.00000 0.00000 0.00000 0.00000 8 0.751236E-02 0.00000 0.00000 0.00000 0.00000 9 0.00000 0.113664 0.00000 0.00000 0.00000 10 0.822887 0.00000 0.267132 0.00000 0.00000 11 0.692066 0.561662 0.00000 0.861216 0.00000 12 0.561662 0.453794 0.911977 0.00000 0.597917 13 0.00000 0.911977 0.188955 0.761492 0.00000 14 0.861216 0.00000 0.761492 0.396988 0.185314 15 0.00000 0.597917 0.00000 0.185314 0.574366 R8SD_RES_TEST R8SD_RES computes a residual R=b-A*x Matrix order N = 10 Number of diagonals is 2 The R8SD matrix: Col: 1 2 3 4 5 Row --- 1 0.218418 0.956318 0.00000 0.00000 0.00000 2 0.956318 0.829509 0.561695 0.00000 0.00000 3 0.00000 0.561695 0.415307 0.661187E-01 0.00000 4 0.00000 0.00000 0.661187E-01 0.257578 0.109957 5 0.00000 0.00000 0.00000 0.109957 0.438290E-01 6 0.00000 0.00000 0.00000 0.00000 0.633966 7 0.00000 0.00000 0.00000 0.00000 0.00000 8 0.00000 0.00000 0.00000 0.00000 0.00000 9 0.00000 0.00000 0.00000 0.00000 0.00000 10 0.00000 0.00000 0.00000 0.00000 0.00000 Col: 6 7 8 9 10 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.00000 0.00000 0.00000 0.00000 0.00000 5 0.633966 0.00000 0.00000 0.00000 0.00000 6 0.617272E-01 0.449539 0.00000 0.00000 0.00000 7 0.449539 0.401306 0.754673 0.00000 0.00000 8 0.00000 0.754673 0.797287 0.183837E-02 0.00000 9 0.00000 0.00000 0.183837E-02 0.897504 0.350752 10 0.00000 0.00000 0.00000 0.350752 0.945448E-01 The vector x: 1 1.00000 2 2.00000 3 3.00000 4 4.00000 5 5.00000 6 6.00000 7 7.00000 8 8.00000 9 9.00000 10 10.0000 The product b=A*x 1 2.13105 2 4.30042 3 2.63379 4 1.77845 5 4.46277 6 6.68696 7 11.5438 8 11.6776 9 11.5998 10 4.10222 The defective vector X2: 1 1.00136 2 2.08591 3 3.08408 4 4.01231 5 5.00075 6 6.02603 7 7.09125 8 8.01137 9 9.03516 10 10.0823 Residual b-A*x2: 1 -0.824544E-01 2 -0.119795 3 -0.839900E-01 4 -0.881306E-02 5 -0.178889E-01 6 -0.431027E-01 7 -0.568981E-01 8 -0.779897E-01 9 -0.604427E-01 10 -0.201134E-01 R8SD_TO_R8GE_TEST R8SD_TO_R8GER converts an R8SD matrix to R8GE format. Matrix order N = 5 Matrix diagonals NDIAG = 3 The R8SD matrix: Col: 1 2 3 4 5 Row --- 1 11.0000 12.0000 0.00000 14.0000 0.00000 2 12.0000 22.0000 23.0000 0.00000 25.0000 3 0.00000 23.0000 33.0000 34.0000 0.00000 4 14.0000 0.00000 34.0000 44.0000 45.0000 5 0.00000 25.0000 0.00000 45.0000 55.0000 The R8GE matrix: Col: 1 2 3 4 5 Row --- 1 11.0000 12.0000 0.00000 14.0000 0.00000 2 12.0000 22.0000 23.0000 0.00000 25.0000 3 0.00000 23.0000 33.0000 34.0000 0.00000 4 14.0000 0.00000 34.0000 44.0000 45.0000 5 0.00000 25.0000 0.00000 45.0000 55.0000 R8SD_ZEROS_TEST R8SD_ZEROS zeros an R8SD matrix. Matrix order N = 5 Matrix diagonals NDIAG = 3 The R8SD zero matrix: Col: 1 2 3 4 5 Row --- 1 0.00000 0.00000 0.00000 0.00000 0.00000 2 0.00000 0.00000 0.00000 0.00000 0.00000 3 0.00000 0.00000 0.00000 0.00000 0.00000 4 0.00000 0.00000 0.00000 0.00000 0.00000 5 0.00000 0.00000 0.00000 0.00000 0.00000 R8SD_PRB Normal end of execution. 17 July 2016 3:21:13.039 PM