diff --git a/gtsam.h b/gtsam.h index ebd554549..f11526a8f 100644 --- a/gtsam.h +++ b/gtsam.h @@ -156,7 +156,7 @@ virtual class Value { size_t dim() const; }; -#include +#include class LieScalar { // Standard constructors LieScalar(); @@ -185,7 +185,7 @@ class LieScalar { static Vector Logmap(const gtsam::LieScalar& p); }; -#include +#include class LieVector { // Standard constructors LieVector(); @@ -217,7 +217,7 @@ class LieVector { void serialize() const; }; -#include +#include class LieMatrix { // Standard constructors LieMatrix(); diff --git a/gtsam/base/deprecated/LieMatrix_Deprecated.h b/gtsam/base/deprecated/LieMatrix.h similarity index 97% rename from gtsam/base/deprecated/LieMatrix_Deprecated.h rename to gtsam/base/deprecated/LieMatrix.h index 15b4401f2..e26f45511 100644 --- a/gtsam/base/deprecated/LieMatrix_Deprecated.h +++ b/gtsam/base/deprecated/LieMatrix.h @@ -60,8 +60,9 @@ struct LieMatrix : public Matrix { /// @{ /** print @param s optional string naming the object */ - GTSAM_EXPORT void print(const std::string& name="") const; - + GTSAM_EXPORT void print(const std::string& name = "") const { + gtsam::print(matrix(), name); + } /** equality up to tolerance */ inline bool equals(const LieMatrix& expected, double tol=1e-5) const { return gtsam::equal_with_abs_tol(matrix(), expected.matrix(), tol); diff --git a/gtsam/base/deprecated/LieScalar_Deprecated.h b/gtsam/base/deprecated/LieScalar.h similarity index 92% rename from gtsam/base/deprecated/LieScalar_Deprecated.h rename to gtsam/base/deprecated/LieScalar.h index 6ffc76d37..f9c424e95 100644 --- a/gtsam/base/deprecated/LieScalar_Deprecated.h +++ b/gtsam/base/deprecated/LieScalar.h @@ -48,8 +48,10 @@ namespace gtsam { /// @name Testable /// @{ - void print(const std::string& name="") const; - bool equals(const LieScalar& expected, double tol=1e-5) const { + void print(const std::string& name = "") const { + std::cout << name << ": " << d_ << std::endl; + } + bool equals(const LieScalar& expected, double tol = 1e-5) const { return fabs(expected.d_ - d_) <= tol; } /// @} diff --git a/gtsam/base/deprecated/LieVector_Deprecated.h b/gtsam/base/deprecated/LieVector.h similarity index 92% rename from gtsam/base/deprecated/LieVector_Deprecated.h rename to gtsam/base/deprecated/LieVector.h index 67c42c748..4a85036e0 100644 --- a/gtsam/base/deprecated/LieVector_Deprecated.h +++ b/gtsam/base/deprecated/LieVector.h @@ -18,6 +18,7 @@ #pragma once #include +#include namespace gtsam { @@ -50,11 +51,15 @@ struct LieVector : public Vector { LieVector(double d) : Vector((Vector(1) << d).finished()) {} /** constructor with size and initial data, row order ! */ - GTSAM_EXPORT LieVector(size_t m, const double* const data); + GTSAM_EXPORT LieVector(size_t m, const double* const data) : Vector(m) { + for (size_t i = 0; i < m; i++) (*this)(i) = data[i]; + } /// @name Testable /// @{ - GTSAM_EXPORT void print(const std::string& name="") const; + GTSAM_EXPORT void print(const std::string& name="") const { + gtsam::print(vector(), name); + } bool equals(const LieVector& expected, double tol=1e-5) const { return gtsam::equal(vector(), expected.vector(), tol); } diff --git a/gtsam/base/tests/testLieMatrix.cpp b/gtsam/base/tests/testLieMatrix.cpp index 9c39e5342..5e18e1495 100644 --- a/gtsam/base/tests/testLieMatrix.cpp +++ b/gtsam/base/tests/testLieMatrix.cpp @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include diff --git a/gtsam/base/tests/testLieScalar.cpp b/gtsam/base/tests/testLieScalar.cpp index 121a7949b..bacb9dd1e 100644 --- a/gtsam/base/tests/testLieScalar.cpp +++ b/gtsam/base/tests/testLieScalar.cpp @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include diff --git a/gtsam/base/tests/testLieVector.cpp b/gtsam/base/tests/testLieVector.cpp index 3980fef52..3c2885c18 100644 --- a/gtsam/base/tests/testLieVector.cpp +++ b/gtsam/base/tests/testLieVector.cpp @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include diff --git a/gtsam/base/tests/testTestableAssertions.cpp b/gtsam/base/tests/testTestableAssertions.cpp index 4dbc7eb5c..305aa7ca9 100644 --- a/gtsam/base/tests/testTestableAssertions.cpp +++ b/gtsam/base/tests/testTestableAssertions.cpp @@ -15,7 +15,7 @@ */ #include -#include +#include #include using namespace gtsam; diff --git a/gtsam_unstable/gtsam_unstable.h b/gtsam_unstable/gtsam_unstable.h index 6b57bfcd0..814f3c5a2 100644 --- a/gtsam_unstable/gtsam_unstable.h +++ b/gtsam_unstable/gtsam_unstable.h @@ -452,7 +452,7 @@ virtual class DGroundConstraint : gtsam::NonlinearFactor { DGroundConstraint(size_t key, Vector constraint, const gtsam::noiseModel::Base* model); }; -#include +#include #include virtual class VelocityConstraint3 : gtsam::NonlinearFactor { diff --git a/gtsam_unstable/slam/tests/testGaussMarkov1stOrderFactor.cpp b/gtsam_unstable/slam/tests/testGaussMarkov1stOrderFactor.cpp index c83ce1c60..209326672 100644 --- a/gtsam_unstable/slam/tests/testGaussMarkov1stOrderFactor.cpp +++ b/gtsam_unstable/slam/tests/testGaussMarkov1stOrderFactor.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include using namespace std; using namespace gtsam; diff --git a/tests/testGaussianISAM2.cpp b/tests/testGaussianISAM2.cpp index 613dd9d27..38b5057a6 100644 --- a/tests/testGaussianISAM2.cpp +++ b/tests/testGaussianISAM2.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include using namespace boost::assign; #include namespace br { using namespace boost::adaptors; using namespace boost::range; }