fixing vc++14 compile issues

release/4.3a0
Jing Dong 2017-05-18 14:46:46 -07:00
parent 6b3608cf9a
commit eb1e75fd27
7 changed files with 18 additions and 20 deletions

View File

@ -29,7 +29,7 @@ namespace gtsam {
* we can directly add double, Vector, and Matrix into values now, because of * we can directly add double, Vector, and Matrix into values now, because of
* gtsam::traits. * gtsam::traits.
*/ */
struct LieMatrix : public Matrix { struct GTSAM_EXPORT LieMatrix : public Matrix {
/// @name Constructors /// @name Constructors
/// @{ /// @{
@ -60,7 +60,7 @@ struct LieMatrix : public Matrix {
/// @{ /// @{
/** print @param s optional string naming the object */ /** print @param s optional string naming the object */
GTSAM_EXPORT void print(const std::string& name = "") const { void print(const std::string& name = "") const {
gtsam::print(matrix(), name); gtsam::print(matrix(), name);
} }
/** equality up to tolerance */ /** equality up to tolerance */

View File

@ -27,7 +27,7 @@ namespace gtsam {
* we can directly add double, Vector, and Matrix into values now, because of * we can directly add double, Vector, and Matrix into values now, because of
* gtsam::traits. * gtsam::traits.
*/ */
struct LieVector : public Vector { struct GTSAM_EXPORT LieVector : public Vector {
enum { dimension = Eigen::Dynamic }; enum { dimension = Eigen::Dynamic };
@ -51,13 +51,13 @@ struct LieVector : public Vector {
LieVector(double d) : Vector((Vector(1) << d).finished()) {} LieVector(double d) : Vector((Vector(1) << d).finished()) {}
/** constructor with size and initial data, row order ! */ /** constructor with size and initial data, row order ! */
GTSAM_EXPORT LieVector(size_t m, const double* const data) : Vector(m) { LieVector(size_t m, const double* const data) : Vector(m) {
for (size_t i = 0; i < m; i++) (*this)(i) = data[i]; for (size_t i = 0; i < m; i++) (*this)(i) = data[i];
} }
/// @name Testable /// @name Testable
/// @{ /// @{
GTSAM_EXPORT void print(const std::string& name="") const { void print(const std::string& name="") const {
gtsam::print(vector(), name); gtsam::print(vector(), name);
} }
bool equals(const LieVector& expected, double tol=1e-5) const { bool equals(const LieVector& expected, double tol=1e-5) const {

View File

@ -27,7 +27,7 @@ namespace gtsam {
* @addtogroup geometry * @addtogroup geometry
* \nosubgrouping * \nosubgrouping
*/ */
class Cal3_S2Stereo { class GTSAM_EXPORT Cal3_S2Stereo {
private: private:
Cal3_S2 K_; Cal3_S2 K_;

View File

@ -152,16 +152,16 @@ struct traits<Point2> : public internal::VectorSpace<Point2> {
#endif // GTSAM_TYPEDEF_POINTS_TO_VECTORS #endif // GTSAM_TYPEDEF_POINTS_TO_VECTORS
/// Distance of the point from the origin, with Jacobian /// Distance of the point from the origin, with Jacobian
double norm2(const Point2& p, OptionalJacobian<1, 2> H = boost::none); GTSAM_EXPORT double norm2(const Point2& p, OptionalJacobian<1, 2> H = boost::none);
/// distance between two points /// distance between two points
double distance2(const Point2& p1, const Point2& q, GTSAM_EXPORT double distance2(const Point2& p1, const Point2& q,
OptionalJacobian<1, 2> H1 = boost::none, OptionalJacobian<1, 2> H1 = boost::none,
OptionalJacobian<1, 2> H2 = boost::none); OptionalJacobian<1, 2> H2 = boost::none);
// Convenience typedef // Convenience typedef
typedef std::pair<Point2, Point2> Point2Pair; typedef std::pair<Point2, Point2> Point2Pair;
std::ostream &operator<<(std::ostream &os, const gtsam::Point2Pair &p); GTSAM_EXPORT std::ostream &operator<<(std::ostream &os, const gtsam::Point2Pair &p);
// For MATLAB wrapper // For MATLAB wrapper
typedef std::vector<Point2> Point2Vector; typedef std::vector<Point2> Point2Vector;
@ -185,7 +185,7 @@ return p * s;
* @param tol: absolute tolerance below which we consider touching circles * @param tol: absolute tolerance below which we consider touching circles
* @return optional Point2 with f and h, boost::none if no solution. * @return optional Point2 with f and h, boost::none if no solution.
*/ */
boost::optional<Point2> circleCircleIntersection(double R_d, double r_d, double tol = 1e-9); GTSAM_EXPORT boost::optional<Point2> circleCircleIntersection(double R_d, double r_d, double tol = 1e-9);
/* /*
* @brief Circle-circle intersection, from the normalized radii solution. * @brief Circle-circle intersection, from the normalized radii solution.
@ -193,7 +193,7 @@ boost::optional<Point2> circleCircleIntersection(double R_d, double r_d, double
* @param c2 center of second circle * @param c2 center of second circle
* @return list of solutions (0,1, or 2). Identical circles will return empty list, as well. * @return list of solutions (0,1, or 2). Identical circles will return empty list, as well.
*/ */
std::list<Point2> circleCircleIntersection(Point2 c1, Point2 c2, boost::optional<Point2> fh); GTSAM_EXPORT std::list<Point2> circleCircleIntersection(Point2 c1, Point2 c2, boost::optional<Point2> fh);
/** /**
* @brief Intersect 2 circles * @brief Intersect 2 circles
@ -204,7 +204,7 @@ std::list<Point2> circleCircleIntersection(Point2 c1, Point2 c2, boost::optional
* @param tol: absolute tolerance below which we consider touching circles * @param tol: absolute tolerance below which we consider touching circles
* @return list of solutions (0,1, or 2). Identical circles will return empty list, as well. * @return list of solutions (0,1, or 2). Identical circles will return empty list, as well.
*/ */
std::list<Point2> circleCircleIntersection(Point2 c1, double r1, GTSAM_EXPORT std::list<Point2> circleCircleIntersection(Point2 c1, double r1,
Point2 c2, double r2, double tol = 1e-9); Point2 c2, double r2, double tol = 1e-9);
} // \ namespace gtsam } // \ namespace gtsam

View File

@ -135,7 +135,7 @@ public:
namespace so3 { namespace so3 {
/// Functor implementing Exponential map /// Functor implementing Exponential map
class ExpmapFunctor { class GTSAM_EXPORT ExpmapFunctor {
protected: protected:
const double theta2; const double theta2;
Matrix3 W, K, KK; Matrix3 W, K, KK;
@ -156,7 +156,7 @@ class ExpmapFunctor {
}; };
/// Functor that implements Exponential map *and* its derivatives /// Functor that implements Exponential map *and* its derivatives
class DexpFunctor : public ExpmapFunctor { class GTSAM_EXPORT DexpFunctor : public ExpmapFunctor {
const Vector3 omega; const Vector3 omega;
double a, b; double a, b;
Matrix3 dexp_; Matrix3 dexp_;

View File

@ -89,7 +89,7 @@ TEST(CameraSet, Pinhole) {
Vector4 b = actualV; Vector4 b = actualV;
Vector v = Ft * (b - E * P * Et * b); Vector v = Ft * (b - E * P * Et * b);
schur << Ft * F - Ft * E * P * Et * F, v, v.transpose(), 30; schur << Ft * F - Ft * E * P * Et * F, v, v.transpose(), 30;
SymmetricBlockMatrix actualReduced = Set::SchurComplement(Fs, E, P, b); SymmetricBlockMatrix actualReduced = Set::SchurComplement<3>(Fs, E, P, b);
EXPECT(assert_equal(schur, actualReduced.selfadjointView())); EXPECT(assert_equal(schur, actualReduced.selfadjointView()));
// Check Schur complement update, same order, should just double // Check Schur complement update, same order, should just double
@ -98,14 +98,14 @@ TEST(CameraSet, Pinhole) {
allKeys.push_back(2); allKeys.push_back(2);
keys.push_back(1); keys.push_back(1);
keys.push_back(2); keys.push_back(2);
Set::UpdateSchurComplement(Fs, E, P, b, allKeys, keys, actualReduced); Set::UpdateSchurComplement<3>(Fs, E, P, b, allKeys, keys, actualReduced);
EXPECT(assert_equal((Matrix )(2.0 * schur), actualReduced.selfadjointView())); EXPECT(assert_equal((Matrix )(2.0 * schur), actualReduced.selfadjointView()));
// Check Schur complement update, keys reversed // Check Schur complement update, keys reversed
FastVector<Key> keys2; FastVector<Key> keys2;
keys2.push_back(2); keys2.push_back(2);
keys2.push_back(1); keys2.push_back(1);
Set::UpdateSchurComplement(Fs, E, P, b, allKeys, keys2, actualReduced); Set::UpdateSchurComplement<3>(Fs, E, P, b, allKeys, keys2, actualReduced);
Vector4 reverse_b; Vector4 reverse_b;
reverse_b << b.tail<2>(), b.head<2>(); reverse_b << b.tail<2>(), b.head<2>();
Vector reverse_v = Ft * (reverse_b - E * P * Et * reverse_b); Vector reverse_v = Ft * (reverse_b - E * P * Et * reverse_b);

View File

@ -120,8 +120,6 @@ TEST(OrientedPlane3, localCoordinates_retract) {
maxXiLimit << M_PI, M_PI, 10.0; maxXiLimit << M_PI, M_PI, 10.0;
for (size_t i = 0; i < numIterations; i++) { for (size_t i = 0; i < numIterations; i++) {
sleep(0);
// Create a Plane // Create a Plane
OrientedPlane3 p1(randomVector(minPlaneLimit, maxPlaneLimit)); OrientedPlane3 p1(randomVector(minPlaneLimit, maxPlaneLimit));
Vector v12 = randomVector(minXiLimit, maxXiLimit); Vector v12 = randomVector(minXiLimit, maxXiLimit);