MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Timing

Method Timing

comp/preconditioner.cpp:183–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

IMClass · 0.85
GetAMatrixFunction · 0.85
GetMatrixFunction · 0.85
CreateColVectorMethod · 0.45

Tested by

no test coverage detected