23 July 2014 12:07:27 PM ST_TO_CC_PRB C++ version Test the ST_TO_CC library. TEST01 Convert a sparse matrix from ST to CC format. ST: sparse triplet, I, J, A. CC: compressed column, I, CC, A. ST header information: Minimum row index I_MIN = 1 Maximum row index I_MAX = 5 Minimum col index J_MIN = 1 Maximum col index J_MAX = 5 Number of rows M = 5 Number of columns N = 5 Number of nonzeros NST = 12 The matrix in ST format: # I J A ---- ---- ---- -------------- 0 0 0 2 1 0 1 3 2 1 0 3 3 1 2 4 4 1 4 6 5 2 1 -1 6 2 2 -3 7 2 3 2 8 3 2 1 9 4 1 4 10 4 2 2 11 4 4 1 Number of CC values = 12 CC Matrix: # I J A ---- ---- ---- ---------------- 0 0 0 2 1 1 0 3 2 0 1 3 3 2 1 -1 4 4 1 4 5 1 2 4 6 2 2 -3 7 3 2 1 8 4 2 2 9 2 3 2 10 1 4 6 11 4 4 1 TEST02 Convert a sparse matrix from ST to CC format. ST: sparse triplet, I, J, A. CC: compressed column, I, CC, A. This matrix is read from the file 'west_st.txt' ST header information: Minimum row index I_MIN = 1 Maximum row index I_MAX = 67 Minimum col index J_MIN = 1 Maximum col index J_MAX = 67 Number of rows M = 67 Number of columns N = 67 Number of nonzeros NST = 299 The matrix in ST format: # I J A ---- ---- ---- -------------- 0 44 55 -1.86335 1 54 61 -1.86335 2 29 37 -1.5674 3 44 56 -1.49068 4 54 62 -1.49068 5 9 12 -1.26582 6 29 38 -1.25392 7 44 57 -1.11801 8 54 63 -1.11801 9 15 31 -1.05 10 16 32 -1.05 11 17 33 -1.05 12 18 34 -1.05 13 19 35 -1.05 14 24 31 -1.05 15 25 32 -1.05 16 26 33 -1.05 17 27 34 -1.05 18 28 35 -1.05 19 9 13 -1.01266 20 10 20 -1 21 11 21 -1 22 12 22 -1 23 13 23 -1 24 14 24 -1 25 30 49 -0.972222 26 31 50 -0.972222 27 32 51 -0.972222 28 33 52 -0.972222 29 34 53 -0.972222 30 39 49 -0.972222 31 40 50 -0.972222 32 41 51 -0.972222 33 42 52 -0.972222 34 43 53 -0.972222 35 35 25 -0.958319 36 36 26 -0.958319 37 37 27 -0.958319 38 38 28 -0.958319 39 49 55 -0.944444 40 50 56 -0.944444 41 51 57 -0.944444 42 52 58 -0.944444 43 53 59 -0.944444 44 29 39 -0.940439 45 20 1 -0.915953 46 21 2 -0.915953 47 22 3 -0.915953 48 23 4 -0.915953 49 0 7 -0.834182 50 1 8 -0.834182 51 2 9 -0.834182 52 3 10 -0.834182 53 45 43 -0.824225 54 46 44 -0.824225 55 47 45 -0.824225 56 48 46 -0.824225 57 4 1 -0.8 58 5 2 -0.8 59 6 3 -0.8 60 7 4 -0.8 61 8 5 -0.8 62 9 14 -0.759494 63 44 58 -0.745342 64 54 64 -0.745342 65 29 40 -0.626959 66 9 15 -0.506329 67 44 59 -0.372671 68 54 65 -0.372671 69 0 17 -0.336156 70 29 41 -0.31348 71 1 17 -0.29392 72 20 42 -0.278842 73 4 0 -0.278842 74 21 42 -0.268019 75 5 0 -0.268019 76 52 54 -0.266776 77 53 54 -0.263071 78 48 66 -0.254119 79 9 16 -0.253165 80 37 60 -0.247567 81 47 66 -0.24215 82 33 48 -0.236285 83 42 48 -0.236285 84 36 60 -0.235647 85 22 42 -0.232372 86 6 0 -0.232372 87 32 48 -0.230392 88 41 48 -0.230392 89 17 30 -0.228626 90 26 30 -0.228626 91 16 30 -0.2233 92 25 30 -0.2233 93 2 17 -0.221481 94 12 19 -0.214421 95 11 19 -0.214039 96 51 54 -0.212206 97 38 60 -0.207487 98 10 19 -0.207176 99 15 30 -0.207099 100 24 30 -0.207099 101 35 60 -0.206995 102 18 30 -0.202453 103 27 30 -0.202453 104 13 19 -0.198677 105 31 48 -0.194771 106 40 48 -0.194771 107 46 66 -0.191856 108 34 48 -0.18039 109 43 48 -0.18039 110 14 19 -0.165687 111 30 48 -0.158163 112 39 48 -0.158163 113 23 42 -0.157508 114 7 0 -0.157508 115 50 54 -0.151491 116 45 66 -0.144335 117 19 30 -0.138523 118 28 30 -0.138523 119 3 17 -0.118986 120 49 54 -0.106457 121 8 0 -0.0632598 122 8 6 0.0117829 123 28 0 0.0316299 124 7 6 0.0475944 125 39 54 0.0532286 126 40 54 0.0757454 127 27 0 0.0787541 128 24 36 0.0814745 129 6 6 0.0885926 130 30 36 0.0905272 131 28 36 0.0924191 132 25 36 0.0978902 133 19 19 0.0994125 134 34 36 0.102688 135 41 54 0.106103 136 31 36 0.108767 137 26 36 0.113161 138 27 36 0.115056 139 26 0 0.116186 140 5 6 0.117568 141 18 19 0.119206 142 15 19 0.124305 143 32 36 0.125734 144 33 36 0.127839 145 16 19 0.128423 146 17 19 0.128652 147 43 54 0.131535 148 42 54 0.133388 149 25 0 0.134009 150 4 6 0.134462 151 24 0 0.139421 152 30 43 0.25 153 31 44 0.25 154 32 45 0.25 155 33 46 0.25 156 34 47 0.25 157 10 12 0.333333 158 11 13 0.333333 159 12 14 0.333333 160 13 15 0.333333 161 14 16 0.333333 162 24 1 0.4 163 25 2 0.4 164 26 3 0.4 165 27 4 0.4 166 28 5 0.4 167 4 12 0.4 168 4 7 0.4 169 5 13 0.4 170 5 8 0.4 171 6 14 0.4 172 6 9 0.4 173 7 10 0.4 174 7 15 0.4 175 8 11 0.4 176 8 16 0.4 177 49 61 0.444444 178 50 62 0.444444 179 51 63 0.444444 180 52 64 0.444444 181 53 65 0.444444 182 15 25 0.45 183 16 26 0.45 184 17 27 0.45 185 18 28 0.45 186 19 29 0.45 187 39 55 0.472222 188 40 56 0.472222 189 41 57 0.472222 190 42 58 0.472222 191 43 59 0.472222 192 39 25 0.5 193 40 26 0.5 194 41 27 0.5 195 42 28 0.5 196 43 29 0.5 197 49 43 0.5 198 50 44 0.5 199 51 45 0.5 200 52 46 0.5 201 53 47 0.5 202 3 15 0.506329 203 15 20 0.6 204 16 21 0.6 205 17 22 0.6 206 18 23 0.6 207 19 24 0.6 208 23 40 0.626959 209 24 37 0.65 210 25 38 0.65 211 26 39 0.65 212 27 40 0.65 213 28 41 0.65 214 14 18 0.666667 215 30 37 0.722222 216 31 38 0.722222 217 32 39 0.722222 218 33 40 0.722222 219 34 41 0.722222 220 38 58 0.745342 221 48 64 0.745342 222 2 14 0.759494 223 22 39 0.940439 224 59 31 0.5 225 59 32 0.5 226 59 33 0.5 227 59 34 0.5 228 59 35 0.5 229 29 42 1 230 44 60 1 231 54 66 1 232 55 18 1 233 56 10 1 234 56 11 1 235 56 7 1 236 56 8 1 237 56 9 1 238 57 12 1 239 57 13 1 240 57 14 1 241 57 15 1 242 57 16 1 243 58 20 1 244 58 21 1 245 58 22 1 246 58 23 1 247 58 24 1 248 59 31 0.5 249 59 32 0.5 250 59 33 0.5 251 59 34 0.5 252 59 35 0.5 253 60 1 1 254 60 2 1 255 60 3 1 256 60 4 1 257 60 5 1 258 61 37 1 259 61 38 1 260 61 39 1 261 61 40 1 262 61 41 1 263 62 49 1 264 62 50 1 265 62 51 1 266 62 52 1 267 62 53 1 268 63 25 1 269 63 26 1 270 63 27 1 271 63 28 1 272 63 29 1 273 64 55 1 274 64 56 1 275 64 57 1 276 64 58 1 277 64 59 1 278 65 43 1 279 65 44 1 280 65 45 1 281 65 46 1 282 65 47 1 283 66 61 1 284 66 62 1 285 66 63 1 286 66 64 1 287 66 65 1 288 9 17 1 289 1 13 1.01266 290 37 57 1.11801 291 47 63 1.11801 292 21 38 1.25392 293 0 12 1.26582 294 36 56 1.49068 295 46 62 1.49068 296 20 37 1.5674 297 35 55 1.86335 298 45 61 1.86335 Number of CC values = 294 CC Matrix: # I J A ---- ---- ---- ---------------- 0 4 0 -0.278842 1 5 0 -0.268019 2 6 0 -0.232372 3 7 0 -0.157508 4 8 0 -0.0632598 5 24 0 0.139421 6 25 0 0.134009 7 26 0 0.116186 8 27 0 0.0787541 9 28 0 0.0316299 10 4 1 -0.8 11 20 1 -0.915953 12 24 1 0.4 13 60 1 1 14 5 2 -0.8 15 21 2 -0.915953 16 25 2 0.4 17 60 2 1 18 6 3 -0.8 19 22 3 -0.915953 20 26 3 0.4 21 60 3 1 22 7 4 -0.8 23 23 4 -0.915953 24 27 4 0.4 25 60 4 1 26 8 5 -0.8 27 28 5 0.4 28 60 5 1 29 4 6 0.134462 30 5 6 0.117568 31 6 6 0.0885926 32 7 6 0.0475944 33 8 6 0.0117829 34 0 7 -0.834182 35 4 7 0.4 36 56 7 1 37 1 8 -0.834182 38 5 8 0.4 39 56 8 1 40 2 9 -0.834182 41 6 9 0.4 42 56 9 1 43 3 10 -0.834182 44 7 10 0.4 45 56 10 1 46 8 11 0.4 47 56 11 1 48 0 12 1.26582 49 4 12 0.4 50 9 12 -1.26582 51 10 12 0.333333 52 57 12 1 53 1 13 1.01266 54 5 13 0.4 55 9 13 -1.01266 56 11 13 0.333333 57 57 13 1 58 2 14 0.759494 59 6 14 0.4 60 9 14 -0.759494 61 12 14 0.333333 62 57 14 1 63 3 15 0.506329 64 7 15 0.4 65 9 15 -0.506329 66 13 15 0.333333 67 57 15 1 68 8 16 0.4 69 9 16 -0.253165 70 14 16 0.333333 71 57 16 1 72 0 17 -0.336156 73 1 17 -0.29392 74 2 17 -0.221481 75 3 17 -0.118986 76 9 17 1 77 14 18 0.666667 78 55 18 1 79 10 19 -0.207176 80 11 19 -0.214039 81 12 19 -0.214421 82 13 19 -0.198677 83 14 19 -0.165687 84 15 19 0.124305 85 16 19 0.128423 86 17 19 0.128652 87 18 19 0.119206 88 19 19 0.0994125 89 10 20 -1 90 15 20 0.6 91 58 20 1 92 11 21 -1 93 16 21 0.6 94 58 21 1 95 12 22 -1 96 17 22 0.6 97 58 22 1 98 13 23 -1 99 18 23 0.6 100 58 23 1 101 14 24 -1 102 19 24 0.6 103 58 24 1 104 15 25 0.45 105 35 25 -0.958319 106 39 25 0.5 107 63 25 1 108 16 26 0.45 109 36 26 -0.958319 110 40 26 0.5 111 63 26 1 112 17 27 0.45 113 37 27 -0.958319 114 41 27 0.5 115 63 27 1 116 18 28 0.45 117 38 28 -0.958319 118 42 28 0.5 119 63 28 1 120 19 29 0.45 121 43 29 0.5 122 63 29 1 123 15 30 -0.207099 124 16 30 -0.2233 125 17 30 -0.228626 126 18 30 -0.202453 127 19 30 -0.138523 128 24 30 -0.207099 129 25 30 -0.2233 130 26 30 -0.228626 131 27 30 -0.202453 132 28 30 -0.138523 133 15 31 -1.05 134 24 31 -1.05 135 59 31 1 136 16 32 -1.05 137 25 32 -1.05 138 59 32 1 139 17 33 -1.05 140 26 33 -1.05 141 59 33 1 142 18 34 -1.05 143 27 34 -1.05 144 59 34 1 145 19 35 -1.05 146 28 35 -1.05 147 59 35 1 148 24 36 0.0814745 149 25 36 0.0978902 150 26 36 0.113161 151 27 36 0.115056 152 28 36 0.0924191 153 30 36 0.0905272 154 31 36 0.108767 155 32 36 0.125734 156 33 36 0.127839 157 34 36 0.102688 158 20 37 1.5674 159 24 37 0.65 160 29 37 -1.5674 161 30 37 0.722222 162 61 37 1 163 21 38 1.25392 164 25 38 0.65 165 29 38 -1.25392 166 31 38 0.722222 167 61 38 1 168 22 39 0.940439 169 26 39 0.65 170 29 39 -0.940439 171 32 39 0.722222 172 61 39 1 173 23 40 0.626959 174 27 40 0.65 175 29 40 -0.626959 176 33 40 0.722222 177 61 40 1 178 28 41 0.65 179 29 41 -0.31348 180 34 41 0.722222 181 61 41 1 182 20 42 -0.278842 183 21 42 -0.268019 184 22 42 -0.232372 185 23 42 -0.157508 186 29 42 1 187 30 43 0.25 188 45 43 -0.824225 189 49 43 0.5 190 65 43 1 191 31 44 0.25 192 46 44 -0.824225 193 50 44 0.5 194 65 44 1 195 32 45 0.25 196 47 45 -0.824225 197 51 45 0.5 198 65 45 1 199 33 46 0.25 200 48 46 -0.824225 201 52 46 0.5 202 65 46 1 203 34 47 0.25 204 53 47 0.5 205 65 47 1 206 30 48 -0.158163 207 31 48 -0.194771 208 32 48 -0.230392 209 33 48 -0.236285 210 34 48 -0.18039 211 39 48 -0.158163 212 40 48 -0.194771 213 41 48 -0.230392 214 42 48 -0.236285 215 43 48 -0.18039 216 30 49 -0.972222 217 39 49 -0.972222 218 62 49 1 219 31 50 -0.972222 220 40 50 -0.972222 221 62 50 1 222 32 51 -0.972222 223 41 51 -0.972222 224 62 51 1 225 33 52 -0.972222 226 42 52 -0.972222 227 62 52 1 228 34 53 -0.972222 229 43 53 -0.972222 230 62 53 1 231 39 54 0.0532286 232 40 54 0.0757454 233 41 54 0.106103 234 42 54 0.133388 235 43 54 0.131535 236 49 54 -0.106457 237 50 54 -0.151491 238 51 54 -0.212206 239 52 54 -0.266776 240 53 54 -0.263071 241 35 55 1.86335 242 39 55 0.472222 243 44 55 -1.86335 244 49 55 -0.944444 245 64 55 1 246 36 56 1.49068 247 40 56 0.472222 248 44 56 -1.49068 249 50 56 -0.944444 250 64 56 1 251 37 57 1.11801 252 41 57 0.472222 253 44 57 -1.11801 254 51 57 -0.944444 255 64 57 1 256 38 58 0.745342 257 42 58 0.472222 258 44 58 -0.745342 259 52 58 -0.944444 260 64 58 1 261 43 59 0.472222 262 44 59 -0.372671 263 53 59 -0.944444 264 64 59 1 265 35 60 -0.206995 266 36 60 -0.235647 267 37 60 -0.247567 268 38 60 -0.207487 269 44 60 1 270 45 61 1.86335 271 49 61 0.444444 272 54 61 -1.86335 273 66 61 1 274 46 62 1.49068 275 50 62 0.444444 276 54 62 -1.49068 277 66 62 1 278 47 63 1.11801 279 51 63 0.444444 280 54 63 -1.11801 281 66 63 1 282 48 64 0.745342 283 52 64 0.444444 284 54 64 -0.745342 285 66 64 1 286 53 65 0.444444 287 54 65 -0.372671 288 66 65 1 289 45 66 -0.144335 290 46 66 -0.191856 291 47 66 -0.24215 292 48 66 -0.254119 293 54 66 1 TEST03 Convert a sparse matrix from ST to CC format. ST: sparse triplet, I, J, A. CC: compressed column, I, CC, A. The ST matrix is read from the file 'west_st.txt' and the CC matrix is written to the files: 'west_icc.txt', 'west_ccc.txt', and 'west_acc.txt'. ST header information: Minimum row index I_MIN = 1 Maximum row index I_MAX = 67 Minimum col index J_MIN = 1 Maximum col index J_MAX = 67 Number of rows M = 67 Number of columns N = 67 Number of nonzeros NST = 299 Number of CC values = 294 TEST04 Convert a sparse matrix from ST to CC format. ST: sparse triplet, I, J, A. CC: compressed column, I, CC, A. The ST matrix is the Wathen finite element matrix. It has many repeated index pairs. To check, compare ACC*X - AST*X for a random X. Number of ST values = 576 ST header information: Minimum row index I_MIN = 0 Maximum row index I_MAX = 39 Minimum col index J_MIN = 0 Maximum col index J_MAX = 39 Number of rows M = 40 Number of columns N = 40 Number of nonzeros NST = 576 Number of CC values = 472 || ACC*X - AST*X|| = 1.43521e-12 ST_TO_CC_PRB Normal end of execution. 23 July 2014 12:07:27 PM