Add EIGEN_STRONG_INLINE annotation to jet.h This improves performance when using MSVC on Windows. On GCC there will be no effect. Change-Id: I555a81ff6823c2855d64773073f75af50c48d716
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 81f96c7..74ce1e9 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -159,6 +159,7 @@ #include <cmath> #include <iosfwd> #include <iostream> // NOLINT +#include <limits> #include <string> #include "Eigen/Core" @@ -197,10 +198,8 @@ // to be passed in without being fully evaluated until // they are assigned to v template<typename Derived> - Jet(const T& value, const Eigen::DenseBase<Derived> &vIn) - : a(value), - v(vIn) - { + EIGEN_STRONG_INLINE Jet(const T& a, const Eigen::DenseBase<Derived> &v) + : a(a), v(v) { } // Compound operators @@ -649,7 +648,9 @@ return ceres::Jet<T, N>(1e-12); } - static inline Real epsilon() { return Real(std::numeric_limits<T>::epsilon()); } + static inline Real epsilon() { + return Real(std::numeric_limits<T>::epsilon()); + } enum { IsComplex = 0,