aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/AutoDiff
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-05-12 23:40:19 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-05-12 23:40:19 +0200
commita34a216e82290eb78e7afe7539976f1650ccbd76 (patch)
treeb4aef24bfa70062c139d89d1ffd2ce8f40c2c4e1 /unsupported/Eigen/src/AutoDiff
parent3de2f4b75af7a8466446383d1a87c10010f889b4 (diff)
AutoDiff: add one missing operator- version
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rw-r--r--unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h5
1 files changed, 5 insertions, 0 deletions
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<DerType&> operator-(const Scalar& b) const
+ {
+ return AutoDiffScalar<DerType&>(m_value - b, m_derivatives);
+ }
+
friend inline const AutoDiffScalar<DerType&> operator-(const Scalar& a, const AutoDiffScalar& b)
{
return AutoDiffScalar<DerType&>(a - b.value(), b.derivatives());