diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 1a797d560..4fc003d63 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -216,6 +216,11 @@ class AutoDiffScalar return *this; } + inline const AutoDiffScalar operator-(const Scalar& b) const + { + return AutoDiffScalar(m_value - b, m_derivatives); + } + friend inline const AutoDiffScalar operator-(const Scalar& a, const AutoDiffScalar& b) { return AutoDiffScalar(a - b.value(), b.derivatives());