diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 44467989d..855e83c49 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -180,12 +180,12 @@ class AutoDiffScalar template inline bool operator==(const AutoDiffScalar& b) const { return m_value == b.value(); } template inline bool operator!=(const AutoDiffScalar& b) const { return m_value != b.value(); } - inline const AutoDiffScalar operator+(const Scalar& other) const + inline AutoDiffScalar operator+(const Scalar& other) const { return AutoDiffScalar(m_value + other, m_derivatives); } - friend inline const AutoDiffScalar operator+(const Scalar& a, const AutoDiffScalar& b) + friend inline AutoDiffScalar operator+(const Scalar& a, const AutoDiffScalar& b) { return AutoDiffScalar(a + b.value(), b.derivatives()); } @@ -207,7 +207,7 @@ class AutoDiffScalar } template - inline const AutoDiffScalar,const DerType,const typename internal::remove_all::type> > + inline AutoDiffScalar,const DerType,const typename internal::remove_all::type> > operator+(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); @@ -224,12 +224,12 @@ class AutoDiffScalar return *this; } - inline const AutoDiffScalar operator-(const Scalar& b) const + inline AutoDiffScalar operator-(const Scalar& b) const { return AutoDiffScalar(m_value - b, m_derivatives); } - friend inline const AutoDiffScalar, const DerType> > + friend inline AutoDiffScalar, const DerType> > operator-(const Scalar& a, const AutoDiffScalar& b) { return AutoDiffScalar, const DerType> > @@ -243,7 +243,7 @@ class AutoDiffScalar } template - inline const AutoDiffScalar, const DerType,const typename internal::remove_all::type> > + inline AutoDiffScalar, const DerType,const typename internal::remove_all::type> > operator-(const AutoDiffScalar& other) const { internal::make_coherent(m_derivatives, other.derivatives()); @@ -260,7 +260,7 @@ class AutoDiffScalar return *this; } - inline const AutoDiffScalar, const DerType> > + inline AutoDiffScalar, const DerType> > operator-() const { return AutoDiffScalar, const DerType> >( @@ -268,13 +268,13 @@ class AutoDiffScalar -m_derivatives); } - inline const AutoDiffScalar + inline AutoDiffScalar operator*(const Scalar& other) const { return MakeAutoDiffScalar(m_value * other, m_derivatives * other); } - friend inline const AutoDiffScalar + friend inline AutoDiffScalar operator*(const Scalar& other, const AutoDiffScalar& a) { return MakeAutoDiffScalar(a.value() * other, a.derivatives() * other); @@ -296,13 +296,13 @@ class AutoDiffScalar // a.derivatives() * other); // } - inline const AutoDiffScalar + inline AutoDiffScalar operator/(const Scalar& other) const { return MakeAutoDiffScalar(m_value / other, (m_derivatives * (Scalar(1)/other))); } - friend inline const AutoDiffScalar + friend inline AutoDiffScalar operator/(const Scalar& other, const AutoDiffScalar& a) { return MakeAutoDiffScalar(other / a.value(), a.derivatives() * (Scalar(-other) / (a.value()*a.value()))); @@ -325,7 +325,7 @@ class AutoDiffScalar // } template - inline const AutoDiffScalar EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType,Scalar,product) EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,Scalar,product) >,Scalar,product) > @@ -339,7 +339,7 @@ class AutoDiffScalar } template - inline const AutoDiffScalar, + inline AutoDiffScalar, const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType,Scalar,product), const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,Scalar,product) > > operator*(const AutoDiffScalar& other) const @@ -407,12 +407,12 @@ struct auto_diff_special_op AutoDiffScalar& derived() { return *static_cast*>(this); } - inline const AutoDiffScalar operator+(const Real& other) const + inline AutoDiffScalar operator+(const Real& other) const { return AutoDiffScalar(derived().value() + other, derived().derivatives()); } - friend inline const AutoDiffScalar operator+(const Real& a, const AutoDiffScalar& b) + friend inline AutoDiffScalar operator+(const Real& a, const AutoDiffScalar& b) { return AutoDiffScalar(a + b.value(), b.derivatives()); } @@ -424,7 +424,7 @@ struct auto_diff_special_op } - inline const AutoDiffScalar >, DerType>::Type > + inline AutoDiffScalar >, DerType>::Type > operator*(const Real& other) const { return AutoDiffScalar >, DerType>::Type >( @@ -432,7 +432,7 @@ struct auto_diff_special_op derived().derivatives() * other); } - friend inline const AutoDiffScalar >, DerType>::Type > + friend inline AutoDiffScalar >, DerType>::Type > operator*(const Real& other, const AutoDiffScalar& a) { return AutoDiffScalar >, DerType>::Type >( @@ -558,7 +558,7 @@ struct ScalarBinaryOpTraits, Bi #define EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(FUNC,CODE) \ template \ - inline const Eigen::AutoDiffScalar< \ + inline Eigen::AutoDiffScalar< \ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename Eigen::internal::remove_all::type, typename Eigen::internal::traits::type>::Scalar, product) > \ FUNC(const Eigen::AutoDiffScalar& x) { \ using namespace Eigen; \ @@ -641,7 +641,7 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(log, return Eigen::MakeAutoDiffScalar(log(x.value()),x.derivatives() * (Scalar(1)/x.value()));) template -inline const Eigen::AutoDiffScalar< +inline Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::type,typename internal::traits::type>::Scalar,product) > pow(const Eigen::AutoDiffScalar &x, const typename internal::traits::type>::Scalar &y) { @@ -652,7 +652,7 @@ pow(const Eigen::AutoDiffScalar &x, const typename internal::traits -inline const AutoDiffScalar::type>::Scalar,Dynamic,1> > +inline AutoDiffScalar::type>::Scalar,Dynamic,1> > atan2(const AutoDiffScalar& a, const AutoDiffScalar& b) { using std::atan2;