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

Function solve_sparse_through_dense_panels

Eigen/src/SparseCore/SparseSolverBase.h:22–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 */
21template<typename Decomposition, typename Rhs, typename Dest>
22typename enable_if<Rhs::ColsAtCompileTime!=1 && Dest::ColsAtCompileTime!=1>::type
23solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest &dest)
24{
25 EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
26 typedef typename Dest::Scalar DestScalar;
27 // we process the sparse rhs per block of NbColsAtOnce columns temporarily stored into a dense matrix.
28 static const Index NbColsAtOnce = 4;
29 Index rhsCols = rhs.cols();
30 Index size = rhs.rows();
31 // the temporary matrices do not need more columns than NbColsAtOnce:
32 Index tmpCols = (std::min)(rhsCols, NbColsAtOnce);
33 Eigen::Matrix<DestScalar,Dynamic,Dynamic> tmp(size,tmpCols);
34 Eigen::Matrix<DestScalar,Dynamic,Dynamic> tmpX(size,tmpCols);
35 for(Index k=0; k<rhsCols; k+=NbColsAtOnce)
36 {
37 Index actualCols = std::min<Index>(rhsCols-k, NbColsAtOnce);
38 tmp.leftCols(actualCols) = rhs.middleCols(k,actualCols);
39 tmpX.leftCols(actualCols) = dec.solve(tmp.leftCols(actualCols));
40 dest.middleCols(k,actualCols) = tmpX.leftCols(actualCols).sparseView();
41 }
42}
43
44// Overload for vector as rhs
45template<typename Decomposition, typename Rhs, typename Dest>

Callers 3

_solve_implMethod · 0.85
_solve_implMethod · 0.85
_solve_implMethod · 0.85

Calls 4

sparseViewMethod · 0.80
colsMethod · 0.45
rowsMethod · 0.45
solveMethod · 0.45

Tested by

no test coverage detected