| 20 | */ |
| 21 | template<typename Decomposition, typename Rhs, typename Dest> |
| 22 | typename enable_if<Rhs::ColsAtCompileTime!=1 && Dest::ColsAtCompileTime!=1>::type |
| 23 | solve_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 |
| 45 | template<typename Decomposition, typename Rhs, typename Dest> |
no test coverage detected