almost fixed oredering except one function call
parent
5a02b36723
commit
63440f937f
|
@ -22,6 +22,7 @@
|
||||||
#include <colamd/colamd.h>
|
#include <colamd/colamd.h>
|
||||||
#include "Ordering.h"
|
#include "Ordering.h"
|
||||||
#include "FactorGraph.h"
|
#include "FactorGraph.h"
|
||||||
|
#include "graph-inl.h"
|
||||||
|
|
||||||
// trick from some reading group
|
// trick from some reading group
|
||||||
#define FOREACH_PAIR( KEY, VAL, COL) BOOST_FOREACH (boost::tie(KEY,VAL),COL)
|
#define FOREACH_PAIR( KEY, VAL, COL) BOOST_FOREACH (boost::tie(KEY,VAL),COL)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include "Testable.h"
|
#include "Testable.h"
|
||||||
#include "BayesNet.h"
|
#include "BayesNet.h"
|
||||||
#include "graph-inl.h"
|
#include "graph.h"
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,15 @@ public:
|
||||||
Ordering& ordering_;
|
Ordering& ordering_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ************************************************************************* *
|
/* ************************************************************************* */
|
||||||
Ordering::Ordering(const map<string, string>& p_map) {
|
Ordering::Ordering(const PredecessorMap<string>& p_map) {
|
||||||
|
|
||||||
SGraph g;
|
typedef SGraph<string>::Vertex SVertex;
|
||||||
|
|
||||||
|
SGraph<string> g;
|
||||||
SVertex root;
|
SVertex root;
|
||||||
map<string, SVertex> key2vertex;
|
map<string, SVertex> key2vertex;
|
||||||
boost::tie(g, root, key2vertex) = predecessorMap2Graph<SGraph, SVertex>(p_map);
|
//boost::tie(g, root, key2vertex) = predecessorMap2Graph<string>(p_map);
|
||||||
|
|
||||||
// breadth first visit on the graph
|
// breadth first visit on the graph
|
||||||
ordering_key_visitor vis(*this);
|
ordering_key_visitor vis(*this);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "Testable.h"
|
#include "Testable.h"
|
||||||
|
#include "graph.h"
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ namespace gtsam {
|
||||||
/**
|
/**
|
||||||
* Generate the ordering from a spanning tree represented by its parent map
|
* Generate the ordering from a spanning tree represented by its parent map
|
||||||
*/
|
*/
|
||||||
//Ordering(const std::map<std::string, std::string>& p_map);
|
Ordering(const PredecessorMap<std::string>& p_map);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a set of keys from an ordering
|
* Remove a set of keys from an ordering
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace gtsam {
|
||||||
template<class Key>
|
template<class Key>
|
||||||
class SGraph : public boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
|
class SGraph : public boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
|
||||||
boost::property<boost::vertex_name_t, std::string> > {
|
boost::property<boost::vertex_name_t, std::string> > {
|
||||||
|
public:
|
||||||
typedef typename boost::graph_traits<SDGraph<Key> >::vertex_descriptor Vertex;
|
typedef typename boost::graph_traits<SDGraph<Key> >::vertex_descriptor Vertex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue