Commit d933fe7e authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Annotate some short important functions with 'flatten' attribute

parent beefde29
...@@ -319,7 +319,8 @@ struct graph_traits< const UndirectedAdaptor<Graph> >: ...@@ -319,7 +319,8 @@ struct graph_traits< const UndirectedAdaptor<Graph> >:
// source(e,g) // source(e,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
source(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& e, source(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& e,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
{ {
...@@ -333,7 +334,8 @@ source(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& ...@@ -333,7 +334,8 @@ source(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor&
// target(e,g) // target(e,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
target(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& e, target(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& e,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
{ {
...@@ -347,7 +349,7 @@ target(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor& ...@@ -347,7 +349,7 @@ target(const typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor&
// vertex(n,g) // vertex(n,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor
vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type n, vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type n,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
...@@ -359,7 +361,7 @@ vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type n, ...@@ -359,7 +361,7 @@ vertex(typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type n,
// vertices(g) // vertices(g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::vertex_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::vertex_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::vertex_iterator > typename graph_traits<UndirectedAdaptor<Graph> >::vertex_iterator >
vertices(const UndirectedAdaptor<Graph>& g) vertices(const UndirectedAdaptor<Graph>& g)
...@@ -371,7 +373,7 @@ vertices(const UndirectedAdaptor<Graph>& g) ...@@ -371,7 +373,7 @@ vertices(const UndirectedAdaptor<Graph>& g)
// edges(g) // edges(g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::edge_iterator > typename graph_traits<UndirectedAdaptor<Graph> >::edge_iterator >
edges(const UndirectedAdaptor<Graph>& g) edges(const UndirectedAdaptor<Graph>& g)
...@@ -383,7 +385,7 @@ edges(const UndirectedAdaptor<Graph>& g) ...@@ -383,7 +385,7 @@ edges(const UndirectedAdaptor<Graph>& g)
// edge(u, v, g) // edge(u, v, g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::edge_descriptor,
bool> bool>
edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
...@@ -405,7 +407,7 @@ edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, ...@@ -405,7 +407,7 @@ edge(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// out_edges(u,g) // out_edges(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::out_edge_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::out_edge_iterator,
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, out_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
...@@ -424,7 +426,7 @@ out_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u, ...@@ -424,7 +426,7 @@ out_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
// in_edges(u,g) // in_edges(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::in_edge_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph>>::in_edge_iterator,
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, in_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
...@@ -443,7 +445,7 @@ in_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u, ...@@ -443,7 +445,7 @@ in_edges(typename graph_traits<UndirectedAdaptor<Graph>>::vertex_descriptor u,
// out_neighbours(u, g) // out_neighbours(u, g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator> typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator>
out_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, out_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
...@@ -460,7 +462,7 @@ out_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descript ...@@ -460,7 +462,7 @@ out_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descript
// in_neighbours(u, g) // in_neighbours(u, g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator> typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator>
in_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, in_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
...@@ -473,7 +475,7 @@ in_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descripto ...@@ -473,7 +475,7 @@ in_neighbours(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descripto
// adjacent_vertices(u,g) // adjacent_vertices(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator, std::pair<typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator,
typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator> typename graph_traits<UndirectedAdaptor<Graph> >::adjacency_iterator>
adjacent_vertices adjacent_vertices
...@@ -487,7 +489,7 @@ adjacent_vertices ...@@ -487,7 +489,7 @@ adjacent_vertices
// num_vertices(g) // num_vertices(g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type typename graph_traits<UndirectedAdaptor<Graph> >::vertices_size_type
num_vertices(const UndirectedAdaptor<Graph>& g) num_vertices(const UndirectedAdaptor<Graph>& g)
{ {
...@@ -498,7 +500,7 @@ num_vertices(const UndirectedAdaptor<Graph>& g) ...@@ -498,7 +500,7 @@ num_vertices(const UndirectedAdaptor<Graph>& g)
// num_edges(g) // num_edges(g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::edges_size_type typename graph_traits<UndirectedAdaptor<Graph> >::edges_size_type
num_edges(const UndirectedAdaptor<Graph>& g) num_edges(const UndirectedAdaptor<Graph>& g)
{ {
...@@ -509,7 +511,7 @@ num_edges(const UndirectedAdaptor<Graph>& g) ...@@ -509,7 +511,7 @@ num_edges(const UndirectedAdaptor<Graph>& g)
// out_degree(u,g) // out_degree(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type
out_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, out_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
...@@ -522,7 +524,7 @@ out_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u ...@@ -522,7 +524,7 @@ out_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u
// in_degree(u,g) // in_degree(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type
in_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, in_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
...@@ -534,7 +536,7 @@ in_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, ...@@ -534,7 +536,7 @@ in_degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
// degree(u,g) // degree(u,g)
//============================================================================== //==============================================================================
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type typename graph_traits<UndirectedAdaptor<Graph> >::degree_size_type
degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u, degree(typename graph_traits<UndirectedAdaptor<Graph> >::vertex_descriptor u,
const UndirectedAdaptor<Graph>& g) const UndirectedAdaptor<Graph>& g)
......
...@@ -675,21 +675,21 @@ auto mk_range(std::pair<Iter, Iter>&& range) ...@@ -675,21 +675,21 @@ auto mk_range(std::pair<Iter, Iter>&& range)
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto vertices_range(const Graph& g) auto vertices_range(const Graph& g)
{ {
return mk_range(vertices(g)); return mk_range(vertices(g));
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto edges_range(const Graph& g) auto edges_range(const Graph& g)
{ {
return mk_range(edges(g)); return mk_range(edges(g));
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descriptor v, auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -697,7 +697,7 @@ auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descrip ...@@ -697,7 +697,7 @@ auto adjacent_vertices_range(typename boost::graph_traits<Graph>::vertex_descrip
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v, auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -705,7 +705,7 @@ auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v, ...@@ -705,7 +705,7 @@ auto out_edges_range(typename out_edge_iteratorS<Graph>::vertex_descriptor v,
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto out_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor v, auto out_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -714,7 +714,7 @@ auto out_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor ...@@ -714,7 +714,7 @@ auto out_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v, auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -722,7 +722,7 @@ auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v, ...@@ -722,7 +722,7 @@ auto in_edges_range(typename in_edge_iteratorS<Graph>::vertex_descriptor v,
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto in_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor v, auto in_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -731,7 +731,7 @@ auto in_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor ...@@ -731,7 +731,7 @@ auto in_neighbours_range(typename boost::graph_traits<Graph>::vertex_descriptor
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v, auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -739,7 +739,7 @@ auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v, ...@@ -739,7 +739,7 @@ auto all_edges_range(typename all_edges_iteratorS<Graph>::vertex_descriptor v,
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto all_neighbours_range(typename all_neighbours_iteratorS<Graph>::vertex_descriptor v, auto all_neighbours_range(typename all_neighbours_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -747,7 +747,7 @@ auto all_neighbours_range(typename all_neighbours_iteratorS<Graph>::vertex_descr ...@@ -747,7 +747,7 @@ auto all_neighbours_range(typename all_neighbours_iteratorS<Graph>::vertex_descr
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_descriptor v, auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) const Graph& g)
{ {
...@@ -755,7 +755,7 @@ auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_desc ...@@ -755,7 +755,7 @@ auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_desc
} }
template <class Graph> template <class Graph>
inline __attribute__((always_inline)) inline __attribute__((always_inline)) __attribute__((flatten))
auto in_or_out_neighbours_range(typename in_or_out_edge_iteratorS<Graph>::vertex_descriptor v, auto in_or_out_neighbours_range(typename in_or_out_edge_iteratorS<Graph>::vertex_descriptor v,
const Graph& g) 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