Commit 52d8bd0b authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Stop using namespace boost globally in ModelTree

Otherwise boost::tuple overrides std::tuple.
parent 4d92baaf
......@@ -21,6 +21,8 @@
#include "MinimumFeedbackSet.hh"
using namespace boost;
namespace MFS
{
void
......
......@@ -25,17 +25,16 @@
#include <boost/graph/adjacency_list.hpp>
using namespace std;
using namespace boost;
namespace MFS
{
using VertexProperty_t = property<vertex_index_t, int,
property<vertex_index1_t, int,
property<vertex_degree_t, int,
property<vertex_in_degree_t, int,
property<vertex_out_degree_t, int >>>>>;
using AdjacencyList_t = adjacency_list<listS, listS, bidirectionalS, VertexProperty_t>;
using color_t = map<graph_traits<AdjacencyList_t>::vertex_descriptor, default_color_type>;
using VertexProperty_t = boost::property<boost::vertex_index_t, int,
boost::property<boost::vertex_index1_t, int,
boost::property<boost::vertex_degree_t, int,
boost::property<boost::vertex_in_degree_t, int,
boost::property<boost::vertex_out_degree_t, int >>>>>;
using AdjacencyList_t = boost::adjacency_list<boost::listS, boost::listS, boost::bidirectionalS, VertexProperty_t>;
using color_t = map<boost::graph_traits<AdjacencyList_t>::vertex_descriptor, boost::default_color_type>;
using vector_vertex_descriptor_t = vector<AdjacencyList_t::vertex_descriptor>;
//! Eliminate a vertex i
......
......@@ -30,7 +30,6 @@
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
using namespace boost;
using namespace MFS;
bool
......@@ -40,7 +39,7 @@ ModelTree::computeNormalization(const jacob_map_t &contemporaneous_jacobian, boo
assert(n == symbol_table.endo_nbr());
using BipartiteGraph = adjacency_list<vecS, vecS, undirectedS>;
using BipartiteGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>;
/*
Vertices 0 to n-1 are for endogenous (using type specific ID)
......@@ -124,7 +123,7 @@ ModelTree::computeNormalization(const jacob_map_t &contemporaneous_jacobian, boo
#endif
// Check if all variables are normalized
vector<int>::const_iterator it = find(mate_map.begin(), mate_map.begin() + n, graph_traits<BipartiteGraph>::null_vertex());
auto it = find(mate_map.begin(), mate_map.begin() + n, boost::graph_traits<BipartiteGraph>::null_vertex());
if (it != mate_map.begin() + n)
{
if (verbose)
......@@ -536,7 +535,7 @@ ModelTree::computeBlockDecompositionAndFeedbackVariablesForEachBlock(const jacob
AdjacencyList_t G2(n);
// It is necessary to manually initialize vertex_index property since this graph uses listS and not vecS as underlying vertex container
property_map<AdjacencyList_t, vertex_index_t>::type v_index = get(vertex_index, G2);
auto v_index = get(boost::vertex_index, G2);
for (int i = 0; i < n; i++)
put(v_index, vertex(i, G2), i);
......@@ -571,7 +570,7 @@ ModelTree::computeBlockDecompositionAndFeedbackVariablesForEachBlock(const jacob
G2);
vector<int> endo2block(num_vertices(G2)), discover_time(num_vertices(G2));
iterator_property_map<int *, property_map<AdjacencyList_t, vertex_index_t>::type, int, int &> endo2block_map(&endo2block[0], get(vertex_index, G2));
boost::iterator_property_map<int *, boost::property_map<AdjacencyList_t, boost::vertex_index_t>::type, int, int &> endo2block_map(&endo2block[0], get(boost::vertex_index, G2));
// Compute strongly connected components
int num = strong_components(G2, endo2block_map);
......@@ -579,7 +578,7 @@ ModelTree::computeBlockDecompositionAndFeedbackVariablesForEachBlock(const jacob
blocks = vector<pair<int, int>>(num, { 0, 0 });
// Create directed acyclic graph associated to the strongly connected components
using DirectedGraph = adjacency_list<vecS, vecS, directedS>;
using DirectedGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS>;
DirectedGraph dag(num);
for (unsigned int i = 0; i < num_vertices(G2); i++)
......@@ -665,7 +664,7 @@ ModelTree::computeBlockDecompositionAndFeedbackVariablesForEachBlock(const jacob
set<int> feed_back_vertices;
//Print(G);
AdjacencyList_t G1 = Minimal_set_of_feedback_vertex(feed_back_vertices, G);
property_map<AdjacencyList_t, vertex_index_t>::type v_index = get(vertex_index, G);
auto v_index = get(boost::vertex_index, G);
components_set[i].second.first = feed_back_vertices;
blocks[i].second = feed_back_vertices.size();
vector<int> Reordered_Vertice;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment