FixedArray internal struct was not respecting Eigen alignment. Added EIGEN_MAKE_ALIGNED_OPERATOR_NEW to the struct so that the Jet members are aligned. This fixes an eigen assert in autodiff_test reported by multiple Ceres users. Thanks Koichi Akabe & Stephan Kassemeyer Change-Id: Id3574e926deffa57d205dddaa9d08389b5dc33a8
diff --git a/include/ceres/internal/fixed_array.h b/include/ceres/internal/fixed_array.h index 02d3b71..aa1722c 100644 --- a/include/ceres/internal/fixed_array.h +++ b/include/ceres/internal/fixed_array.h
@@ -34,6 +34,7 @@ #include <cstddef> #include <glog/logging.h> +#include "Eigen/Core" #include "ceres/internal/macros.h" #include "ceres/internal/manual_constructor.h" @@ -132,6 +133,7 @@ // of this code will be broken. struct InnerContainer { T element; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; // How many elements should we store inline?