diff options
author | Adolfo Rodriguez Tsouroukdissian <adolfo.rodriguez@pal-robotics.com> | 2010-04-21 17:15:57 +0200 |
---|---|---|
committer | Adolfo Rodriguez Tsouroukdissian <adolfo.rodriguez@pal-robotics.com> | 2010-04-21 17:15:57 +0200 |
commit | 28dde19e40a3d758faa94f0fc228857f7b3192ea (patch) | |
tree | 2647d94ffd250e7b215e98baddcecb8fb651543a /Eigen/src/Eigenvalues/Tridiagonalization.h | |
parent | faf8f7732dffd33eeae8afc8aad165668c8b6b2e (diff) |
- Added problem size constructor to decompositions that did not have one. It preallocates member data structures.
- Updated unit tests to check above constructor.
- In the compute() method of decompositions: Made temporary matrices/vectors class members to avoid heap allocations during compute() (when dynamic matrices are used, of course).
These changes can speed up decomposition computation time when a solver instance is used to solve multiple same-sized problems. An added benefit is that the compute() method can now be invoked in contexts were heap allocations are forbidden, such as in real-time control loops.
CAVEAT: Not all of the decompositions in the Eigenvalues module have a heap-allocation-free compute() method. A future patch may address this issue, but some required API changes need to be incorporated first.
Diffstat (limited to 'Eigen/src/Eigenvalues/Tridiagonalization.h')
-rw-r--r-- | Eigen/src/Eigenvalues/Tridiagonalization.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h index a0b772888..c320242ef 100644 --- a/Eigen/src/Eigenvalues/Tridiagonalization.h +++ b/Eigen/src/Eigenvalues/Tridiagonalization.h @@ -210,8 +210,8 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType& // i.e., A = H A H' where H = I - h v v' and v = matA.col(i).tail(n-i-1) matA.col(i).coeffRef(i+1) = 1; - hCoeffs.tail(n-i-1) = (matA.corner(BottomRight,remainingSize,remainingSize).template selfadjointView<Lower>() - * (ei_conj(h) * matA.col(i).tail(remainingSize))); + hCoeffs.tail(n-i-1).noalias() = (matA.corner(BottomRight,remainingSize,remainingSize).template selfadjointView<Lower>() + * (ei_conj(h) * matA.col(i).tail(remainingSize))); hCoeffs.tail(n-i-1) += (ei_conj(h)*Scalar(-0.5)*(hCoeffs.tail(remainingSize).dot(matA.col(i).tail(remainingSize)))) * matA.col(i).tail(n-i-1); |