fix for cityslam

release/4.3a0
Yong-Dian Jian 2010-10-13 22:41:48 +00:00
parent de90c84d91
commit 2ce0f40b79
1 changed files with 7 additions and 0 deletions

View File

@ -9,10 +9,13 @@
#include <map>
#include <gtsam/base/Testable.h>
#include <gtsam/nonlinear/Key.h>
#include <gtsam/inference/inference.h>
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/assign/list_inserter.hpp>
#include <boost/pool/pool_alloc.hpp>
@ -35,6 +38,10 @@ public:
typedef Map::const_iterator const_iterator;
Ordering() : nVars_(0) {}
Ordering(const std::list<Symbol> & L):nVars_(0) {
int i = 0;
BOOST_FOREACH( const Symbol& s, L) insert(s, i++) ;
}
/** One greater than the maximum ordering index. */
Index nVars() const { return nVars_; }