Further cleanup of fast_pool_allocator

release/4.3a0
Richard Roberts 2011-02-04 03:10:29 +00:00
parent 31ffd3877f
commit 62f716002a
4 changed files with 6 additions and 9 deletions

View File

@ -47,7 +47,7 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
GaussianFactorGraph::Keys GaussianFactorGraph::keys() const { GaussianFactorGraph::Keys GaussianFactorGraph::keys() const {
std::set<Index, std::less<Index>, boost::fast_pool_allocator<Index> > keys; FastSet<Index> keys;
BOOST_FOREACH(const sharedFactor& factor, *this) { BOOST_FOREACH(const sharedFactor& factor, *this) {
if(factor) keys.insert(factor->begin(), factor->end()); } if(factor) keys.insert(factor->begin(), factor->end()); }
return keys; return keys;

View File

@ -21,6 +21,7 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <gtsam/base/FastSet.h>
#include <gtsam/inference/FactorGraph.h> #include <gtsam/inference/FactorGraph.h>
#include <gtsam/linear/Errors.h> #include <gtsam/linear/Errors.h>
#include <gtsam/linear/GaussianFactor.h> #include <gtsam/linear/GaussianFactor.h>
@ -93,7 +94,7 @@ namespace gtsam {
* Return the set of variables involved in the factors (computes a set * Return the set of variables involved in the factors (computes a set
* union). * union).
*/ */
typedef std::set<Index, std::less<Index>, boost::fast_pool_allocator<Index> > Keys; typedef FastSet<Index> Keys;
Keys keys() const; Keys keys() const;
/** Permute the variables in the factors */ /** Permute the variables in the factors */

View File

@ -27,8 +27,7 @@
#include <map> #include <map>
#include <set> #include <set>
#include <boost/pool/pool_alloc.hpp> #include <gtsam/base/FastMap.h>
#include <gtsam/base/Vector.h> #include <gtsam/base/Vector.h>
#include <gtsam/base/Testable.h> #include <gtsam/base/Testable.h>
#include <gtsam/nonlinear/Ordering.h> #include <gtsam/nonlinear/Ordering.h>
@ -58,7 +57,7 @@ namespace gtsam {
*/ */
typedef J Key; typedef J Key;
typedef typename J::Value Value; typedef typename J::Value Value;
typedef std::map<J,Value, std::less<J>, boost::fast_pool_allocator<std::pair<const J,Value> > > KeyValueMap; typedef FastMap<J,Value> KeyValueMap;
typedef typename KeyValueMap::value_type KeyValuePair; typedef typename KeyValueMap::value_type KeyValuePair;
typedef typename KeyValueMap::iterator iterator; typedef typename KeyValueMap::iterator iterator;
typedef typename KeyValueMap::const_iterator const_iterator; typedef typename KeyValueMap::const_iterator const_iterator;

View File

@ -18,10 +18,7 @@
#pragma once #pragma once
#include <map> #include <gtsam/base/FastMap.h>
#include <gtsam/base/Testable.h> #include <gtsam/base/Testable.h>
#include <gtsam/nonlinear/Key.h> #include <gtsam/nonlinear/Key.h>
#include <gtsam/inference/inference.h> #include <gtsam/inference/inference.h>