MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / _solve_impl

Method _solve_impl

include/Eigen/src/SparseLU/SparseLU.h:338–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336
337 template <typename Rhs, typename Dest>
338 bool _solve_impl(const MatrixBase<Rhs>& B, MatrixBase<Dest>& X_base) const {
339 Dest& X(X_base.derived());
340 eigen_assert(m_factorizationIsOk && "The matrix should be factorized first");
341 EIGEN_STATIC_ASSERT((Dest::Flags & RowMajorBit) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
342
343 // Permute the right hand side to form X = Pr*B
344 // on return, X is overwritten by the computed solution
345 X.resize(B.rows(), B.cols());
346
347 // this ugly const_cast_derived() helps to detect aliasing when applying the permutations
348 for (Index j = 0; j < B.cols(); ++j) X.col(j) = rowsPermutation() * B.const_cast_derived().col(j);
349
350 // Forward substitution with L
351 this->matrixL().solveInPlace(X);
352 this->matrixU().solveInPlace(X);
353
354 // Permute back the solution
355 for (Index j = 0; j < B.cols(); ++j) X.col(j) = colsPermutation().inverse() * X.col(j);
356
357 return true;
358 }
359
360 /** \brief Give the absolute value of the determinant.
361 *

Callers

nothing calls this directly

Calls 8

matrixLMethod · 0.95
matrixUMethod · 0.95
resizeMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
colMethod · 0.45
solveInPlaceMethod · 0.45
inverseMethod · 0.45

Tested by

no test coverage detected