I tried to run standard SVD example from docs
MatrixXf m = MatrixXf::Random(3,2);
JacobiSVD<MatrixXf, ComputeThinU | ComputeThinV> svd(m);
But this code gives me following compilation error when i tried to use it with Eigen 3.4.0:
In file included from ./Eigen/SVD:37, from ./Eigen/Dense:5, from a.cpp:3: ./Eigen/src/SVD/JacobiSVD.h: In instantiation of ‘Eigen::JacobiSVD<MatrixType, QRPreconditioner>& Eigen::JacobiSVD<MatrixType, QRPreconditioner>::compute(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<float, -1, -1>; int QRPreconditioner = 40; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<float, -1, -1>]’: ./Eigen/src/SVD/JacobiSVD.h:549:14: required from ‘Eigen::JacobiSVD<MatrixType, QRPreconditioner>::JacobiSVD(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<float, -1, -1>; int QRPreconditioner = 40; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<float, -1, -1>]’ a.cpp:10:56: required from here ./Eigen/src/SVD/JacobiSVD.h:692:27: error: ‘struct Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<float, -1, -1>, 40, 0, true>’ has no member named ‘run’ 692 | m_qr_precond_morecols.run(*this, m_scaledMatrix); | ~~~~~~~~~~~~~~~~~~~~~~^~~ ./Eigen/src/SVD/JacobiSVD.h:693:27: error: ‘struct Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<float, -1, -1>, 40, 1, true>’ has no member named ‘run’ 693 | m_qr_precond_morerows.run(*this, m_scaledMatrix); | ~~~~~~~~~~~~~~~~~~~~~~^~~ ./Eigen/src/SVD/JacobiSVD.h: In instantiation of ‘void Eigen::JacobiSVD<MatrixType, QRPreconditioner>::allocate(Eigen::Index, Eigen::Index, unsigned int) [with _MatrixType = Eigen::Matrix<float, -1, -1>; int QRPreconditioner = 40; Eigen::Index = long int]’: ./Eigen/src/SVD/JacobiSVD.h:669:3: required from ‘Eigen::JacobiSVD<MatrixType, QRPreconditioner>& Eigen::JacobiSVD<MatrixType, QRPreconditioner>::compute(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<float, -1, -1>; int QRPreconditioner = 40; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<float, -1, -1>]’ ./Eigen/src/SVD/JacobiSVD.h:549:14: required from ‘Eigen::JacobiSVD<MatrixType, QRPreconditioner>::JacobiSVD(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<float, -1, -1>; int QRPreconditioner = 40; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<float, -1, -1>]’ a.cpp:10:56: required from here ./Eigen/src/SVD/JacobiSVD.h:659:45: error: ‘struct Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<float, -1, -1>, 40, 0, true>’ has no member named ‘allocate’ 659 | if(m_cols>m_rows) m_qr_precond_morecols.allocate(*this); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ ./Eigen/src/SVD/JacobiSVD.h:660:45: error: ‘struct Eigen::internal::qr_preconditioner_impl<Eigen::Matrix<float, -1, -1>, 40, 1, true>’ has no member named ‘allocate’ 660 | if(m_rows>m_cols) m_qr_precond_morerows.allocate(*this);
I get same error when tried to compile it with 3.3.9 (from ubuntu repo). Everything works fine with Eigen from master branch
Is it possible to use JacobiSVD with 3.4.0? If not, which stable Eigen version should i use to be able to use JacobiSVD?