From ce53346a9e81a0e56416bfd4c21c56c008d2ea12 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 1 Oct 2014 13:12:07 +0200 Subject: [PATCH] Added Symbol versions --- gtsam_unstable/nonlinear/Expression.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gtsam_unstable/nonlinear/Expression.h b/gtsam_unstable/nonlinear/Expression.h index 0d326dffe..eb270ae1b 100644 --- a/gtsam_unstable/nonlinear/Expression.h +++ b/gtsam_unstable/nonlinear/Expression.h @@ -20,6 +20,7 @@ #pragma once #include "Expression-inl.h" +#include #include namespace gtsam { @@ -36,11 +37,21 @@ public: root_(new ConstantExpression(value)) { } - // Construct a leaf expression + // Construct a leaf expression, with Key Expression(const Key& key) : root_(new LeafExpression(key)) { } + // Construct a leaf expression, with Symbol + Expression(const Symbol& symbol) : + root_(new LeafExpression(symbol)) { + } + + // Construct a leaf expression, creating Symbol + Expression(unsigned char c, size_t j) : + root_(new LeafExpression(Symbol(c, j))) { + } + /// Construct a unary expression template Expression(typename UnaryExpression::function f,