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/IndexConditional.h>
|
||||
#include <gtsam/linear/VectorValues.h>
|
||||
#include <gtsam/nonlinear/Key.h>
|
||||
|
||||
namespace gtsam {
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue