diff --git a/.cproject b/.cproject
index 9726fec60..7c8190e6a 100644
--- a/.cproject
+++ b/.cproject
@@ -532,14 +532,6 @@
true
true
-
- make
- -j4
- testSimilarity3.run
- true
- true
- true
-
make
-j2
@@ -755,6 +747,14 @@
true
true
+
+ make
+ -j4
+ testSimilarity3.run
+ true
+ true
+ true
+
make
-j5
@@ -1301,7 +1301,6 @@
make
-
testSimulated2DOriented.run
true
false
@@ -1341,7 +1340,6 @@
make
-
testSimulated2D.run
true
false
@@ -1349,7 +1347,6 @@
make
-
testSimulated3D.run
true
false
@@ -1453,6 +1450,7 @@
make
+
testErrors.run
true
false
@@ -1763,6 +1761,7 @@
cpack
+
-G DEB
true
false
@@ -1770,6 +1769,7 @@
cpack
+
-G RPM
true
false
@@ -1777,6 +1777,7 @@
cpack
+
-G TGZ
true
false
@@ -1784,6 +1785,7 @@
cpack
+
--config CPackSourceConfig.cmake
true
false
@@ -1975,7 +1977,6 @@
make
-
tests/testGaussianISAM2
true
false
@@ -2037,22 +2038,6 @@
true
true
-
- make
- -j5
- testExpressionMeta.run
- true
- true
- true
-
-
- make
- -j4
- testCustomChartExpression.run
- true
- true
- true
-
make
-j5
@@ -2127,6 +2112,7 @@
make
+
tests/testBayesTree.run
true
false
@@ -2134,6 +2120,7 @@
make
+
testBinaryBayesNet.run
true
false
@@ -2181,6 +2168,7 @@
make
+
testSymbolicBayesNet.run
true
false
@@ -2188,6 +2176,7 @@
make
+
tests/testSymbolicFactor.run
true
false
@@ -2195,6 +2184,7 @@
make
+
testSymbolicFactorGraph.run
true
false
@@ -2210,6 +2200,7 @@
make
+
tests/testBayesTree
true
false
@@ -2783,6 +2774,14 @@
true
true
+
+ make
+ -j4
+ testExecutionTrace.run
+ true
+ true
+ true
+
make
-j5
@@ -3329,6 +3328,7 @@
make
+
testGraph.run
true
false
@@ -3336,6 +3336,7 @@
make
+
testJunctionTree.run
true
false
@@ -3343,6 +3344,7 @@
make
+
testSymbolicBayesNetB.run
true
false
diff --git a/examples/SolverComparer.cpp b/examples/SolverComparer.cpp
index 923b0b9de..0393affe1 100644
--- a/examples/SolverComparer.cpp
+++ b/examples/SolverComparer.cpp
@@ -31,28 +31,29 @@
*
*/
-#include
-#include
-#include
-#include
-#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
-#include
-#include
-#include
#include
-#include
+#include
#include
#include
#include
+#include
+
+#include
+#include
#ifdef GTSAM_USE_TBB
#include
@@ -72,23 +73,6 @@ typedef NoiseModelFactor1 NM1;
typedef NoiseModelFactor2 NM2;
typedef BearingRangeFactor BR;
-//GTSAM_VALUE_EXPORT(Value);
-//GTSAM_VALUE_EXPORT(Pose);
-//GTSAM_VALUE_EXPORT(Rot2);
-//GTSAM_VALUE_EXPORT(Point2);
-//GTSAM_VALUE_EXPORT(NonlinearFactor);
-//GTSAM_VALUE_EXPORT(NoiseModelFactor);
-//GTSAM_VALUE_EXPORT(NM1);
-//GTSAM_VALUE_EXPORT(NM2);
-//GTSAM_VALUE_EXPORT(BetweenFactor);
-//GTSAM_VALUE_EXPORT(PriorFactor);
-//GTSAM_VALUE_EXPORT(BR);
-//GTSAM_VALUE_EXPORT(noiseModel::Base);
-//GTSAM_VALUE_EXPORT(noiseModel::Isotropic);
-//GTSAM_VALUE_EXPORT(noiseModel::Gaussian);
-//GTSAM_VALUE_EXPORT(noiseModel::Diagonal);
-//GTSAM_VALUE_EXPORT(noiseModel::Unit);
-
double chi2_red(const gtsam::NonlinearFactorGraph& graph, const gtsam::Values& config) {
// Compute degrees of freedom (observations - variables)
// In ocaml, +1 was added to the observations to account for the prior, but
@@ -269,12 +253,12 @@ void runIncremental()
boost::dynamic_pointer_cast >(datasetMeasurements[nextMeasurement]))
{
Key key1 = measurement->key1(), key2 = measurement->key2();
- if((key1 >= firstStep && key1 < key2) || (key2 >= firstStep && key2 < key1)) {
+ if(((int)key1 >= firstStep && key1 < key2) || ((int)key2 >= firstStep && key2 < key1)) {
// We found an odometry starting at firstStep
firstPose = std::min(key1, key2);
break;
}
- if((key2 >= firstStep && key1 < key2) || (key1 >= firstStep && key2 < key1)) {
+ if(((int)key2 >= firstStep && key1 < key2) || ((int)key1 >= firstStep && key2 < key1)) {
// We found an odometry joining firstStep with a previous pose
havePreviousPose = true;
firstPose = std::max(key1, key2);
@@ -303,7 +287,9 @@ void runIncremental()
cout << "Playing forward time steps..." << endl;
- for(size_t step = firstPose; nextMeasurement < datasetMeasurements.size() && (lastStep == -1 || step <= lastStep); ++step)
+ for (size_t step = firstPose;
+ nextMeasurement < datasetMeasurements.size() && (lastStep == -1 || (int)step <= lastStep);
+ ++step)
{
Values newVariables;
NonlinearFactorGraph newFactors;
diff --git a/gtsam/3rdparty/ceres/eigen.h b/gtsam/3rdparty/ceres/eigen.h
index 18a602cf4..a25fde97f 100644
--- a/gtsam/3rdparty/ceres/eigen.h
+++ b/gtsam/3rdparty/ceres/eigen.h
@@ -31,7 +31,7 @@
#ifndef CERES_INTERNAL_EIGEN_H_
#define CERES_INTERNAL_EIGEN_H_
-#include
+#include
namespace ceres {
diff --git a/gtsam/3rdparty/ceres/fixed_array.h b/gtsam/3rdparty/ceres/fixed_array.h
index db1591636..455fce383 100644
--- a/gtsam/3rdparty/ceres/fixed_array.h
+++ b/gtsam/3rdparty/ceres/fixed_array.h
@@ -33,7 +33,7 @@
#define CERES_PUBLIC_INTERNAL_FIXED_ARRAY_H_
#include
-#include
+#include
#include
#include
diff --git a/gtsam/3rdparty/ceres/jet.h b/gtsam/3rdparty/ceres/jet.h
index 12d4e8bc9..4a7683f50 100644
--- a/gtsam/3rdparty/ceres/jet.h
+++ b/gtsam/3rdparty/ceres/jet.h
@@ -162,7 +162,7 @@
#include
#include
-#include
+#include
#include
namespace ceres {
diff --git a/gtsam/base/OptionalJacobian.h b/gtsam/base/OptionalJacobian.h
index a83333caa..7055a287a 100644
--- a/gtsam/base/OptionalJacobian.h
+++ b/gtsam/base/OptionalJacobian.h
@@ -168,5 +168,20 @@ public:
Jacobian* operator->(){ return pointer_; }
};
+// forward declare
+template struct traits;
+
+/**
+ * @brief: meta-function to generate JacobianTA optional reference
+ * Used mainly by Expressions
+ * @param T return type
+ * @param A argument type
+ */
+template
+struct MakeOptionalJacobian {
+ typedef OptionalJacobian::dimension,
+ traits::dimension> type;
+};
+
} // namespace gtsam
diff --git a/gtsam/base/tests/testTreeTraversal.cpp b/gtsam/base/tests/testTreeTraversal.cpp
index c9083f781..8fe5e53ef 100644
--- a/gtsam/base/tests/testTreeTraversal.cpp
+++ b/gtsam/base/tests/testTreeTraversal.cpp
@@ -45,11 +45,11 @@ struct TestForest {
};
TestForest makeTestForest() {
- // 0 1
- // / \
- // 2 3
- // |
- // 4
+ // 0 1
+ // / |
+ // 2 3
+ // |
+ // 4
TestForest forest;
forest.roots_.push_back(boost::make_shared(0));
forest.roots_.push_back(boost::make_shared(1));
diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h
index cd56780e5..c1648888e 100644
--- a/gtsam/discrete/DecisionTree-inl.h
+++ b/gtsam/discrete/DecisionTree-inl.h
@@ -467,7 +467,7 @@ namespace gtsam {
// find highest label among branches
boost::optional highestLabel;
- boost::optional nrChoices;
+ size_t nrChoices = 0;
for (Iterator it = begin; it != end; it++) {
if (it->root_->isLeaf())
continue;
@@ -475,22 +475,21 @@ namespace gtsam {
boost::dynamic_pointer_cast(it->root_);
if (!highestLabel || c->label() > *highestLabel) {
highestLabel.reset(c->label());
- nrChoices.reset(c->nrChoices());
+ nrChoices = c->nrChoices();
}
}
// if label is already in correct order, just put together a choice on label
- if (!highestLabel || !nrChoices || label > *highestLabel) {
+ if (!nrChoices || !highestLabel || label > *highestLabel) {
boost::shared_ptr choiceOnLabel(new Choice(label, end - begin));
for (Iterator it = begin; it != end; it++)
choiceOnLabel->push_back(it->root_);
return Choice::Unique(choiceOnLabel);
} else {
// Set up a new choice on the highest label
- boost::shared_ptr choiceOnHighestLabel(
- new Choice(*highestLabel, *nrChoices));
+ boost::shared_ptr choiceOnHighestLabel(new Choice(*highestLabel, nrChoices));
// now, for all possible values of highestLabel
- for (size_t index = 0; index < *nrChoices; index++) {
+ for (size_t index = 0; index < nrChoices; index++) {
// make a new set of functions for composing by iterating over the given
// functions, and selecting the appropriate branch.
std::vector functions;
diff --git a/gtsam/linear/NoiseModel.cpp b/gtsam/linear/NoiseModel.cpp
index 2031a4b73..db69c9006 100644
--- a/gtsam/linear/NoiseModel.cpp
+++ b/gtsam/linear/NoiseModel.cpp
@@ -293,7 +293,7 @@ namespace internal {
// switch precisions and invsigmas to finite value
// TODO: why?? And, why not just ask s==0.0 below ?
static void fix(const Vector& sigmas, Vector& precisions, Vector& invsigmas) {
- for (size_t i = 0; i < sigmas.size(); ++i)
+ for (Vector::Index i = 0; i < sigmas.size(); ++i)
if (!std::isfinite(1. / sigmas[i])) {
precisions[i] = 0.0;
invsigmas[i] = 0.0;
diff --git a/gtsam/nonlinear/Expression-inl.h b/gtsam/nonlinear/Expression-inl.h
index a86e7312a..6c6c155c7 100644
--- a/gtsam/nonlinear/Expression-inl.h
+++ b/gtsam/nonlinear/Expression-inl.h
@@ -19,773 +19,244 @@
#pragma once
-#include
-#include
-#include
+#include
-#include
#include
-#include
-#include
-
-// template meta-programming headers
-#include
-namespace MPL = boost::mpl::placeholders;
-
-#include // operator typeid
-#include