Skip to content

template maxCoeff<PropagateNaN> compilation error with Eigen 3.4.

Please choose the Bug Report or Feature Request template to file an issue Adrien Lefieux commented:

Hello,

I have ran into a compiling issue (Clang 11.1.0 - OS X 11.2.3) with Eigen 3.4 (git-branch commit 4837d7b5):

error: no matching member function for call to 'maxCoeff' RealScalar scale = matrix.cwiseAbs().template maxCoeff<PropagateNaN>(); I did not have such a compilation issue with either Eigen 3.3.9 or Eigen master (pulled on 13 April 2021).

The "bug" arised from a rather simple problem:

    Eigen::Vector3d v0(0, 0, 1);
    Eigen::Vector3d v1(0, 1, 0);
    Eigen::Quaterniond map;
    map.setFromTwoVectors(v0, v1); <- compilation error
    Eigen::Matrix3d m = map.toRotationMatrix();

I suspect that such a patch would solved the issue on branch 3.4.

I hope this helps.

Best,

Additional details:

Eigen/src/Core/DenseBase.h:462:48: note: candidate function template not viable: requires single argument 'index', but no arguments were provided
    typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
                                               ^
Eigen/src/Core/DenseBase.h:458:48: note: candidate function template not viable: requires 2 arguments, but 0 were provided
    typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
Edited by Rasmus Munk Larsen