Made keys_ protected to allow initialization in a constructor body, added constructor for NonlinearFactor allowing more than two keys
parent
f244310250
commit
ce70480ae0
|
|
@ -70,7 +70,8 @@ public:
|
||||||
/** Const iterator over keys */
|
/** Const iterator over keys */
|
||||||
typedef typename std::vector<Key>::const_iterator const_iterator;
|
typedef typename std::vector<Key>::const_iterator const_iterator;
|
||||||
|
|
||||||
private:
|
//private: // FIXME: factors that manually initialize keys_ break in this case
|
||||||
|
protected:
|
||||||
|
|
||||||
// The keys involved in this factor
|
// The keys involved in this factor
|
||||||
std::vector<Key> keys_;
|
std::vector<Key> keys_;
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,14 @@ namespace gtsam {
|
||||||
Factor<Symbol>(j1,j2), noiseModel_(noiseModel) {
|
Factor<Symbol>(j1,j2), noiseModel_(noiseModel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor - arbitrary number of keys
|
||||||
|
* @param keys is the set of Symbols in the factor
|
||||||
|
*/
|
||||||
|
NonlinearFactor(const SharedGaussian& noiseModel, const std::set<Symbol>& keys) :
|
||||||
|
Factor<Symbol>(keys), noiseModel_(noiseModel) {
|
||||||
|
}
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
virtual void print(const std::string& s = "") const {
|
virtual void print(const std::string& s = "") const {
|
||||||
std::cout << s << ": NonlinearFactor\n";
|
std::cout << s << ": NonlinearFactor\n";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue