functional STL magic

release/4.3a0
Frank Dellaert 2009-11-20 14:18:26 +00:00
parent d234365d53
commit 715dc4474d
1 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,8 @@
#include <list>
#include <sstream>
#include <stdexcept>
#include <functional>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
#include <colamd/colamd.h>
@ -110,10 +112,9 @@ void FactorGraph<Factor>::push_back(const FactorGraph<Factor>& factors) {
/* ************************************************************************* */
template<class Factor>
Ordering FactorGraph<Factor>::keys() const {
string key;
Ordering keys;
list<int> indices_key;
FOREACH_PAIR(key, indices_key, indices_) keys.push_back(key);
transform(indices_.begin(), indices_.end(),
back_inserter(keys), _Select1st<Indices::value_type>());
return keys;
}