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() | ||||
| 
 | ||||
| 
 | ||||
| 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_package(TBB) | ||||
|  |  | |||
|  | @ -16,8 +16,9 @@ | |||
|  */ | ||||
| 
 | ||||
| #pragma once | ||||
| #include <boost/make_shared.hpp> | ||||
| 
 | ||||
| #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
 | ||||
|  |  | |||
|  | @ -19,9 +19,9 @@ | |||
| 
 | ||||
| #include <cstdarg> | ||||
| 
 | ||||
| #include <gtsam/base/DerivedValue.h> | ||||
| #include <gtsam/base/Lie.h> | ||||
| #include <gtsam/base/Matrix.h> | ||||
| #include <gtsam/base/DerivedValue.h> | ||||
| #include <boost/serialization/nvp.hpp> | ||||
| 
 | ||||
| namespace gtsam { | ||||
|  | @ -40,9 +40,12 @@ struct LieMatrix : public Matrix, public DerivedValue<LieMatrix> { | |||
|   /** initialize from a normal matrix */ | ||||
|   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 */ | ||||
|   template<int M, int N> | ||||
|   LieMatrix(const Eigen::Matrix<double, M, N>& v) : Matrix(v) {} | ||||
| #endif | ||||
| 
 | ||||
|   /** constructor with size and initial data, row order ! */ | ||||
|   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 { | ||||
|     if(v.size() != this->size()) | ||||
|       throw std::invalid_argument("LieMatrix::retract called with Vector of incorrect size"); | ||||
| 
 | ||||
|     return LieMatrix(*this + | ||||
|       Eigen::Map<const Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> >( | ||||
|       &v(0), this->rows(), this->cols())); | ||||
|  |  | |||
|  | @ -33,10 +33,13 @@ struct LieVector : public Vector, public DerivedValue<LieVector> { | |||
| 
 | ||||
|   /** initialize from a normal vector */ | ||||
|   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 */ | ||||
|   template<int N> | ||||
|   LieVector(const Eigen::Matrix<double, N, 1>& v) : Vector(v) {} | ||||
| #endif | ||||
| 
 | ||||
|   /** wrap a double */ | ||||
|   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
 | ||||
| /// Eigen do more optimization
 | ||||
| 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; | ||||
|   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); | ||||
|   } else if(mode == Rot3::SLOW_CAYLEY) { | ||||
|     Matrix Omega = skewSymmetric(omega); | ||||
|     return (*this)*Cayley<3>(-Omega/2); | ||||
|     return (*this)*CayleyFixed<3>(-Omega/2); | ||||
|   } else { | ||||
|     assert(false); | ||||
|     exit(1); | ||||
|  | @ -269,7 +269,7 @@ Vector3 Rot3::localCoordinates(const Rot3& T, Rot3::CoordinatesMode mode) const | |||
|     // Create a fixed-size matrix
 | ||||
|     Eigen::Matrix3d A(between(T).matrix()); | ||||
|     // 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)); | ||||
|   } else { | ||||
|     assert(false); | ||||
|  |  | |||
|  | @ -117,7 +117,7 @@ public: | |||
| 
 | ||||
|   // 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 | ||||
|  |  | |||
|  | @ -251,7 +251,7 @@ TEST( BayesTree, shortcutCheck ) | |||
|   // Check if all the cached shortcuts are cleared
 | ||||
|   rootClique->deleteCachedShortcuts(); | ||||
|   BOOST_FOREACH(SymbolicBayesTree::sharedClique& clique, allCliques) { | ||||
|     bool notCleared = clique->cachedSeparatorMarginal(); | ||||
|     bool notCleared = clique->cachedSeparatorMarginal().is_initialized(); | ||||
|     CHECK( notCleared == false); | ||||
|   } | ||||
|   EXPECT_LONGS_EQUAL(0, (long)rootClique->numCachedSeparatorMarginals()); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue