| 181 | |
| 182 | |
| 183 | void Preconditioner :: Timing () const |
| 184 | { |
| 185 | cout << IM(1) << "Timing Preconditioner ... " << flush; |
| 186 | const BaseMatrix & amat = GetAMatrix(); |
| 187 | const BaseMatrix & pre = GetMatrix(); |
| 188 | |
| 189 | clock_t starttime; |
| 190 | double time; |
| 191 | starttime = clock(); |
| 192 | |
| 193 | BaseVector & vecf = *pre.CreateColVector(); |
| 194 | BaseVector & vecu = *pre.CreateColVector(); |
| 195 | |
| 196 | vecf = 1; |
| 197 | int steps = 0; |
| 198 | do |
| 199 | { |
| 200 | vecu = pre * vecf; |
| 201 | steps++; |
| 202 | time = double(clock() - starttime) / CLOCKS_PER_SEC; |
| 203 | } |
| 204 | while (time < 2.0); |
| 205 | |
| 206 | cout << IM(1) << " 1 step takes " << time / steps << " seconds" << endl; |
| 207 | |
| 208 | |
| 209 | starttime = clock(); |
| 210 | steps = 0; |
| 211 | do |
| 212 | { |
| 213 | vecu = amat * vecf; |
| 214 | steps++; |
| 215 | time = double(clock() - starttime) / CLOCKS_PER_SEC; |
| 216 | } |
| 217 | while (time < 2.0); |
| 218 | |
| 219 | cout << IM(1) << ", 1 matrix takes " |
| 220 | << time / steps << " seconds" << endl; |
| 221 | } |
| 222 | |
| 223 | |
| 224 | void Preconditioner :: ThrowPreconditionerNotReady() const |
nothing calls this directly
no test coverage detected