Correcting bug fixes for Visual Studio. See bb issues #115,116,118 for more information
parent
aacd3484c7
commit
5bc4810dcb
|
@ -123,6 +123,11 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(${Boost_VERSION} EQUAL 105600)
|
||||||
|
message("Ignoring Boost restriction on optional lvalue assignment from rvalues")
|
||||||
|
add_definitions(-DBOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES)
|
||||||
|
endif()
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Find TBB
|
# Find TBB
|
||||||
find_package(TBB)
|
find_package(TBB)
|
||||||
|
|
|
@ -16,8 +16,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <boost/make_shared.hpp>
|
|
||||||
#include <gtsam/base/Value.h>
|
#include <gtsam/base/Value.h>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
// The following includes windows.h in some MSVC versions, so we undef min, max, and ERROR
|
// The following includes windows.h in some MSVC versions, so we undef min, max, and ERROR
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
|
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
|
|
||||||
|
#include <gtsam/base/DerivedValue.h>
|
||||||
#include <gtsam/base/Lie.h>
|
#include <gtsam/base/Lie.h>
|
||||||
#include <gtsam/base/Matrix.h>
|
#include <gtsam/base/Matrix.h>
|
||||||
#include <gtsam/base/DerivedValue.h>
|
|
||||||
#include <boost/serialization/nvp.hpp>
|
#include <boost/serialization/nvp.hpp>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
@ -40,9 +40,12 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
|
||||||
/** initialize from a normal matrix */
|
/** initialize from a normal matrix */
|
||||||
LieMatrix(const Matrix& v) : Matrix(v) {}
|
LieMatrix(const Matrix& v) : Matrix(v) {}
|
||||||
|
|
||||||
|
// Currently TMP constructor causes ICE on MSVS 2013
|
||||||
|
#if (_MSC_VER < 1800)
|
||||||
/** initialize from a fixed size normal vector */
|
/** initialize from a fixed size normal vector */
|
||||||
template<int M, int N>
|
template<int M, int N>
|
||||||
LieMatrix(const Eigen::Matrix<double, M, N>& v) : Matrix(v) {}
|
LieMatrix(const Eigen::Matrix<double, M, N>& v) : Matrix(v) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** constructor with size and initial data, row order ! */
|
/** constructor with size and initial data, row order ! */
|
||||||
LieMatrix(size_t m, size_t n, const double* const data) :
|
LieMatrix(size_t m, size_t n, const double* const data) :
|
||||||
|
@ -82,6 +85,7 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> {
|
||||||
inline LieMatrix retract(const Vector& v) const {
|
inline LieMatrix retract(const Vector& v) const {
|
||||||
if(v.size() != this->size())
|
if(v.size() != this->size())
|
||||||
throw std::invalid_argument("LieMatrix::retract called with Vector of incorrect size");
|
throw std::invalid_argument("LieMatrix::retract called with Vector of incorrect size");
|
||||||
|
|
||||||
return LieMatrix(*this +
|
return LieMatrix(*this +
|
||||||
Eigen::Map<const Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> >(
|
Eigen::Map<const Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> >(
|
||||||
&v(0), this->rows(), this->cols()));
|
&v(0), this->rows(), this->cols()));
|
||||||
|
|
|
@ -33,10 +33,13 @@ struct LieVector : public Vector, public DerivedValue<LieVector> {
|
||||||
|
|
||||||
/** initialize from a normal vector */
|
/** initialize from a normal vector */
|
||||||
LieVector(const Vector& v) : Vector(v) {}
|
LieVector(const Vector& v) : Vector(v) {}
|
||||||
|
|
||||||
|
// Currently TMP constructor causes ICE on MSVS 2013
|
||||||
|
#if (_MSC_VER < 1800)
|
||||||
/** initialize from a fixed size normal vector */
|
/** initialize from a fixed size normal vector */
|
||||||
template<int N>
|
template<int N>
|
||||||
LieVector(const Eigen::Matrix<double, N, 1>& v) : Vector(v) {}
|
LieVector(const Eigen::Matrix<double, N, 1>& v) : Vector(v) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** wrap a double */
|
/** wrap a double */
|
||||||
LieVector(double d) : Vector((Vector(1) << d)) {}
|
LieVector(double d) : Vector((Vector(1) << d)) {}
|
||||||
|
|
|
@ -467,7 +467,7 @@ GTSAM_EXPORT Matrix Cayley(const Matrix& A);
|
||||||
/// Implementation of Cayley transform using fixed size matrices to let
|
/// Implementation of Cayley transform using fixed size matrices to let
|
||||||
/// Eigen do more optimization
|
/// Eigen do more optimization
|
||||||
template<int N>
|
template<int N>
|
||||||
Eigen::Matrix<double, N, N> Cayley(const Eigen::Matrix<double, N, N>& A) {
|
Eigen::Matrix<double, N, N> CayleyFixed(const Eigen::Matrix<double, N, N>& A) {
|
||||||
typedef Eigen::Matrix<double, N, N> FMat;
|
typedef Eigen::Matrix<double, N, N> FMat;
|
||||||
return (FMat::Identity() - A)*(FMat::Identity() + A).inverse();
|
return (FMat::Identity() - A)*(FMat::Identity() + A).inverse();
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ Rot3 Rot3::retract(const Vector& omega, Rot3::CoordinatesMode mode) const {
|
||||||
return retractCayley(omega);
|
return retractCayley(omega);
|
||||||
} else if(mode == Rot3::SLOW_CAYLEY) {
|
} else if(mode == Rot3::SLOW_CAYLEY) {
|
||||||
Matrix Omega = skewSymmetric(omega);
|
Matrix Omega = skewSymmetric(omega);
|
||||||
return (*this)*Cayley<3>(-Omega/2);
|
return (*this)*CayleyFixed<3>(-Omega/2);
|
||||||
} else {
|
} else {
|
||||||
assert(false);
|
assert(false);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -269,7 +269,7 @@ Vector3 Rot3::localCoordinates(const Rot3& T, Rot3::CoordinatesMode mode) const
|
||||||
// Create a fixed-size matrix
|
// Create a fixed-size matrix
|
||||||
Eigen::Matrix3d A(between(T).matrix());
|
Eigen::Matrix3d A(between(T).matrix());
|
||||||
// using templated version of Cayley
|
// using templated version of Cayley
|
||||||
Eigen::Matrix3d Omega = Cayley<3>(A);
|
Eigen::Matrix3d Omega = CayleyFixed<3>(A);
|
||||||
return -2*Vector3(Omega(2,1),Omega(0,2),Omega(1,0));
|
return -2*Vector3(Omega(2,1),Omega(0,2),Omega(1,0));
|
||||||
} else {
|
} else {
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
|
|
||||||
// casting syntactic sugar
|
// casting syntactic sugar
|
||||||
|
|
||||||
inline bool hasLinearizationPoint() const { return linearizationPoint_; }
|
inline bool hasLinearizationPoint() const { return linearizationPoint_.is_initialized(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple checks whether this is a Jacobian or Hessian factor
|
* Simple checks whether this is a Jacobian or Hessian factor
|
||||||
|
|
|
@ -251,7 +251,7 @@ TEST( BayesTree, shortcutCheck )
|
||||||
// Check if all the cached shortcuts are cleared
|
// Check if all the cached shortcuts are cleared
|
||||||
rootClique->deleteCachedShortcuts();
|
rootClique->deleteCachedShortcuts();
|
||||||
BOOST_FOREACH(SymbolicBayesTree::sharedClique& clique, allCliques) {
|
BOOST_FOREACH(SymbolicBayesTree::sharedClique& clique, allCliques) {
|
||||||
bool notCleared = clique->cachedSeparatorMarginal();
|
bool notCleared = clique->cachedSeparatorMarginal().is_initialized();
|
||||||
CHECK( notCleared == false);
|
CHECK( notCleared == false);
|
||||||
}
|
}
|
||||||
EXPECT_LONGS_EQUAL(0, (long)rootClique->numCachedSeparatorMarginals());
|
EXPECT_LONGS_EQUAL(0, (long)rootClique->numCachedSeparatorMarginals());
|
||||||
|
|
Loading…
Reference in New Issue