revert the Eigen's bug as we can't touch Eigen. Fix our code to play nice with the bug by avoiding cross product.

release/4.3a0
Duy-Nguyen Ta 2015-09-18 23:35:51 -04:00
parent a4dc589716
commit 435e042aa0
2 changed files with 6 additions and 6 deletions

View File

@ -257,7 +257,7 @@ template<typename Lhs, typename Rhs>
class GeneralProduct<Lhs, Rhs, OuterProduct>
: public ProductBase<GeneralProduct<Lhs,Rhs,OuterProduct>, Lhs, Rhs>
{
template<typename T> struct IsRowMajorType : internal::conditional<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type>::type {};
template<typename T> struct IsRowMajor : internal::conditional<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type>::type {};
public:
EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct)
@ -281,22 +281,22 @@ class GeneralProduct<Lhs, Rhs, OuterProduct>
template<typename Dest>
inline void evalTo(Dest& dest) const {
internal::outer_product_selector_run(*this, dest, set(), IsRowMajorType<Dest>());
internal::outer_product_selector_run(*this, dest, set(), IsRowMajor<Dest>());
}
template<typename Dest>
inline void addTo(Dest& dest) const {
internal::outer_product_selector_run(*this, dest, add(), IsRowMajorType<Dest>());
internal::outer_product_selector_run(*this, dest, add(), IsRowMajor<Dest>());
}
template<typename Dest>
inline void subTo(Dest& dest) const {
internal::outer_product_selector_run(*this, dest, sub(), IsRowMajorType<Dest>());
internal::outer_product_selector_run(*this, dest, sub(), IsRowMajor<Dest>());
}
template<typename Dest> void scaleAndAddTo(Dest& dest, const Scalar& alpha) const
{
internal::outer_product_selector_run(*this, dest, adds(alpha), IsRowMajorType<Dest>());
internal::outer_product_selector_run(*this, dest, adds(alpha), IsRowMajor<Dest>());
}
};

View File

@ -156,7 +156,7 @@ bool MonteCarlo(const PreintegratedImuMeasurements& pim,
for (size_t i = 0; i < N; i++) {
Vector9 xi = samples.col(i);
xi -= sampleMean;
Q += xi * xi.transpose() / (N - 1);
Q += xi * (xi.transpose() / (N - 1));
}
// Compare MonteCarlo value with actual (computed) value