| 220 | |
| 221 | template<typename Rhs, typename Dest> |
| 222 | bool _solve(const MatrixBase<Rhs> &B, MatrixBase<Dest> &_X) const |
| 223 | { |
| 224 | Dest& X(_X.derived()); |
| 225 | eigen_assert(m_factorizationIsOk && "The matrix should be factorized first"); |
| 226 | EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0, |
| 227 | THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); |
| 228 | |
| 229 | // Permute the right hand side to form X = Pr*B |
| 230 | // on return, X is overwritten by the computed solution |
| 231 | X.resize(B.rows(),B.cols()); |
| 232 | for(Index j = 0; j < B.cols(); ++j) |
| 233 | X.col(j) = rowsPermutation() * B.col(j); |
| 234 | |
| 235 | //Forward substitution with L |
| 236 | this->matrixL().solveInPlace(X); |
| 237 | this->matrixU().solveInPlace(X); |
| 238 | |
| 239 | // Permute back the solution |
| 240 | for (Index j = 0; j < B.cols(); ++j) |
| 241 | X.col(j) = colsPermutation().inverse() * X.col(j); |
| 242 | |
| 243 | return true; |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * \returns the absolute value of the determinant of the matrix of which |