Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
0d86003c
Commit
0d86003c
authored
Aug 07, 2018
by
Tiago Peixoto
Browse files
Fix in_neighbor selector
parent
e0153068
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph/graph_adjacency.hh
View file @
0d86003c
...
...
@@ -629,6 +629,7 @@ struct graph_traits<adj_list<Vertex> >
typedef
typename
adj_list
<
Vertex
>::
edge_descriptor
edge_descriptor
;
typedef
typename
adj_list
<
Vertex
>::
edge_iterator
edge_iterator
;
typedef
typename
adj_list
<
Vertex
>::
adjacency_iterator
adjacency_iterator
;
typedef
typename
adj_list
<
Vertex
>::
in_adjacency_iterator
in_adjacency_iterator
;
typedef
typename
adj_list
<
Vertex
>::
out_edge_iterator
out_edge_iterator
;
typedef
typename
adj_list
<
Vertex
>::
in_edge_iterator
in_edge_iterator
;
...
...
src/graph/graph_selectors.hh
View file @
0d86003c
...
...
@@ -443,10 +443,10 @@ struct get_in_neighbors
boost
::
directed_tag
>
));
typedef
typename
boost
::
graph_traits
<
Graph
>::
vertex_descriptor
vertex_descriptor
;
typedef
typename
boost
::
graph_traits
<
Graph
>
::
in_
neighbor
_iterator
type
;
typedef
typename
Graph
::
in_
adjacency
_iterator
type
;
inline
__attribute__
((
always_inline
))
static
std
::
pair
<
type
,
type
>
get_
edge
s
(
vertex_descriptor
v
,
const
Graph
&
g
)
static
std
::
pair
<
type
,
type
>
get_
neighbor
s
(
vertex_descriptor
v
,
const
Graph
&
g
)
{
return
in_neighbors
(
v
,
g
);
}
...
...
@@ -460,7 +460,7 @@ struct get_in_neighbors<Graph,std::false_type>
boost
::
undirected_tag
>
));
typedef
typename
boost
::
graph_traits
<
Graph
>::
vertex_descriptor
vertex_descriptor
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
out_neighbors
_iterator
type
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
adjacency
_iterator
type
;
inline
__attribute__
((
always_inline
))
static
std
::
pair
<
type
,
type
>
get_neighbors
(
vertex_descriptor
,
const
Graph
&
)
...
...
@@ -479,7 +479,7 @@ struct in_neighbor_iteratorS
directed_category
;
typedef
typename
std
::
is_convertible
<
directed_category
,
boost
::
directed_tag
>::
type
is_directed
;
typedef
typename
get_in_
edge
s
<
Graph
,
is_directed
>::
type
type
;
typedef
typename
get_in_
neighbor
s
<
Graph
,
is_directed
>::
type
type
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
vertex_descriptor
vertex_descriptor
;
...
...
@@ -491,25 +491,11 @@ struct in_neighbor_iteratorS
}
};
template
<
class
Graph
>
struct
_all_neighbors_in_iteratorS
{
typedef
typename
boost
::
graph_traits
<
Graph
>::
vertex_descriptor
vertex_descriptor
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
in_edge_iterator
type
;
inline
__attribute__
((
always_inline
))
static
std
::
pair
<
type
,
type
>
get_neighbors
(
vertex_descriptor
v
,
const
Graph
&
g
)
{
return
_all_neighbors_ins
(
v
,
g
);
}
};
// out edges selector for completeness
template
<
class
Graph
>
struct
out_neighbor_iteratorS
{
typedef
typename
boost
::
graph_traits
<
Graph
>::
out_neighbors
_iterator
type
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
adjacency
_iterator
type
;
typedef
typename
boost
::
graph_traits
<
Graph
>::
vertex_descriptor
vertex_descriptor
;
...
...
@@ -549,7 +535,7 @@ struct in_or_out_neighbors_iteratorS
<
typename
boost
::
graph_traits
<
Graph
>::
directed_category
,
boost
::
directed_tag
>::
value
,
in_neighbor_iteratorS
<
Graph
>
,
_all
_neighbor
s_in
_iteratorS
<
Graph
>>::
type
out
_neighbor_iteratorS
<
Graph
>>::
type
{};
// range adaptors
...
...
@@ -655,10 +641,10 @@ auto in_or_out_edges_range(typename in_or_out_edge_iteratorS<Graph>::vertex_desc
template
<
class
Graph
>
inline
__attribute__
((
always_inline
))
__attribute__
((
flatten
))
auto
in_or_out_neighbors_range
(
typename
in_or_out_
edge
_iteratorS
<
Graph
>::
vertex_descriptor
v
,
auto
in_or_out_neighbors_range
(
typename
in_or_out_
neighbors
_iteratorS
<
Graph
>::
vertex_descriptor
v
,
const
Graph
&
g
)
{
return
mk_range
(
in_or_out_
edge
_iteratorS
<
Graph
>::
get_neighbors
(
v
,
g
));
return
mk_range
(
in_or_out_
neighbors
_iteratorS
<
Graph
>::
get_neighbors
(
v
,
g
));
}
// useful type lists
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment