mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 05:05:58 +08:00
fix MaxCols in ComplexEigenSolver which was causing memory allocation instead of static allocation in the nomalloc test. Uncomment commenetd parts of the nomalloc test since now matrix-matrix products are safe.
This commit is contained in:
parent
32124bc64a
commit
3d8e179aa2
@ -96,7 +96,7 @@ template<typename _MatrixType> class ComplexEigenSolver
|
|||||||
* This is a square matrix with entries of type #ComplexScalar.
|
* This is a square matrix with entries of type #ComplexScalar.
|
||||||
* The size is the same as the size of #MatrixType.
|
* The size is the same as the size of #MatrixType.
|
||||||
*/
|
*/
|
||||||
typedef Matrix<ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, ColsAtCompileTime> EigenvectorType;
|
typedef Matrix<ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime> EigenvectorType;
|
||||||
|
|
||||||
/** \brief Default constructor.
|
/** \brief Default constructor.
|
||||||
*
|
*
|
||||||
|
@ -70,12 +70,7 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX((m1+m2)*s1, s1*m1+s1*m2);
|
VERIFY_IS_APPROX((m1+m2)*s1, s1*m1+s1*m2);
|
||||||
VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
|
VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
|
||||||
VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), (m1.array()*m1.array()).matrix());
|
VERIFY_IS_APPROX(m1.cwiseProduct(m1.block(0,0,rows,cols)), (m1.array()*m1.array()).matrix());
|
||||||
if (MatrixType::RowsAtCompileTime<EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD) {
|
VERIFY_IS_APPROX((m1*m1.transpose())*m2, m1*(m1.transpose()*m2));
|
||||||
// If the matrices are too large, we have better to use the optimized GEMM
|
|
||||||
// routines which allocates temporaries. However, on some platforms
|
|
||||||
// these temporaries are allocated on the stack using alloca.
|
|
||||||
VERIFY_IS_APPROX((m1*m1.transpose())*m2, m1*(m1.transpose()*m2));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
@ -110,7 +105,7 @@ void ctms_decompositions()
|
|||||||
// Eigenvalues module
|
// Eigenvalues module
|
||||||
Eigen::HessenbergDecomposition<ComplexMatrix> hessDecomp; hessDecomp.compute(complexA);
|
Eigen::HessenbergDecomposition<ComplexMatrix> hessDecomp; hessDecomp.compute(complexA);
|
||||||
Eigen::ComplexSchur<ComplexMatrix> cSchur(size); cSchur.compute(complexA);
|
Eigen::ComplexSchur<ComplexMatrix> cSchur(size); cSchur.compute(complexA);
|
||||||
Eigen::ComplexEigenSolver<ComplexMatrix> cEigSolver; //cEigSolver.compute(complexA); // NOTE: Commented-out because makes test fail (L135 of ComplexEigenSolver.h has a product that allocates on the stack)
|
Eigen::ComplexEigenSolver<ComplexMatrix> cEigSolver; cEigSolver.compute(complexA);
|
||||||
Eigen::EigenSolver<Matrix> eigSolver; eigSolver.compute(A);
|
Eigen::EigenSolver<Matrix> eigSolver; eigSolver.compute(A);
|
||||||
Eigen::SelfAdjointEigenSolver<Matrix> saEigSolver(size); saEigSolver.compute(saA);
|
Eigen::SelfAdjointEigenSolver<Matrix> saEigSolver(size); saEigSolver.compute(saA);
|
||||||
Eigen::Tridiagonalization<Matrix> tridiag; tridiag.compute(saA);
|
Eigen::Tridiagonalization<Matrix> tridiag; tridiag.compute(saA);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user