From 44044e25b14d7e623baae4505a17c913bdde59f8 Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Wed, 31 Aug 2016 05:50:58 -0700 Subject: [PATCH] Update the NumTraits for Jets 1. Use AVX if EIGEN_VECTORIZE_AVX is defined. 2. Make the cost of division same as the cost of multiplication. These are updates to the original numtraits update needed for eigen 3.3 that Shaheen Gandhi sent out. Change-Id: Ic1e3ed7d05a659c7badc79a894679b2dd61c51b9 --- include/ceres/jet.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 5b6c0ca78..a10470729 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -836,8 +836,15 @@ struct NumTraits > { template struct Div { enum { +#if defined(EIGEN_VECTORIZE_AVX) + AVX = true, +#else AVX = false, - Cost = 1 +#endif + + // Assuming that for Jets, division is as expensive as + // multiplication. + Cost = 3 }; }; };