diff --git a/.cproject b/.cproject
index 3283b0ffc..10af82bcb 100644
--- a/.cproject
+++ b/.cproject
@@ -366,6 +366,21 @@
true
true
+
+make
+testNonlinearOptimizer.run
+true
+true
+true
+
+
+make
+
+testLinearFactor.run
+true
+true
+true
+
make
install
diff --git a/cpp/FGConfig.cpp b/cpp/FGConfig.cpp
index d869fab18..fd34bad35 100644
--- a/cpp/FGConfig.cpp
+++ b/cpp/FGConfig.cpp
@@ -9,13 +9,11 @@
#include
#include
#include "FGConfig.h"
-#include "Value.h"
-
-using namespace std;
// trick from some reading group
#define FOREACH_PAIR( KEY, VAL, COL) BOOST_FOREACH (boost::tie(KEY,VAL),COL)
+using namespace std;
using namespace gtsam;
/* ************************************************************************* */
@@ -29,23 +27,17 @@ void check_size(const string& key, const Vector & vj, const Vector & dj) {
}
/* ************************************************************************* */
-void FGConfig::operator+=(const FGConfig & delta)
+FGConfig FGConfig::exmap(const FGConfig & delta) const
{
- for (iterator it = values.begin(); it!=values.end(); it++) {
+ FGConfig newConfig;
+ for (const_iterator it = values.begin(); it!=values.end(); it++) {
string j = it->first;
- Vector &vj = it->second;
+ const Vector &vj = it->second;
const Vector& dj = delta[j];
check_size(j,vj,dj);
- vj += dj;
+ newConfig.insert(j, vj + dj);
}
-}
-
-/* ************************************************************************* */
-FGConfig FGConfig::operator+(const FGConfig & delta) const
-{
- FGConfig result = *this;
- result += delta;
- return result;
+ return newConfig;
}
/* ************************************************************************* */
diff --git a/cpp/FGConfig.h b/cpp/FGConfig.h
index b6217108a..12e98ff37 100644
--- a/cpp/FGConfig.h
+++ b/cpp/FGConfig.h
@@ -12,12 +12,13 @@
#include