MCPcopy Create free account
hub / github.com/PX4/eigen / _solve_impl

Method _solve_impl

Eigen/src/SparseQR/SparseQR.h:192–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 /** \internal */
191 template<typename Rhs, typename Dest>
192 bool _solve_impl(const MatrixBase<Rhs> &B, MatrixBase<Dest> &dest) const
193 {
194 eigen_assert(m_isInitialized && "The factorization should be called first, use compute()");
195 eigen_assert(this->rows() == B.rows() && "SparseQR::solve() : invalid number of rows in the right hand side matrix");
196
197 Index rank = this->rank();
198
199 // Compute Q^T * b;
200 typename Dest::PlainObject y, b;
201 y = this->matrixQ().transpose() * B;
202 b = y;
203
204 // Solve with the triangular matrix R
205 y.resize((std::max<Index>)(cols(),y.rows()),y.cols());
206 y.topRows(rank) = this->matrixR().topLeftCorner(rank, rank).template triangularView<Upper>().solve(b.topRows(rank));
207 y.bottomRows(y.rows()-rank).setZero();
208
209 // Apply the column permutation
210 if (m_perm_c.size()) dest = colsPermutation() * y.topRows(cols());
211 else dest = y.topRows(cols());
212
213 m_info = Success;
214 return true;
215 }
216
217 /** Sets the threshold that is used to determine linearly dependent columns during the factorization.
218 *

Callers

nothing calls this directly

Calls 11

rowsMethod · 0.95
rankMethod · 0.95
matrixQMethod · 0.95
matrixRMethod · 0.80
colsFunction · 0.50
transposeMethod · 0.45
resizeMethod · 0.45
colsMethod · 0.45
solveMethod · 0.45
setZeroMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected