diff --git a/.cproject b/.cproject
index b1aba5b3c..bba3082a5 100644
--- a/.cproject
+++ b/.cproject
@@ -5,15 +5,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -297,415 +297,425 @@
-
-
- make
- install
- true
- true
- true
-
-
- make
- check
- true
- true
- true
-
-
- make
- -k
- check
- true
- false
- true
-
-
- make
- testSimpleCamera.run
- true
- true
- true
-
-
- make
- -f local.mk
- testCal3_S2.run
- true
- true
- true
-
-
- make
-
- testVSLAMFactor.run
- true
- true
- true
-
-
- make
- testCalibratedCamera.run
- true
- true
- true
-
-
- make
-
- testGaussianConditional.run
- true
- true
- true
-
-
- make
- testPose2.run
- true
- true
- true
-
-
- make
- testRot3.run
- true
- true
- true
-
-
- make
-
- testNonlinearOptimizer.run
- true
- true
- true
-
-
- make
- testGaussianFactor.run
- true
- true
- true
-
-
- make
- testGaussianFactorGraph.run
- true
- true
- true
-
-
- make
-
- testNonlinearFactorGraph.run
- true
- true
- true
-
-
- make
- testPose3.run
- true
- true
- true
-
-
- make
-
- testVectorConfig.run
- true
- true
- true
-
-
- make
-
- testPoint2.run
- true
- true
- true
-
-
- make
- testNonlinearFactor.run
- true
- true
- true
-
-
- make
- timeGaussianFactor.run
- true
- true
- true
-
-
- make
- timeGaussianFactorGraph.run
- true
- true
- true
-
-
- make
- testGaussianBayesNet.run
- true
- true
- true
-
-
- make
-
- testBayesTree.run
- true
- false
- true
-
-
- make
- testSymbolicBayesNet.run
- true
- false
- true
-
-
- make
-
- testSymbolicFactorGraph.run
- true
- false
- true
-
-
- make
- testVector.run
- true
- true
- true
-
-
- make
- testMatrix.run
- true
- true
- true
-
-
- make
-
- testVSLAMGraph.run
- true
- true
- true
-
-
- make
-
- testNonlinearEquality.run
- true
- true
- true
-
-
- make
- testSQP.run
- true
- true
- true
-
-
- make
-
- testNonlinearConstraint.run
- true
- true
- true
-
-
- make
- testSQPOptimizer.run
- true
- true
- true
-
-
- make
- testVSLAMConfig.run
- true
- true
- true
-
-
- make
- testControlConfig.run
- true
- true
- true
-
-
- make
- testControlPoint.run
- true
- true
- true
-
-
- make
-
- testControlGraph.run
- true
- true
- true
-
-
- make
- testOrdering.run
- true
- true
- true
-
-
- make
-
- testPose2Constraint.run
- true
- true
- true
-
-
- make
- testRot2.run
- true
- true
- true
-
-
- make
- testGaussianBayesTree.run
- true
- true
- true
-
-
- make
-
- testPose3Factor.run
- true
- true
- true
-
-
- make
-
- testUrbanGraph.run
- true
- true
- true
-
-
- make
-
- testUrbanConfig.run
- true
- true
- true
-
-
- make
-
- testUrbanMeasurement.run
- true
- true
- true
-
-
- make
- testUrbanOdometry.run
- true
- true
- true
-
-
- make
-
- testIterative.run
- true
- true
- true
-
-
- make
-
- testGaussianISAM2.run
- true
- true
- true
-
-
- make
- testSubgraphPreconditioner.run
- true
- true
- true
-
-
- make
- testBayesNetPreconditioner.run
- true
- true
- true
-
-
- make
-
- testPose2Factor.run
- true
- true
- true
-
-
- make
-
- timeRot3.run
- true
- true
- true
-
-
- make
-
- install
- true
- true
- true
-
-
- make
-
- install
- true
- true
- true
-
-
- make
-
- clean
- true
- true
- true
-
-
- make
-
- check
- true
- true
- true
-
-
-
-
+
+
+make
+
+install
+true
+true
+true
+
+
+make
+
+check
+true
+true
+true
+
+
+make
+-k
+check
+true
+false
+true
+
+
+make
+
+testSimpleCamera.run
+true
+true
+true
+
+
+make
+-f local.mk
+testCal3_S2.run
+true
+true
+true
+
+
+make
+testVSLAMFactor.run
+true
+true
+true
+
+
+make
+
+testCalibratedCamera.run
+true
+true
+true
+
+
+make
+testGaussianConditional.run
+true
+true
+true
+
+
+make
+
+testPose2.run
+true
+true
+true
+
+
+make
+
+testRot3.run
+true
+true
+true
+
+
+make
+testNonlinearOptimizer.run
+true
+true
+true
+
+
+make
+
+testGaussianFactor.run
+true
+true
+true
+
+
+make
+
+testGaussianFactorGraph.run
+true
+true
+true
+
+
+make
+testNonlinearFactorGraph.run
+true
+true
+true
+
+
+make
+
+testPose3.run
+true
+true
+true
+
+
+make
+testVectorConfig.run
+true
+true
+true
+
+
+make
+testPoint2.run
+true
+true
+true
+
+
+make
+
+testNonlinearFactor.run
+true
+true
+true
+
+
+make
+
+timeGaussianFactor.run
+true
+true
+true
+
+
+make
+
+timeGaussianFactorGraph.run
+true
+true
+true
+
+
+make
+
+testGaussianBayesNet.run
+true
+true
+true
+
+
+make
+testBayesTree.run
+true
+false
+true
+
+
+make
+
+testSymbolicBayesNet.run
+true
+false
+true
+
+
+make
+testSymbolicFactorGraph.run
+true
+false
+true
+
+
+make
+
+testVector.run
+true
+true
+true
+
+
+make
+
+testMatrix.run
+true
+true
+true
+
+
+make
+testVSLAMGraph.run
+true
+true
+true
+
+
+make
+testNonlinearEquality.run
+true
+true
+true
+
+
+make
+
+testSQP.run
+true
+true
+true
+
+
+make
+testNonlinearConstraint.run
+true
+true
+true
+
+
+make
+
+testSQPOptimizer.run
+true
+true
+true
+
+
+make
+
+testVSLAMConfig.run
+true
+true
+true
+
+
+make
+
+testControlConfig.run
+true
+true
+true
+
+
+make
+
+testControlPoint.run
+true
+true
+true
+
+
+make
+testControlGraph.run
+true
+true
+true
+
+
+make
+
+testOrdering.run
+true
+true
+true
+
+
+make
+testPose2Constraint.run
+true
+true
+true
+
+
+make
+
+testRot2.run
+true
+true
+true
+
+
+make
+
+testGaussianBayesTree.run
+true
+true
+true
+
+
+make
+testPose3Factor.run
+true
+true
+true
+
+
+make
+testUrbanGraph.run
+true
+true
+true
+
+
+make
+testUrbanConfig.run
+true
+true
+true
+
+
+make
+testUrbanMeasurement.run
+true
+true
+true
+
+
+make
+
+testUrbanOdometry.run
+true
+true
+true
+
+
+make
+testIterative.run
+true
+true
+true
+
+
+make
+testGaussianISAM2.run
+true
+true
+true
+
+
+make
+
+testSubgraphPreconditioner.run
+true
+true
+true
+
+
+make
+
+testBayesNetPreconditioner.run
+true
+true
+true
+
+
+make
+testPose2Factor.run
+true
+true
+true
+
+
+make
+timeRot3.run
+true
+true
+true
+
+
+make
+install
+true
+true
+true
+
+
+make
+-j2
+testLieConfig.run
+true
+true
+true
+
+
+make
+install
+true
+true
+true
+
+
+make
+clean
+true
+true
+true
+
+
+make
+check
+true
+true
+true
+
+
+
+
diff --git a/cpp/Lie.h b/cpp/Lie.h
index c6d5cd9d9..965bcf7dc 100644
--- a/cpp/Lie.h
+++ b/cpp/Lie.h
@@ -8,10 +8,8 @@
#ifndef LIE_H_
#define LIE_H_
+#include
#include "Vector.h"
-#include "VectorConfig.h"
-#include "Matrix.h"
-
namespace gtsam {
@@ -61,6 +59,25 @@ namespace gtsam {
Vector logmap(const T& lp) const;
};
+
+ /** Call print on the object */
+ template
+ inline void print_(const T& object, const char *s = "") {
+ object.print(s);
+ }
+
+ /** Call equal on the object */
+ template
+ inline bool equal(const T& obj1, const T& obj2, double tol) {
+ return obj1.equals(obj2, tol);
+ }
+
+ /** Call equal on the object without tolerance (use default tolerance) */
+ template
+ inline bool equal(const T& obj1, const T& obj2) {
+ return obj1.equal(obj2);
+ }
+
}
diff --git a/cpp/LieConfig-inl.h b/cpp/LieConfig-inl.h
new file mode 100644
index 000000000..c4913c77a
--- /dev/null
+++ b/cpp/LieConfig-inl.h
@@ -0,0 +1,68 @@
+/*
+ * LieConfig.cpp
+ *
+ * Created on: Jan 8, 2010
+ * Author: richard
+ */
+
+#include
+#include
+#include "LieConfig.h"
+
+using namespace std;
+
+#define FOREACH_PAIR( KEY, VAL, COL) BOOST_FOREACH (boost::tie(KEY,VAL),COL)
+
+namespace gtsam {
+
+ template
+ void LieConfig::print(const std::string &s) const {
+ std::cout << "LieConfig " << s << ", size " << values_.size() << "\n";
+ std::pair v;
+ BOOST_FOREACH(v, values_)
+ ::gtsam::print(v.second, v.first + ": ");
+ }
+
+ template
+ bool LieConfig::equals(const LieConfig& expected, double tol) const {
+ if (values_.size() != expected.values_.size()) return false;
+ std::pair v;
+ BOOST_FOREACH(v, values_) {
+ boost::optional expval = expected.gettry(v.first);
+ if(!expval || !::gtsam::equal(v.second, *expval, tol))
+ return false;
+ }
+ return true;
+ }
+
+ template
+ LieConfig expmap(const LieConfig& c, const VectorConfig& delta) {
+ LieConfig newConfig;
+ std::string j; T pj;
+ FOREACH_PAIR(j, pj, c.values_) {
+ if (delta.contains(j)) {
+ const Vector& dj = delta[j];
+ //check_size(j,vj,dj);
+ newConfig.insert(j, expmap(pj,dj));
+ } else
+ newConfig.insert(j, pj);
+ }
+ return newConfig;
+ }
+
+ template
+ LieConfig expmap(const LieConfig& c, const Vector& delta) {
+ LieConfig newConfig;
+ std::pair value;
+ int delta_offset = 0;
+ BOOST_FOREACH(value, c) {
+ int cur_dim = dim(value.second);
+ newConfig.insert(value.first,
+ expmap(value.second,
+ sub(delta, delta_offset, delta_offset+cur_dim)));
+ delta_offset += cur_dim;
+ }
+ return newConfig;
+ }
+
+}
diff --git a/cpp/LieConfig.h b/cpp/LieConfig.h
new file mode 100644
index 000000000..3583a3135
--- /dev/null
+++ b/cpp/LieConfig.h
@@ -0,0 +1,115 @@
+/*
+ * LieConfig.h
+ *
+ * Created on: Jan 5, 2010
+ * Author: Richard Roberts
+ *
+ * A templated config for Lie-group elements
+ */
+
+#pragma once
+
+
+#include