diff --git a/cpp/LinearFactor.h b/cpp/LinearFactor.h index ff4f7a55e..cd1ecbc49 100644 --- a/cpp/LinearFactor.h +++ b/cpp/LinearFactor.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "Matrix.h" #include "Factor.h" @@ -82,6 +83,15 @@ public: As.insert(make_pair(key3, A3)); } + /** Construct an n-ary factor */ + CONSTRUCTOR + LinearFactor(const std::vector > &terms, + const Vector &b_in) : + b(b_in) { + for(unsigned int i=0; i