Commit 3446c01d authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Force inline of key wrapper functions

parent f74932df
......@@ -287,7 +287,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::vertex_iterator,
typename filtered_graph<G, EP, VP>::vertex_iterator>
vertices(const filtered_graph<G, EP, VP>& g)
......@@ -301,7 +301,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::edge_iterator,
typename filtered_graph<G, EP, VP>::edge_iterator>
edges(const filtered_graph<G, EP, VP>& g)
......@@ -360,7 +360,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::out_edge_iterator,
typename filtered_graph<G, EP, VP>::out_edge_iterator>
out_edges(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
......@@ -374,7 +374,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
typename filtered_graph<G, EP, VP>::degree_size_type
out_degree(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
const filtered_graph<G, EP, VP>& g)
......@@ -387,7 +387,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::adjacency_iterator,
typename filtered_graph<G, EP, VP>::adjacency_iterator>
adjacent_vertices(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
......@@ -401,7 +401,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::in_edge_iterator,
typename filtered_graph<G, EP, VP>::in_edge_iterator>
in_edges(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
......@@ -415,7 +415,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
typename filtered_graph<G, EP, VP>::degree_size_type
in_degree(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
const filtered_graph<G, EP, VP>& g)
......@@ -428,7 +428,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::edge_descriptor, bool>
edge(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
typename filtered_graph<G, EP, VP>::vertex_descriptor v,
......@@ -441,7 +441,7 @@ namespace boost {
}
template <typename G, typename EP, typename VP>
inline
inline __attribute__((always_inline))
std::pair<typename filtered_graph<G, EP, VP>::out_edge_iterator,
typename filtered_graph<G, EP, VP>::out_edge_iterator>
edge_range(typename filtered_graph<G, EP, VP>::vertex_descriptor u,
......
......@@ -336,10 +336,10 @@ edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// out_edges(u,g)
//==============================================================================
template <class Graph>
inline
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::out_edge_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::out_edge_iterator >
out_edges(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
inline __attribute__((always_inline))
std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::out_edge_iterator,
typename graph_traits<UndirectedAdaptor<Graph>>::out_edge_iterator >
out_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g)
{
typedef joined_edge_iterator<Graph> iter_t;
......@@ -353,10 +353,10 @@ out_edges(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// in_edges(u,g)
//==============================================================================
template <class Graph>
inline
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::in_edge_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::in_edge_iterator >
in_edges(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
inline __attribute__((always_inline))
std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::in_edge_iterator,
typename graph_traits<UndirectedAdaptor<Graph>>::in_edge_iterator >
in_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g)
{
typedef joined_edge_iterator<Graph, mpl::true_> iter_t;
......@@ -370,16 +370,16 @@ in_edges(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// adjacent_vertices(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator>
adjacent_vertices
(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g)
{
auto e_range = out_edges(u, g);
typedef typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator
adjacency_iterator;
auto e_range = out_edges(u, g);
return std::make_pair(adjacency_iterator(e_range.first, &g),
adjacency_iterator(e_range.second, &g));
}
......@@ -388,7 +388,7 @@ adjacent_vertices
// num_vertices(g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type
num_vertices(const UndirectedAdaptor<Graph>& g)
{
......@@ -399,7 +399,8 @@ num_vertices(const UndirectedAdaptor<Graph>& g)
// num_edges(g)
//==============================================================================
template <class Graph>
inline typename graph_traits<UndirectedAdaptor<Graph> >::edges_size_type
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::edges_size_type
num_edges(const UndirectedAdaptor<Graph>& g)
{
return num_edges(g.original_graph());
......@@ -409,7 +410,7 @@ num_edges(const UndirectedAdaptor<Graph>& g)
// out_degree(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type
out_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g)
......@@ -434,7 +435,7 @@ in_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// degree(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type
degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g)
......@@ -447,7 +448,7 @@ degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// add_vertex(g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
add_vertex(UndirectedAdaptor<Graph>& g)
{
......@@ -458,7 +459,8 @@ add_vertex(UndirectedAdaptor<Graph>& g)
// add_vertex(vp,g)
//==============================================================================
template <class Graph, class VertexProperties>
inline typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
inline __attribute__((always_inline))
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
add_vertex(const VertexProperties& p, UndirectedAdaptor<Graph>& g)
{
return add_vertex(p, g.original_graph());
......@@ -468,7 +470,7 @@ add_vertex(const VertexProperties& p, UndirectedAdaptor<Graph>& g)
// clear_vertex(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void clear_vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
UndirectedAdaptor<Graph>& g)
{
......@@ -479,7 +481,7 @@ void clear_vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descr
// remove_vertex(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void remove_vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
UndirectedAdaptor<Graph>& g)
{
......@@ -490,7 +492,7 @@ void remove_vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_desc
// remove_vertex_fast(u,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void remove_vertex_fast(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
UndirectedAdaptor<Graph>& g)
{
......@@ -501,7 +503,7 @@ void remove_vertex_fast(typename graph_traits<UndirectedAdaptor<Graph> >::vertex
// add_edge(u,v,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor,
bool>
add_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
......@@ -515,7 +517,7 @@ add_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// add_edge(u,v,ep,g)
//==============================================================================
template <class Graph, class EdgeProperties>
inline
inline __attribute__((always_inline))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor,
bool>
add_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
......@@ -529,7 +531,7 @@ add_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// remove_edge(u,v,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void remove_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor v,
UndirectedAdaptor<Graph>& g)
......@@ -543,7 +545,7 @@ void remove_edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descri
// remove_edge(e,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void remove_edge(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& e,
UndirectedAdaptor<Graph>& g)
{
......@@ -554,7 +556,7 @@ void remove_edge(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_de
// remove_edge(e_iter,g)
//==============================================================================
template <class Graph>
inline
inline __attribute__((always_inline))
void remove_edge(const typename graph_traits<UndirectedAdaptor<Graph> >::out_edge_iterator& iter,
UndirectedAdaptor<Graph>& g)
{
......
......@@ -511,7 +511,7 @@ struct graph_property_type<adj_list<Vertex> >
//========================================================================
template <class Vertex>
inline
inline __attribute__((always_inline))
std::pair<typename adj_list<Vertex>::vertex_iterator,
typename adj_list<Vertex>::vertex_iterator>
vertices(const adj_list<Vertex>& g)
......@@ -553,7 +553,7 @@ edges(const adj_list<Vertex>& g)
}
template <class Vertex>
inline
inline __attribute__((always_inline))
Vertex vertex(size_t i, const adj_list<Vertex>&)
{
return i;
......@@ -576,28 +576,28 @@ edge(Vertex s, Vertex t, const adj_list<Vertex>& g)
}
template <class Vertex>
inline
inline __attribute__((always_inline))
size_t out_degree(Vertex v, const adj_list<Vertex>& g)
{
return g._out_edges[v].size();
}
template <class Vertex>
inline
inline __attribute__((always_inline))
size_t in_degree(Vertex v, const adj_list<Vertex>& g)
{
return g._in_edges[v].size();
}
template <class Vertex>
inline
inline __attribute__((always_inline))
size_t degree(Vertex v, const adj_list<Vertex>& g)
{
return in_degree(v, g) + out_degree(v, g);
}
template <class Vertex>
inline
inline __attribute__((always_inline))
std::pair<typename adj_list<Vertex>::out_edge_iterator,
typename adj_list<Vertex>::out_edge_iterator>
out_edges(Vertex v, const adj_list<Vertex>& g)
......@@ -609,7 +609,7 @@ out_edges(Vertex v, const adj_list<Vertex>& g)
}
template <class Vertex>
inline
inline __attribute__((always_inline))
std::pair<typename adj_list<Vertex>::in_edge_iterator,
typename adj_list<Vertex>::in_edge_iterator>
in_edges(Vertex v, const adj_list<Vertex>& g)
......@@ -621,7 +621,7 @@ in_edges(Vertex v, const adj_list<Vertex>& g)
}
template <class Vertex>
inline
inline __attribute__((always_inline))
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
adjacent_vertices(Vertex v, const adj_list<Vertex>& g)
......@@ -633,27 +633,26 @@ adjacent_vertices(Vertex v, const adj_list<Vertex>& g)
}
template <class Vertex>
inline
inline __attribute__((always_inline))
size_t num_vertices(const adj_list<Vertex>& g)
{
return g._out_edges.size();
}
template <class Vertex>
inline
inline __attribute__((always_inline))
size_t num_edges(const adj_list<Vertex>& g)
{
return g._n_edges;
}
template <class Vertex>
inline
inline __attribute__((always_inline))
Vertex add_vertex(adj_list<Vertex>& g)
{
size_t n = g._out_edges.size();
g._out_edges.resize(n + 1);
g._in_edges.resize(n + 1);
return n;
g._out_edges.emplace_back();
g._in_edges.emplace_back();
return g._out_edges.size() - 1;
}
template <class Vertex>
......
......@@ -74,14 +74,14 @@ struct in_degreeS
in_degreeS() {}
template <class Graph, class Vertex>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g) const
{
return in_degreeS::operator()(v, g, detail::no_weightS());
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g, Weight&& weight) const
{
typedef typename is_convertible
......@@ -91,7 +91,7 @@ struct in_degreeS
}
template <class Graph, class Vertex>
inline
inline __attribute__((always_inline))
auto get_in_degree(Vertex v, const Graph& g, std::true_type,
detail::no_weightS) const
{
......@@ -124,7 +124,7 @@ struct in_degreeS
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto get_in_degree(const Vertex&, const Graph&, std::false_type,
Weight&&) const
{
......@@ -139,14 +139,14 @@ struct out_degreeS
out_degreeS() {}
template <class Graph, class Vertex>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g) const
{
return out_degreeS::operator()(v, g, detail::no_weightS());
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g, Weight&& weight) const
{
return get_out_degree(v, g, std::forward<Weight>(weight));
......@@ -179,7 +179,7 @@ struct out_degreeS
}
template <class Graph, class Vertex>
inline
inline __attribute__((always_inline))
auto get_out_degree(Vertex v, const Graph& g,
detail::no_weightS) const
{
......@@ -193,14 +193,14 @@ struct total_degreeS
total_degreeS() {}
template <class Graph, class Vertex>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g) const
{
return total_degreeS::operator()(v, g, detail::no_weightS());
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto operator()(Vertex v, const Graph& g, Weight&& weight) const
{
typedef typename is_convertible
......@@ -211,7 +211,7 @@ struct total_degreeS
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto get_total_degree(Vertex v, const Graph& g, std::true_type,
Weight&& weight) const
{
......@@ -220,7 +220,7 @@ struct total_degreeS
}
template <class Graph, class Vertex, class Weight>
inline
inline __attribute__((always_inline))
auto get_total_degree(Vertex v, const Graph& g, std::false_type,
Weight&& weight) const
{
......@@ -238,7 +238,7 @@ struct scalarS
scalarS(PropertyMap pmap): _pmap(pmap) {}
template <class Descriptor, class Graph>
inline
inline __attribute__((always_inline))
auto operator()(const Descriptor& d, const Graph&) const
{
return get(_pmap, d);
......@@ -309,7 +309,7 @@ struct get_in_edges
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
typedef typename boost::graph_traits<Graph>::in_edge_iterator type;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -327,7 +327,7 @@ struct get_in_edges<Graph,std::false_type>
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
typedef typename boost::graph_traits<Graph>::out_edge_iterator type;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor,
const Graph&)
{
......@@ -349,7 +349,7 @@ struct in_edge_iteratorS
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -365,7 +365,7 @@ struct out_edge_iteratorS
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -385,7 +385,7 @@ struct get_all_edges
vertex_descriptor;
typedef typename boost::graph_traits<boost::UndirectedAdaptor<Graph> >::out_edge_iterator
type;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -426,7 +426,7 @@ struct all_edges_iteratorS
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -459,7 +459,7 @@ struct in_or_out_edge_iteratorS
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
inline
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
......@@ -482,28 +482,28 @@ private:
};
template <class Iter>
inline
inline __attribute__((always_inline))
auto mk_range(std::pair<Iter, Iter>&& range)
{
return IterRange<Iter>(std::forward<std::pair<Iter, Iter>>(range));
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto vertices_range(const Graph& g)
{
return mk_range(vertices(g));
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto edges_range(const Graph& g)
{
return mk_range(edges(g));
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descriptor v,
const Graph& g)
{
......@@ -511,7 +511,7 @@ auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descrip
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g)
{
......@@ -519,7 +519,7 @@ auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v,
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g)
{
......@@ -527,7 +527,7 @@ auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v,
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v,
const Graph& g)
{
......@@ -535,7 +535,7 @@ auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v,
}
template <class Graph>
inline
inline __attribute__((always_inline))
auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g)
{
......
Markdown is supported
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