Added a constructor to create an n-ary factor from an std::vector of key/A-matrix pairs
parent
c3b8a20b5c
commit
ae57441c3d
|
@ -14,6 +14,7 @@
|
|||
#include <set>
|
||||
#include <ostream>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <vector>
|
||||
|
||||
#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<std::pair<std::string, Matrix> > &terms,
|
||||
const Vector &b_in) :
|
||||
b(b_in) {
|
||||
for(unsigned int i=0; i<terms.size(); i++)
|
||||
As.insert(terms[i]);
|
||||
}
|
||||
|
||||
/** Construct from Conditional Gaussian */
|
||||
CONSTRUCTOR
|
||||
LinearFactor(const std::string& key, const boost::shared_ptr<
|
||||
|
|
Loading…
Reference in New Issue