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

Method MultiMultSeed

linalg/cg.cpp:253–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252 template <class IPTYPE>
253 void CGSolver<IPTYPE> :: MultiMultSeed (const BaseVector & f, BaseVector & u, const int dim) const
254 {
255 try
256 {
257 // Solve A u = f
258 BaseStatusHandler::SetThreadPercentage(0);
259
260 SCAL * pl;
261 const SCAL * pr;
262 int i;
263
264 auto d = f.CreateVector();
265
266 BaseMatrix * smalla;
267 /*
268 if(dynamic_cast< const SparseMatrixSymmetricTM<SCAL> *>(a))
269 smalla = new SparseMatrixSymmetric<SCAL,SCAL>(*dynamic_cast< const SparseMatrixSymmetricTM<SCAL> *>(a));
270 else
271 */
272 if (dynamic_cast< const SparseMatrixTM<SCAL> *>(a.get()))
273 smalla = new SparseMatrix<SCAL,SCAL>(*dynamic_cast< const SparseMatrixTM<SCAL> *>(a.get()));
274 else
275 throw Exception("Assumption about bilinearform wrong.");
276
277
278 //BaseVector & aux1 = (smalla) ? d : *f.CreateVector();
279 //BaseVector & aux2 = (smalla) ? d : *f.CreateVector();
280
281
282 VVector<SCAL> w(f.Size());
283 VVector<SCAL> d_reduced(f.Size());
284 VVector<SCAL> s(f.Size());
285
286 int n = 0;
287
288 SCAL be,wd,wdn,kss;
289 Vector<SCAL> al(dim);
290 Array<double> err(dim);
291
292 if (initialize)
293 {
294 u = 0.0;
295 d = f;
296 }
297 else
298 {
299 d = f - (*a) * u;
300 }
301
302
303 double lwstart;
304 double lerr;
305
306
307
308 for(int seed = dim-1; seed >= 0; seed--)
309 {
310

Callers

nothing calls this directly

Calls 10

IMClass · 0.85
BruteInnerProduct2Function · 0.85
MemoryMethod · 0.80
AbsFunction · 0.70
sqrtFunction · 0.50
logFunction · 0.50
CreateVectorMethod · 0.45
getMethod · 0.45
SizeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected