From 63440f937fc971ffa89da93b29fd6b52e8e0d89c Mon Sep 17 00:00:00 2001 From: Kai Ni Date: Thu, 14 Jan 2010 02:07:14 +0000 Subject: [PATCH] almost fixed oredering except one function call --- cpp/FactorGraph-inl.h | 1 + cpp/FactorGraph.h | 2 +- cpp/Ordering.cpp | 10 ++++++---- cpp/Ordering.h | 3 ++- cpp/graph.h | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cpp/FactorGraph-inl.h b/cpp/FactorGraph-inl.h index 490a43a1a..57af9427e 100644 --- a/cpp/FactorGraph-inl.h +++ b/cpp/FactorGraph-inl.h @@ -22,6 +22,7 @@ #include #include "Ordering.h" #include "FactorGraph.h" +#include "graph-inl.h" // trick from some reading group #define FOREACH_PAIR( KEY, VAL, COL) BOOST_FOREACH (boost::tie(KEY,VAL),COL) diff --git a/cpp/FactorGraph.h b/cpp/FactorGraph.h index 34e6ff4f2..c49a669cd 100644 --- a/cpp/FactorGraph.h +++ b/cpp/FactorGraph.h @@ -17,7 +17,7 @@ #include "Testable.h" #include "BayesNet.h" -#include "graph-inl.h" +#include "graph.h" namespace gtsam { diff --git a/cpp/Ordering.cpp b/cpp/Ordering.cpp index 415e4b149..9a4c786c2 100644 --- a/cpp/Ordering.cpp +++ b/cpp/Ordering.cpp @@ -30,13 +30,15 @@ public: Ordering& ordering_; }; -/* ************************************************************************* * -Ordering::Ordering(const map& p_map) { +/* ************************************************************************* */ +Ordering::Ordering(const PredecessorMap& p_map) { - SGraph g; + typedef SGraph::Vertex SVertex; + + SGraph g; SVertex root; map key2vertex; - boost::tie(g, root, key2vertex) = predecessorMap2Graph(p_map); + //boost::tie(g, root, key2vertex) = predecessorMap2Graph(p_map); // breadth first visit on the graph ordering_key_visitor vis(*this); diff --git a/cpp/Ordering.h b/cpp/Ordering.h index 68cbd96ce..029e61379 100644 --- a/cpp/Ordering.h +++ b/cpp/Ordering.h @@ -10,6 +10,7 @@ #include #include #include "Testable.h" +#include "graph.h" namespace gtsam { @@ -42,7 +43,7 @@ namespace gtsam { /** * Generate the ordering from a spanning tree represented by its parent map */ - //Ordering(const std::map& p_map); + Ordering(const PredecessorMap& p_map); /** * Remove a set of keys from an ordering diff --git a/cpp/graph.h b/cpp/graph.h index 937240ec9..77bdc324d 100644 --- a/cpp/graph.h +++ b/cpp/graph.h @@ -29,6 +29,7 @@ namespace gtsam { template class SGraph : public boost::adjacency_list > { + public: typedef typename boost::graph_traits >::vertex_descriptor Vertex; };