aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-08-29 11:08:44 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-08-29 11:08:44 +0200
commita93e354d9282cc76de899db412c79f730ff58345 (patch)
tree31277e9fc6fa50bae1555461c14f4dfc6581572c
parent6cd7b9ea6b401d84da5114041321ef388dc92092 (diff)
Add some pre-allocation unit tests (not working yet)
-rw-r--r--test/eigensolver_generalized_real.cpp7
-rw-r--r--test/real_qz.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/test/eigensolver_generalized_real.cpp b/test/eigensolver_generalized_real.cpp
index 1abddfab5..fc26e90e1 100644
--- a/test/eigensolver_generalized_real.cpp
+++ b/test/eigensolver_generalized_real.cpp
@@ -7,6 +7,7 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#define EIGEN_RUNTIME_NO_MALLOC
#include "main.h"
#include <limits>
#include <Eigen/Eigenvalues>
@@ -51,7 +52,11 @@ template<typename MatrixType> void generalized_eigensolver_real(const MatrixType
// non symmetric case:
{
- GeneralizedEigenSolver<MatrixType> eig(a,b);
+ GeneralizedEigenSolver<MatrixType> eig(rows);
+ // TODO enable full-prealocation of required memory, this probably requires an in-place mode for HessenbergDecomposition
+ //Eigen::internal::set_is_malloc_allowed(false);
+ eig.compute(a,b);
+ //Eigen::internal::set_is_malloc_allowed(true);
for(Index k=0; k<cols; ++k)
{
Matrix<ComplexScalar,Dynamic,Dynamic> tmp = (eig.betas()(k)*a).template cast<ComplexScalar>() - eig.alphas()(k)*b;
diff --git a/test/real_qz.cpp b/test/real_qz.cpp
index 45ae8d763..99ac31235 100644
--- a/test/real_qz.cpp
+++ b/test/real_qz.cpp
@@ -7,6 +7,7 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#define EIGEN_RUNTIME_NO_MALLOC
#include "main.h"
#include <limits>
#include <Eigen/Eigenvalues>
@@ -41,7 +42,11 @@ template<typename MatrixType> void real_qz(const MatrixType& m)
break;
}
- RealQZ<MatrixType> qz(A,B);
+ RealQZ<MatrixType> qz(dim);
+ // TODO enable full-prealocation of required memory, this probably requires an in-place mode for HessenbergDecomposition
+ //Eigen::internal::set_is_malloc_allowed(false);
+ qz.compute(A,B);
+ //Eigen::internal::set_is_malloc_allowed(true);
VERIFY_IS_EQUAL(qz.info(), Success);
// check for zeros