re-org code

release/4.3a0
Yong-Dian Jian 2010-10-14 02:06:49 +00:00
parent 6aa47963e9
commit 422a4ae16d
2 changed files with 8 additions and 4 deletions

View File

@ -15,6 +15,13 @@ using namespace std;
namespace gtsam {
/* ************************************************************************* */
Ordering::Ordering(const std::list<Symbol> & L):nVars_(0) {
int i = 0;
BOOST_FOREACH( const Symbol& s, L )
insert(s, i++) ;
}
/* ************************************************************************* */
void Ordering::permuteWithInverse(const Permutation& inversePermutation) {
BOOST_FOREACH(Ordering::value_type& key_order, *this) {

View File

@ -38,10 +38,7 @@ 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++) ;
}
Ordering(const std::list<Symbol> & L) ;
/** One greater than the maximum ordering index. */
Index nVars() const { return nVars_; }