mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-13 18:37:27 +08:00
Add some pre-allocation unit tests (not working yet)
This commit is contained in:
parent
6cd7b9ea6b
commit
a93e354d92
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user