Could not use local class for KeyFormatter when passing to boost function on some compilers
parent
b16fe4f7fc
commit
2c088b6a72
|
|
@ -34,7 +34,6 @@
|
||||||
#include <gtsam/inference/BayesTreeCliqueBase.h>
|
#include <gtsam/inference/BayesTreeCliqueBase.h>
|
||||||
#include <gtsam/inference/IndexConditional.h>
|
#include <gtsam/inference/IndexConditional.h>
|
||||||
#include <gtsam/linear/VectorValues.h>
|
#include <gtsam/linear/VectorValues.h>
|
||||||
#include <gtsam/nonlinear/Key.h>
|
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,11 @@ using namespace std;
|
||||||
|
|
||||||
namespace gtsam {
|
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.
|
// Create an index formatter that looks up the Key in an inverse ordering, then
|
||||||
struct OrderingIndexFormatter {
|
// formats the key using the provided key formatter, used in saveGraph.
|
||||||
|
struct OrderingIndexFormatter {
|
||||||
Ordering::InvertedMap inverseOrdering;
|
Ordering::InvertedMap inverseOrdering;
|
||||||
const KeyFormatter& keyFormatter;
|
const KeyFormatter& keyFormatter;
|
||||||
OrderingIndexFormatter(const Ordering& ordering, 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) {
|
string operator()(Index index) {
|
||||||
return keyFormatter(inverseOrdering.at(index));
|
return keyFormatter(inverseOrdering.at(index));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
void NonlinearISAM::saveGraph(const string& s, const KeyFormatter& keyFormatter) const {
|
||||||
isam_.saveGraph(s, OrderingIndexFormatter(ordering_, keyFormatter));
|
isam_.saveGraph(s, OrderingIndexFormatter(ordering_, keyFormatter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue