From 5a36f4a8d1c84e0837ec53bbf9c1881b938ef157 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Mon, 8 Mar 2010 19:31:27 +0100 Subject: Propagate all five matrix template parameters to members and temporaries of decomposition classes. One particular advantage of this is that decomposing matrices with max sizes known at compile time will not allocate. NOTE: The ComplexEigenSolver class currently _does_ allocate (line 135 of Eigenvalues/ComplexEigenSolver.h), but the reason appears to be in the implementation of matrix-matrix products, and not in the decomposition itself. The nomalloc unit test has been extended to verify that decompositions do not allocate when max sizes are specified. There are currently two workarounds to prevent the test from failing (see comments in test/nomalloc.cpp), both of which are related to matrix products that allocate on the stack. --- Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h') diff --git a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h index e8e9bea97..209624c0a 100644 --- a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +++ b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h @@ -42,13 +42,17 @@ template class SelfAdjointEigenSolver { public: - enum {Size = _MatrixType::RowsAtCompileTime }; typedef _MatrixType MatrixType; + enum { + Size = MatrixType::RowsAtCompileTime, + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + Options = MatrixType::Options, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime + }; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef std::complex Complex; - typedef Matrix RealVectorType; - typedef Matrix RealVectorTypeX; + typedef Matrix RealVectorType; typedef Tridiagonalization TridiagonalizationType; // typedef typename TridiagonalizationType::TridiagonalMatrixType TridiagonalMatrixType; -- cgit v1.2.3