| 590 | // Assign to a vector |
| 591 | template <typename DesType> |
| 592 | void evalTo(DesType& res) const { |
| 593 | Index m = m_qr.rows(); |
| 594 | Index n = m_qr.cols(); |
| 595 | Index diagSize = (std::min)(m, n); |
| 596 | res = m_other; |
| 597 | if (m_transpose) { |
| 598 | eigen_assert(m_qr.m_Q.rows() == m_other.rows() && "Non conforming object sizes"); |
| 599 | // Compute res = Q' * other column by column |
| 600 | for (Index j = 0; j < res.cols(); j++) { |
| 601 | for (Index k = 0; k < diagSize; k++) { |
| 602 | Scalar tau = Scalar(0); |
| 603 | tau = m_qr.m_Q.col(k).dot(res.col(j)); |
| 604 | if (tau == Scalar(0)) continue; |
| 605 | tau = tau * m_qr.m_hcoeffs(k); |
| 606 | res.col(j) -= tau * m_qr.m_Q.col(k); |
| 607 | } |
| 608 | } |
| 609 | } else { |
| 610 | eigen_assert(m_qr.matrixQ().cols() == m_other.rows() && "Non conforming object sizes"); |
| 611 | |
| 612 | res.conservativeResize(rows(), cols()); |
| 613 | |
| 614 | // Compute res = Q * other column by column |
| 615 | for (Index j = 0; j < res.cols(); j++) { |
| 616 | Index start_k = internal::is_identity<Derived>::value ? numext::mini(j, diagSize - 1) : diagSize - 1; |
| 617 | for (Index k = start_k; k >= 0; k--) { |
| 618 | Scalar tau = Scalar(0); |
| 619 | tau = m_qr.m_Q.col(k).dot(res.col(j)); |
| 620 | if (tau == Scalar(0)) continue; |
| 621 | tau = tau * numext::conj(m_qr.m_hcoeffs(k)); |
| 622 | res.col(j) -= tau * m_qr.m_Q.col(k); |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | const SparseQRType& m_qr; |
| 629 | const Derived& m_other; |
no test coverage detected