diff --git a/.cproject b/.cproject
index b326ba62d..109495aaf 100644
--- a/.cproject
+++ b/.cproject
@@ -419,10 +419,10 @@
true
true
-
+
make
-j2
-testVectorConfig.run
+testVectorMap.run
true
true
true
@@ -469,7 +469,6 @@
make
-
testBayesTree.run
true
false
@@ -477,6 +476,7 @@
make
+
testSymbolicBayesNet.run
true
false
@@ -484,7 +484,6 @@
make
-
testSymbolicFactorGraph.run
true
false
@@ -676,7 +675,6 @@
make
-
testGraph.run
true
false
@@ -732,6 +730,7 @@
make
+
testSimulated2D.run
true
false
@@ -769,6 +768,14 @@
true
true
+
+make
+-j2
+testVectorBTree.run
+true
+true
+true
+
make
-j2
diff --git a/cpp/VectorBTree.h b/cpp/VectorBTree.h
index 0ce5767c4..58b8a561c 100644
--- a/cpp/VectorBTree.h
+++ b/cpp/VectorBTree.h
@@ -102,6 +102,10 @@ public:
SubVector operator[](const Symbol& j);
ConstSubVector operator[](const Symbol& j) const;
+ /** [set] and [get] provided for access via MATLAB */
+ void set(const Symbol& j, const Vector& v) { (*this)[j] = v; }
+ inline const Vector get(const Symbol& j) const { return (*this)[j];}
+
/** max of the vectors */
double max() const;
diff --git a/cpp/VectorMap.h b/cpp/VectorMap.h
index 8c2ec1e10..b1944e034 100644
--- a/cpp/VectorMap.h
+++ b/cpp/VectorMap.h
@@ -60,7 +60,12 @@ namespace gtsam {
Vector& operator[](const Symbol& j);
const Vector& operator[](const Symbol& j) const;
- bool contains(const Symbol& name) const {
+ /** [set] and [get] provided for access via MATLAB */
+ inline Vector& get(const Symbol& j) { return (*this)[j];}
+ void set(const Symbol& j, const Vector& v) { (*this)[j] = v; }
+ inline const Vector& get(const Symbol& j) const { return (*this)[j];}
+
+ bool contains(const Symbol& name) const {
const_iterator it = values.find(name);
return (it!=values.end());
}
diff --git a/cpp/testVectorBTree.cpp b/cpp/testVectorBTree.cpp
index 0f115eba8..9eb264233 100644
--- a/cpp/testVectorBTree.cpp
+++ b/cpp/testVectorBTree.cpp
@@ -48,6 +48,7 @@ TEST( VectorBTree, constructor_insert_get )
LONGS_EQUAL(1,actual.size())
CHECK(assert_equal(expected,actual))
CHECK(equal_with_abs_tol(v,actual[x1]))
+ CHECK(equal_with_abs_tol(v,actual.get(x1)))
}
/* ************************************************************************* */
diff --git a/cpp/testVectorMap.cpp b/cpp/testVectorMap.cpp
index e5b9ce674..d2c9d1ea7 100644
--- a/cpp/testVectorMap.cpp
+++ b/cpp/testVectorMap.cpp
@@ -44,6 +44,7 @@ TEST( VectorMap, equals1 )
VectorMap actual;
actual.insert("a",v);
CHECK(assert_equal(expected,actual));
+ CHECK(assert_equal(expected["a"],actual.get("a")))
}
/* ************************************************************************* */