MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / SolveLower

Method SolveLower

GTE/Mathematics/BandedMatrix.h:393–414  ·  view source on GitHub ↗

The linear system is L*U*X = B, where A = L*U and U = L^T, Reduce this to U*X = L^{-1}*B. The return value is 'true' iff the operation is successful.

Source from the content-addressed store, hash-verified

391 // this to U*X = L^{-1}*B. The return value is 'true' iff the
392 // operation is successful.
393 bool SolveLower(Real* dataVector) const
394 {
395 int32_t const size = static_cast<int32_t>(mDBand.size());
396 for (int32_t r = 0; r < size; ++r)
397 {
398 Real lowerRR = operator()(r, r);
399 if (lowerRR > (Real)0)
400 {
401 for (int32_t c = 0; c < r; ++c)
402 {
403 Real lowerRC = operator()(r, c);
404 dataVector[r] -= lowerRC * dataVector[c];
405 }
406 dataVector[r] /= lowerRR;
407 }
408 else
409 {
410 return false;
411 }
412 }
413 return true;
414 }
415
416 // The linear system is U*X = L^{-1}*B. Reduce this to
417 // X = U^{-1}*L^{-1}*B. The return value is 'true' iff the operation

Callers 2

DoIterationMethod · 0.45
operator()Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected