Provided (some) printing functionality
parent
012827dc98
commit
c1f464625b
|
@ -34,6 +34,7 @@
|
|||
#include <boost/mpl/fold.hpp>
|
||||
namespace MPL = boost::mpl::placeholders;
|
||||
|
||||
#include <typeinfo> // operator typeid
|
||||
#include <map>
|
||||
|
||||
class ExpressionFactorBinaryTest;
|
||||
|
@ -247,6 +248,13 @@ public:
|
|||
virtual ~ExpressionNode() {
|
||||
}
|
||||
|
||||
/// Streaming
|
||||
GTSAM_EXPORT friend std::ostream &operator<<(std::ostream &os,
|
||||
const ExpressionNode& node) {
|
||||
os << "Expression of type " << typeid(int).name() << std::endl;
|
||||
if (node.traceSize_>0) os << node.traceSize_ << std::endl;
|
||||
}
|
||||
|
||||
/// Return keys that play in this expression as a set
|
||||
virtual std::set<Key> keys() const {
|
||||
std::set<Key> keys;
|
||||
|
|
|
@ -52,6 +52,11 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
/// Print
|
||||
void print(const std::string& s) const {
|
||||
std::cout << s << root_ << std::endl;
|
||||
}
|
||||
|
||||
// Construct a constant expression
|
||||
Expression(const T& value) :
|
||||
root_(new ConstantExpression<T>(value)) {
|
||||
|
|
Loading…
Reference in New Issue