diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-07-02 12:18:25 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-07-02 12:18:25 +0200 |
commit | 047677a08d907031bfa596017c15493c982181c5 (patch) | |
tree | 656b84e2879a88c030231868ece9637662dcf4a3 /Eigen | |
parent | d6255649361fde3e937320dfd216a84203adc295 (diff) |
Fix regression in changeset f05dea6b2326836e5e0243fbaffbece84b833d64
: computeFromHessenberg can take any expression for matrixQ, not only an HouseholderSequence.
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Eigenvalues/RealSchur.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Eigen/src/Eigenvalues/RealSchur.h b/Eigen/src/Eigenvalues/RealSchur.h index 4c53344bb..aca8a8279 100644 --- a/Eigen/src/Eigenvalues/RealSchur.h +++ b/Eigen/src/Eigenvalues/RealSchur.h @@ -270,8 +270,13 @@ RealSchur<MatrixType>& RealSchur<MatrixType>::compute(const EigenBase<InputType> // Step 1. Reduce to Hessenberg form m_hess.compute(matrix.derived()/scale); - // Step 2. Reduce to real Schur form - computeFromHessenberg(m_hess.matrixH(), m_hess.matrixQ(), computeU); + // Step 2. Reduce to real Schur form + // Note: we copy m_hess.matrixQ() into m_matU here and not in computeFromHessenberg + // to be able to pass our working-space buffer for the Householder to Dense evaluation. + m_workspaceVector.resize(matrix.cols()); + if(computeU) + m_hess.matrixQ().evalTo(m_matU, m_workspaceVector); + computeFromHessenberg(m_hess.matrixH(), m_matU, computeU); m_matT *= scale; @@ -285,8 +290,8 @@ RealSchur<MatrixType>& RealSchur<MatrixType>::computeFromHessenberg(const HessMa m_matT = matrixH; m_workspaceVector.resize(m_matT.cols()); - if(computeU) - matrixQ.evalTo(m_matU, m_workspaceVector); + if(computeU && !internal::is_same_dense(m_matU,matrixQ)) + m_matU = matrixQ; Index maxIters = m_maxIters; if (maxIters == -1) |