Wed Jun 22 10:53:25 2022 r8ccs_test(): Python version: 3.6.9 Test the r8ccs() library for real matrices in CCS format. r8ccs_dif2_test(): r8ccs_dif2() returns the second difference as a CCS matrix. The second difference matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 13 The COLPTR vector: [ 0 2 5 8 11 13] The ROWIND vector: [0 1 0 1 2 1 2 3 2 3 4 3 4] The second difference matrix in CCS format: Col: 0 1 2 3 4 Row --- 0 2 -1 0 0 0 1 -1 2 -1 0 0 2 0 -1 2 -1 0 3 0 0 -1 2 -1 4 0 0 0 -1 2 r8ccs_get_test(): r8ccs_get() gets an entry of a matrix in the CCS format. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 -0.127663 0.742867 0 0 -0.0246021 1 -2.38066 -0.579401 0 0 1.1895 2 0 0 1.02116 0 0 3 0.56885 0 0 0.182693 0 4 0 0 1.07627 -0.63516 0.65162 r8ccs_get() retrieves 10 entries. I J K VALUE 3 3 7 0.182693 3 3 7 0.182693 1 4 10 1.1895 1 1 4 -0.579401 4 3 8 -0.63516 3 3 7 0.182693 1 4 10 1.1895 3 3 7 0.182693 1 0 1 -2.38066 4 4 11 0.65162 r8ccs_ijk_test(): r8ccs_ijk() gets K from (I,J) for a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 0.573999 0.278877 0 0 0.680446 1 1.49649 -1.15432 0 0 0.256928 2 0 0 -1.11128 0 0 3 0.753398 0 0 -0.18313 0 4 0 0 0.404446 2.14442 0.891039 r8ccs_ijk() locates some (I,J) entries. I J K 0 4 9 3 4 -1 0 1 3 1 2 -1 1 3 -1 0 1 3 2 2 5 1 3 -1 0 4 9 0 3 -1 0 2 -1 4 4 11 0 1 3 0 4 9 1 0 1 2 3 -1 4 4 11 3 0 2 1 4 10 1 2 -1 r8ccs_inc_test(): r8ccs_inc() increments entries in a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 -0.263513 -1.39019 0 0 -0.147625 1 -0.595536 -1.3453 0 0 -0.642506 2 0 0 -0.416381 0 0 3 1.50656 0 0 -0.244509 0 4 0 0 0.170336 -0.033494 0.454301 r8ccs_inc() increments 10 entries at random. I J K NEW_VALUE 0 1 3 18.609814 3 3 7 20.755491 0 0 0 21.736487 2 2 5 22.583619 4 2 6 24.170336 0 1 3 43.609814 3 0 2 27.506556 2 2 5 49.583619 4 4 11 28.454301 1 4 10 28.357494 The final CCS matrix: Col: 0 1 2 3 4 Row --- 0 21.7365 43.6098 0 0 -0.147625 1 -0.595536 -1.3453 0 0 28.3575 2 0 0 49.5836 0 0 3 27.5066 0 0 20.7555 0 4 0 0 24.1703 -0.033494 28.4543 r8ccs_indicator_test(): r8ccs_indicator() sets up a CCS indicator matrix; An indicator matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] An indicator matrix in CCS format: Col: 0 1 2 3 4 Row --- 0 11 12 0 0 15 1 21 22 0 0 25 2 0 0 33 0 0 3 41 0 0 44 0 4 0 0 53 54 55 r8ccs_kij_test(): r8ccs_kij() gets (I,J) from K in a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 0.992025 -2.45993 0 0 -0.986704 1 -0.87066 1.14524 0 0 -0.125019 2 0 0 0.567446 0 0 3 -0.0299866 0 0 -0.725605 0 4 0 0 0.849338 -0.618009 -1.22735 r8ccs_kij() locates some K entries. K I J 9 0 4 0 0 0 5 2 2 10 1 4 5 2 2 2 3 0 1 1 0 8 4 3 6 4 2 11 4 4 1 1 0 11 4 4 8 4 3 2 3 0 0 0 0 6 4 2 1 1 0 5 2 2 10 1 4 1 1 0 r8ccs_mtv_test(): r8ccs_mtv() computes b=A'*x, where A is a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 -0.0583125 -0.773695 0 0 0.0915369 1 -0.320477 0.448495 0 0 0.141866 2 0 0 1.50035 0 0 3 -1.02356 0 0 -0.604365 0 4 0 0 -0.104611 -0.262467 0.922376 x: [ 1. 0. 0. 0. -1.] b=A'*x: [-0.05831254 -0.77369549 0.1046105 0.26246688 -0.83083916] r8ccs_mv_test(): r8ccs_mv() computes b=A*x, where A is a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 -0.798946 0.340219 0 0 -1.74325 1 -0.357459 -2.02119 0 0 -1.49392 2 0 0 -0.00443767 0 0 3 -1.66546 0 0 1.65235 0 4 0 0 0.368376 0.37863 -0.157983 x: [ 1. 0. 0. 0. -1.] b=A*x: [ 0.94430276 1.13645775 0. -1.66546109 0.15798311] r8ccs_print_test(): r8ccs_print() prints a CCS matrix. A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random CCS matrix: Col: 0 1 2 3 4 Row --- 0 -1.62947 -0.200098 0 0 -0.59783 1 -0.98669 1.78553 0 0 0.295782 2 0 0 -1.20335 0 0 3 0.88824 0 0 0.532345 0 4 0 0 -1.2076 -0.466097 -0.420625 r8ccs_print_some_test(): r8ccs_print_some() prints some of a CCS matrix. The indicator matrix in CCS format: Matrix rows M = 10 Matrix columns N = 10 Matrix nonzeros NZ_NUM = 28 The COLPTR vector: [ 0 2 5 8 11 14 17 20 23 26 28] The ROWIND vector: [ 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7 6 7 8 7 8 9 8 9 10 9 10] Rows 1-5, Cols 4-7: Col: 4 5 6 7 Row --- 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4 505 0 0 0 5 605 606 0 0 r8ccs_random_test(): r8ccs_random() randomizes a CCS matrix; A random matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] A random matrix in CCS format: Col: 0 1 2 3 4 Row --- 0 0.0615093 -1.64234 0 0 0.456979 1 -0.920289 -0.859986 0 0 -0.397746 2 0 0 -0.951363 0 0 3 0.317272 0 0 1.35125 0 4 0 0 -2.60175 -0.322108 0.423372 r8ccs_read_test(): r8ccs_read() reads a CCS matrix from a file. The CCS matrix read from the file: Matrix rows M = 4 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12 0 0 0 0 0 0] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] The CCS matrix read from the file: Col: 0 1 2 3 4 Row --- 0 11 12 0 0 15 1 21 22 0 0 25 2 0 0 33 0 0 3 41 0 0 44 0 r8ccs_set_test(): r8ccs_set() sets entries in a CCS matrix A random CCS matrix: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] The CCS matrix: Col: 0 1 2 3 4 Row --- 0 -0.775508 0.31905 0 0 -0.65956 1 -0.625676 -0.108968 0 0 0.211379 2 0 0 0.398262 0 0 3 0.459635 0 0 0.402369 0 4 0 0 0.89208 -0.435793 0.480537 r8ccs_set() sets 10 entries at random. I J K NEW_VALUE 3 0 2 100.000000 0 0 0 101.000000 0 0 0 102.000000 2 2 5 103.000000 0 1 3 104.000000 0 1 3 105.000000 1 4 10 106.000000 1 4 10 107.000000 0 4 9 108.000000 0 4 9 109.000000 The final CCS matrix: Col: 0 1 2 3 4 Row --- 0 102 105 0 0 109 1 -0.625676 -0.108968 0 0 107 2 0 0 103 0 0 3 100 0 0 0.402369 0 4 0 0 0.89208 -0.435793 0.480537 r8ccs_to_r8ge_test(): r8ccs_to_r8ge() converts a matrix from CCS to GE format; An indicator matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] An indicator matrix in CCS format: Col: 0 1 2 3 4 Row --- 0 11 12 0 0 15 1 21 22 0 0 25 2 0 0 33 0 0 3 41 0 0 44 0 4 0 0 53 54 55 The GE matrix: [[11. 12. 0. 0. 15.] [21. 22. 0. 0. 25.] [ 0. 0. 33. 0. 0.] [41. 0. 0. 44. 0.] [ 0. 0. 53. 54. 55.]] r8ccs_write_test(): r8ccs_write() writes a CCS matrix to 3 files An indicator matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] The CCS matrix: Col: 0 1 2 3 4 Row --- 0 11 12 0 0 15 1 21 22 0 0 25 2 0 0 33 0 0 3 41 0 0 44 0 4 0 0 53 54 55 r8ccs_zeros_test(): r8ccs_zeros() zeros a CCS matrix; Zero matrix in CCS format: Matrix rows M = 5 Matrix columns N = 5 Matrix nonzeros NZ_NUM = 12 The COLPTR vector: [ 0 3 5 7 9 12] The ROWIND vector: [0 1 3 0 1 2 4 3 4 0 1 4] Zero matrix in CCS format: Col: 0 1 2 3 4 Row --- 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 Wed Jun 22 10:53:25 2022