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

Method GetIndirect

linalg/basevector.cpp:394–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392
393 template<>
394 void S_BaseVector<double> :: GetIndirect (FlatArray<int> ind,
395 FlatVector<double> v) const
396 {
397 if (EntrySize() == 1)
398 {
399 FlatVector<double> lsv(Size(), FVDouble().Addr(0));
400 for (auto i : ind.Range())
401 {
402 int index = ind[i];
403 v(i) = IsRegularIndex(index) ? lsv(index) : 0;
404 }
405 /*
406 int i = 0;
407 double temp[8];
408 for ( ; i + 7 < ind.Size(); i+=8)
409 {
410 for (int i2 = 0; i2 < 8; i2++)
411 {
412 int index = ind[i+i2];
413 temp[i2] = (index != -1) ? lsv(index) : 0;
414 }
415 for (int i2 = 0; i2 < 8; i2++)
416 v(i+i2) = temp[i2];
417 }
418 for ( ; i < ind.Size(); i++)
419 {
420 int index = ind[i];
421 v(i) = (index != -1) ? lsv(index) : 0;
422 }
423 */
424 }
425 else
426 {
427 FlatSysVector<double> lsv(Size(), EntrySize(), FVDouble().Addr(0));
428 FlatSysVector<double> sv(ind.Size(), EntrySize(), v.Addr(0));
429
430 for (size_t i = 0; i < ind.Size(); i++)
431 if (IsRegularIndex(ind[i]))
432 sv(i) = lsv(ind[i]);
433 else
434 sv(i) = -1.0;
435 }
436 }
437
438 template<>
439 void S_BaseVector<double> :: GetIndirect (FlatArray<int> ind,

Callers

nothing calls this directly

Calls 8

EntrySizeFunction · 0.85
FVDoubleFunction · 0.85
FVComplexFunction · 0.85
AddrMethod · 0.80
SizeFunction · 0.70
IsRegularIndexFunction · 0.70
RangeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected