6
6
#include " boost/graph/sequential_vertex_coloring.hpp"
7
7
#include " boost/cstdlib.hpp"
8
8
#include " boost/graph/topology.hpp"
9
- #include < memory>
10
9
#include < fstream>
11
10
#include < boost/dynamic_bitset.hpp>
12
11
#include < random>
@@ -45,22 +44,20 @@ typedef boost::graph_traits<Graph>::edge_iterator E_iter;
45
44
typedef Graph::vertex_descriptor Ver;
46
45
typedef Graph::edge_descriptor Edge;
47
46
typedef boost::property_map<Graph, boost::edge_weight_t >::type edge_weight_type;
48
- typedef boost::dynamic_bitset<> dynbit ;
47
+ typedef boost::dynamic_bitset<> computed_dynamic_bit ;
49
48
50
49
// typedef std::vector<boost::square_topology<minstd_rand>::point> PositionVec;
51
50
// typedef boost::iterator_property_map<PositionVec::iterator, boost::property_map<Graph, boost::vertex_index_t>::type> PositionMap;
52
51
53
52
template <typename Lambda>
54
53
static void for_each_v (Graph& g, Lambda func) {
55
- V_iter vi, vi_end;
56
- tie (vi, vi_end) = vertices (g);
54
+ auto [vi, vi_end] = vertices (g);
57
55
std::for_each (vi,vi_end,func);
58
56
}
59
57
60
58
template <typename Lambda>
61
59
static void for_each_v_const (const Graph& g, Lambda func) {
62
- V_iter vi, vi_end;
63
- tie (vi, vi_end) = vertices (g);
60
+ auto [vi, vi_end] = vertices (g);
64
61
std::for_each (vi,vi_end,func);
65
62
}
66
63
@@ -79,7 +76,7 @@ static void for_each_e_const(const Graph& g, Lambda func) {
79
76
}
80
77
81
78
// static string statistics(const Graph& g) {
82
- // tuple<double,double,double> t = eigen_values(g);
79
+ // tuple<double, double, double> t = eigen_values(g);
83
80
// string stat = string("Number of vertices:") + to_string( boost::num_vertices(g)) +
84
81
// string("\nNumber of edges:") + to_string(boost::num_edges(g)) +
85
82
// string("\nMaximum eigenvalue:" + to_string(std::get<0>(t))) +
@@ -88,17 +85,17 @@ static void for_each_e_const(const Graph& g, Lambda func) {
88
85
// return stat;
89
86
// }
90
87
91
- static auto ge_degree = [](pair<int ,int > t1, pair<int ,int > t2){return t1.second >=t2.second ;};
92
- static auto lt_degree = [](pair<int ,int > t1, pair<int ,int > t2){return t1.second <t2.second ;};
88
+ static auto ge_degree = [](const pair<int ,int >& t1, const pair<int ,int >& t2){return t1.second >=t2.second ;};
89
+ static auto lt_degree = [](const pair<int ,int >& t1, const pair<int ,int >& t2){return t1.second <t2.second ;};
93
90
94
- static bool cmp_degrees (pair<int ,pair<int ,int > > t1, pair<int ,pair<int ,int > > t2)
91
+ static bool cmp_degrees (const pair<int ,pair<int ,int > >& t1, const pair<int ,pair<int ,int > >& t2)
95
92
{
96
93
if (t1.second .second < t2.second .second ) {
97
- return 1 ;
94
+ return true ;
98
95
} else if (t1.second .second == t2.second .second && t1.second .first < t2.second .first ) {
99
- return 1 ;
96
+ return true ;
100
97
} else {
101
- return 0 ;
98
+ return false ;
102
99
}
103
100
}
104
101
@@ -107,7 +104,7 @@ static bool mysymmetric = false;
107
104
/* *
108
105
* \brief Computes the fill-reducing ordering
109
106
*
110
- * @param g the given simple graph which would be converted to a metis input format
107
+ * @param g the given simple graph, which would be converted to a metis input format
111
108
* @param name the name of the file which is given to metis command
112
109
* @param met_ord the computed ordering in Metis
113
110
*/
0 commit comments