Could not use local class for KeyFormatter when passing to boost function on some compilers

release/4.3a0
Richard Roberts 2012-06-25 12:09:42 +00:00
parent b16fe4f7fc
commit 2c088b6a72
2 changed files with 14 additions and 14 deletions

View File

@ -34,7 +34,6 @@
#include <gtsam/inference/BayesTreeCliqueBase.h>
#include <gtsam/inference/IndexConditional.h>
#include <gtsam/linear/VectorValues.h>
#include <gtsam/nonlinear/Key.h>
namespace gtsam {

View File

@ -29,12 +29,11 @@ using namespace std;
namespace gtsam {
/* ************************************************************************* */
void NonlinearISAM::saveGraph(const string& s, const KeyFormatter& keyFormatter) const {
// Create an index formatter that looks up the Key in an inverse ordering, then
// formats the key using the provided key formatter.
struct OrderingIndexFormatter {
/* ************************************************************************* */
// Create an index formatter that looks up the Key in an inverse ordering, then
// formats the key using the provided key formatter, used in saveGraph.
struct OrderingIndexFormatter {
Ordering::InvertedMap inverseOrdering;
const KeyFormatter& keyFormatter;
OrderingIndexFormatter(const Ordering& ordering, const KeyFormatter& keyFormatter) :
@ -42,8 +41,10 @@ void NonlinearISAM::saveGraph(const string& s, const KeyFormatter& keyFormatter)
string operator()(Index index) {
return keyFormatter(inverseOrdering.at(index));
}
};
};
/* ************************************************************************* */
void NonlinearISAM::saveGraph(const string& s, const KeyFormatter& keyFormatter) const {
isam_.saveGraph(s, OrderingIndexFormatter(ordering_, keyFormatter));
}