Added Symbol versions

release/4.3a0
dellaert 2014-10-01 13:12:07 +02:00
parent 0d94eeb480
commit ce53346a9e
1 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#pragma once
#include "Expression-inl.h"
#include <gtsam/inference/Symbol.h>
#include <boost/bind.hpp>
namespace gtsam {
@ -36,11 +37,21 @@ public:
root_(new ConstantExpression<T>(value)) {
}
// Construct a leaf expression
// Construct a leaf expression, with Key
Expression(const Key& key) :
root_(new LeafExpression<T>(key)) {
}
// Construct a leaf expression, with Symbol
Expression(const Symbol& symbol) :
root_(new LeafExpression<T>(symbol)) {
}
// Construct a leaf expression, creating Symbol
Expression(unsigned char c, size_t j) :
root_(new LeafExpression<T>(Symbol(c, j))) {
}
/// Construct a unary expression
template<typename E>
Expression(typename UnaryExpression<T, E>::function f,