mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Require Eigen >= 3.3 to define ScalarBinaryOpTraits in Jet.
- ScalarBinaryOpTraits was introduced in Eigen 3.3, and thus breaks compilation of Ceres for Eigen versions < 3.3. - Reported as issue #252 by AustinDeric: https://github.com/ceres-solver/ceres-solver/issues/252 Change-Id: Ie9b7dace17709c348b18b297f2d5306b054ce4b0
This commit is contained in:
+4
-1
@@ -878,11 +878,13 @@ struct NumTraits<ceres::Jet<T, N> > {
|
||||
};
|
||||
};
|
||||
|
||||
#if EIGEN_VERSION_AT_LEAST(3, 3, 0)
|
||||
// Specifying the return type of binary operations between Jets and scalar types
|
||||
// allows you to perform matrix/array operations with Eigen matrices and arrays
|
||||
// such as addition, subtraction, multiplication, and division where one Eigen
|
||||
// matrix/array is of type Jet and the other is a scalar type. This improves
|
||||
// performance by using the optimized scalar-to-Jet binary operations.
|
||||
// performance by using the optimized scalar-to-Jet binary operations but
|
||||
// is only available on Eigen versions >= 3.3
|
||||
template <typename BinaryOp, typename T, int N>
|
||||
struct ScalarBinaryOpTraits<ceres::Jet<T, N>, T, BinaryOp> {
|
||||
typedef ceres::Jet<T, N> ReturnType;
|
||||
@@ -891,6 +893,7 @@ template <typename BinaryOp, typename T, int N>
|
||||
struct ScalarBinaryOpTraits<T, ceres::Jet<T, N>, BinaryOp> {
|
||||
typedef ceres::Jet<T, N> ReturnType;
|
||||
};
|
||||
#endif // EIGEN_VERSION_AT_LEAST(3, 3, 0)
|
||||
|
||||
} // namespace Eigen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user