[go: up one dir, main page]

SelfAdjointEigenSolver.h is not compatible with AutoDiffScalar

Submitted by Shuntaro Yamazaki

Assigned to Nobody

Link to original bugzilla bug (#1401)
Version: 3.3 (current stable)

Description

Created attachment 780
patch

Attached a patch to fix the following compilation error. This might be an issue of AutoDiffScalar.

$ cat a.cpp
#include <Eigen/Dense>
#include <unsupported/Eigen/AutoDiff>
int main() {
typedef Eigen::Matrix<Eigen::AutoDiffScalarEigen::Vector2d,1,1> Mat;
Mat m;
Eigen::SelfAdjointEigenSolver<Mat> e(m);
return 0;
}

$ clang++ -I. a.cpp
In file included from a.cpp:1:
In file included from ./Eigen/Dense:7:
In file included from ./Eigen/Eigenvalues:39:
./Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:826:62: error: conditional expression is ambiguous; 'AutoDiffScalar<Eigen::Matrix<double, 2, 1, 0,
2, 1>>' can be converted to 'const AutoDiffScalar<CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const DerType>>' and vice versa
else mu -= e2 / (td + (td>RealScalar(0) ? h : -h));
^ ~ ~~

$ clang++ -v
clang version 3.7.0 (trunk 239477)
Target: x86_64-unknown-linux-gnu

Patch 780, "patch":
patch.diff

Edited by Eigen Bugzilla