Commit e9a1b2e4 authored by Tiago Peixoto's avatar Tiago Peixoto

Enforce consistent American spelling in API and documentation

This essentially replaces "neighbours" by "neighbors" throughout.

Aliases using the British spelling (e.g. Vertex.out_neighbours()) are
preserved for compatibility.
parent ae68c0c4
Pipeline #365 failed with stage
in 0 seconds
......@@ -4,7 +4,7 @@ graph-tool -- an efficient python module for analysis of graphs
graph-tool is an efficient python module for manipulation and
statistical analysis of graphs. It contains several general graph
measurements, data structures and algorithms, such as vertex and edge
properties, online graph filtering, nearest neighbour statistics,
properties, online graph filtering, nearest neighbor statistics,
clustering, interactive graph layout, random graph generation, detection
of community structure, and more.
......
......@@ -69,7 +69,7 @@ def update_state():
if (norm(pos[s1].a - pos[t2].a) <= norm(pos[s1].a - pos[t1].a) and
s1 != t2 and # no self-loops
t1.out_degree() > 1 and # no isolated vertices
t2 not in s1.out_neighbours()): # no parallel edges
t2 not in s1.out_neighbors()): # no parallel edges
g.remove_edge(edges[i])
edges[i] = g.add_edge(s1, t2)
......
......@@ -5,7 +5,7 @@
# simple simulation of an S->I->R->S epidemic model, where each vertex can be in
# one of the following states: Susceptible (S), infected (I), recovered (R). A
# vertex in the S state becomes infected either spontaneously with a probability
# 'x' or because a neighbour is infected. An infected node becomes recovered
# 'x' or because a neighbor is infected. An infected node becomes recovered
# with probability 'r', and a recovered vertex becomes again susceptible with
# probability 's'.
......@@ -43,7 +43,7 @@ r = 0.1 # I->R probability
s = 0.01 # R->S probability
# (Note that the S->I transition happens simultaneously for every vertex with a
# probability equal to the fraction of non-recovered neighbours which are
# probability equal to the fraction of non-recovered neighbors which are
# infected.)
# The states would usually be represented with simple integers, but here we will
......@@ -103,9 +103,9 @@ def update_state():
if random() < x:
state[v] = I
else:
ns = list(v.out_neighbours())
ns = list(v.out_neighbors())
if len(ns) > 0:
w = ns[randint(0, len(ns))] # choose a random neighbour
w = ns[randint(0, len(ns))] # choose a random neighbor
if state[w] == I:
state[v] = I
newly_infected[v] = True
......
......@@ -5,7 +5,7 @@
# simple simulation of an S->I->R->S epidemic model, where each vertex can be in
# one of the following states: Susceptible (S), infected (I), recovered (R). A
# vertex in the S state becomes infected either spontaneously with a probability
# 'x' or because a neighbour is infected. An infected node becomes recovered
# 'x' or because a neighbor is infected. An infected node becomes recovered
# with probability 'r', and a recovered vertex becomes again susceptible with
# probability 's'.
......@@ -41,7 +41,7 @@ r = 0.1 # I->R probability
s = 0.01 # R->S probability
# (Note that the S->I transition happens simultaneously for every vertex with a
# probability equal to the fraction of non-recovered neighbours which are
# probability equal to the fraction of non-recovered neighbors which are
# infected.)
S = 0
......@@ -116,9 +116,9 @@ def update_state():
if random() < x:
state[v] = I
else:
ns = list(v.out_neighbours())
ns = list(v.out_neighbors())
if len(ns) > 0:
w = ns[randint(0, len(ns))] # choose a random neighbour
w = ns[randint(0, len(ns))] # choose a random neighbor
if state[w] == I:
state[v] = I
newly_infected[v] = True
......@@ -128,7 +128,7 @@ def update_state():
removed[v] = True
if state[v] == S:
if I in [state[w] for w in v.out_neighbours()]:
if I in [state[w] for w in v.out_neighbors()]:
vertex_sfcs[v] = Simg_fear
else:
vertex_sfcs[v] = Simg
......
......@@ -29,8 +29,8 @@
.. automethod:: get_edges
.. automethod:: get_out_edges
.. automethod:: get_in_edges
.. automethod:: get_out_neighbours
.. automethod:: get_in_neighbours
.. automethod:: get_out_neighbors
.. automethod:: get_in_neighbors
.. automethod:: get_out_degrees
.. automethod:: get_in_degrees
......
......@@ -52,9 +52,9 @@ like ``less`` or ``hexdump``:
The adjacency list now follows, beginning with a Boolean byte specifying
whether or not the graph is directed (``0x00``: undirected, ``0x01``:
directed), and 8 bytes (``uint64_t``) containing the number of nodes,
``N``. It is followed by the list of out-neighbours of all ``N`` nodes
``N``. It is followed by the list of out-neighbors of all ``N`` nodes
in sequence. The sequence itself determines implicitly the index of the
nodes, in the range from ``0`` to ``N-1``. The list of out-neighbours of
nodes, in the range from ``0`` to ``N-1``. The list of out-neighbors of
a given node is composed of a length (8 bytes, ``uint64_t``) and a
sequence of node indexes with this length. The number of bytes ``d``
used to encode the node indexes in this list is determined by the value
......@@ -62,7 +62,7 @@ of ``N``, and will be the smallest value of the set ``{1, 2, 4, 8}``
(i.e. ``{uint8_t, uint16_t, uint32_t, uint64_t}``, respectively) which
is sufficient to accommodate all ``N`` nodes. For undirected graphs,
here it is important that each edge appears only once, i.e. if node
``u`` appears in the list of neighbours of ``v``, then ``v`` **should
``u`` appears in the list of neighbors of ``v``, then ``v`` **should
not** appear in the list of ``u`` again, otherwise it will be considered
as a different (parallel) edge. In this way, the total number of bytes
used for the adjacency is ``1 + 8 + N * 8 + E * d`` with ``E`` being the
......
......@@ -70,7 +70,7 @@ while True:
break
n_list = []
for w in v.out_neighbours():
for w in v.out_neighbors():
n_list.append(w)
v = n_list[randint(0, len(n_list))]
......
......@@ -292,13 +292,13 @@ methods should be used:
The code above will print the vertices and edges of the graph in the order they
are found.
Iterating over the neighbourhood of a vertex
Iterating over the neighborhood of a vertex
""""""""""""""""""""""""""""""""""""""""""""
The out- and in-edges of a vertex, as well as the out- and in-neighbours can be
The out- and in-edges of a vertex, as well as the out- and in-neighbors can be
iterated through with the :meth:`~graph_tool.Vertex.out_edges`,
:meth:`~graph_tool.Vertex.in_edges`, :meth:`~graph_tool.Vertex.out_neighbours`
and :meth:`~graph_tool.Vertex.in_neighbours` methods, respectively.
:meth:`~graph_tool.Vertex.in_edges`, :meth:`~graph_tool.Vertex.out_neighbors`
and :meth:`~graph_tool.Vertex.in_neighbors` methods, respectively.
.. doctest::
......@@ -306,14 +306,14 @@ and :meth:`~graph_tool.Vertex.in_neighbours` methods, respectively.
for v in g.vertices():
for e in v.out_edges():
print(e)
for w in v.out_neighbours():
for w in v.out_neighbors():
print(w)
# the edge and neighbours order always match
for e, w in izip(v.out_edges(), v.out_neighbours()):
# the edge and neighbors order always match
for e, w in izip(v.out_edges(), v.out_neighbors()):
assert(e.target() == w)
The code above will print the out-edges and out-neighbours of all
The code above will print the out-edges and out-neighbors of all
vertices in the graph.
.. warning::
......@@ -338,8 +338,8 @@ done with the :meth:`~graph_tool.Graph.get_vertices`,
:meth:`~graph_tool.Graph.get_edges`,
:meth:`~graph_tool.Graph.get_out_edges`,
:meth:`~graph_tool.Graph.get_in_edges`,
:meth:`~graph_tool.Graph.get_out_neighbours`,
:meth:`~graph_tool.Graph.get_in_neighbours`,
:meth:`~graph_tool.Graph.get_out_neighbors`,
:meth:`~graph_tool.Graph.get_in_neighbors`,
:meth:`~graph_tool.Graph.get_out_degrees` and
:meth:`~graph_tool.Graph.get_in_degrees` methods, which return
:class:`numpy.ndarray` instances instead of iterators.
......
......@@ -80,7 +80,7 @@ struct bfs_max_depth_watcher
template<class Graph, class Vertex, class Targets, class DirectedCategory>
void collect_targets(Vertex v, Graph& g, Targets& t, DirectedCategory)
{
for (auto u : in_neighbours_range(v, g))
for (auto u : in_neighbors_range(v, g))
{
if (u == v) // no self-loops
continue;
......@@ -93,7 +93,7 @@ void collect_targets(Vertex v, Graph& g, Targets& t, DirectedCategory)
template<class Graph, class Vertex, class Targets>
void collect_targets(Vertex v, Graph& g, Targets& t, undirected_tag)
{
for (auto u : out_neighbours_range(v, g))
for (auto u : out_neighbors_range(v, g))
{
if (u == v) // no self-loops
continue;
......@@ -123,11 +123,11 @@ struct get_extended_clustering
fg_t fg(g, keep_all(), filter_t(v));
typedef DescriptorHash<IndexMap> hasher_t;
typedef gt_hash_set<vertex_t,hasher_t> neighbour_set_t;
neighbour_set_t neighbours(0, hasher_t(vertex_index));
neighbour_set_t targets(0, hasher_t(vertex_index));
typedef gt_hash_set<vertex_t,hasher_t> neighbor_set_t;
neighbor_set_t neighbors(0, hasher_t(vertex_index));
neighbor_set_t targets(0, hasher_t(vertex_index));
// collect targets, neighbours and calculate normalization factor
// collect targets, neighbors and calculate normalization factor
collect_targets(v, g, targets,
typename graph_traits<Graph>::directed_category());
size_t k_in = targets.size(), k_out, k_inter=0, z;
......@@ -135,19 +135,19 @@ struct get_extended_clustering
{
if (u == v) // no self-loops
continue;
if (neighbours.find(u) != neighbours.end()) // avoid parallel
if (neighbors.find(u) != neighbors.end()) // avoid parallel
continue; // edges
neighbours.insert(u);
neighbors.insert(u);
if (targets.find(u) != targets.end())
++k_inter;
}
k_out = neighbours.size();
k_out = neighbors.size();
z = (k_in * k_out) - k_inter;
// And now we setup and start the BFS bonanza
for (auto u : neighbours)
for (auto u : neighbors)
{
typedef gt_hash_map<vertex_t,size_t,
DescriptorHash<IndexMap> > dmap_t;
......@@ -164,9 +164,9 @@ struct get_extended_clustering
try
{
distance_map[u] = 0;
neighbour_set_t specific_targets = targets;
neighbor_set_t specific_targets = targets;
specific_targets.erase(u);
bfs_max_depth_watcher<neighbour_set_t,
bfs_max_depth_watcher<neighbor_set_t,
InitializedPropertyMap<dmap_t> >
watcher(specific_targets, cmaps.size(),
distance_map);
......
......@@ -60,7 +60,7 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
// extension and subgraph stack
std::vector<std::vector<vertex_t>> ext_stack(1);
std::vector<std::vector<vertex_t>> sub_stack(1);
std::vector<std::vector<vertex_t>> sub_neighbours_stack(1);
std::vector<std::vector<vertex_t>> sub_neighbors_stack(1);
sub_stack[0].push_back(v);
for (auto e : out_edges_range(v, g))
......@@ -69,7 +69,7 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
if (u > v && !has_val(ext_stack[0], u))
{
insert_sorted(ext_stack[0], u);
insert_sorted(sub_neighbours_stack[0],u);
insert_sorted(sub_neighbors_stack[0],u);
}
}
......@@ -77,7 +77,7 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
{
std::vector<vertex_t>& ext = ext_stack.back();
std::vector<vertex_t>& sub = sub_stack.back();
std::vector<vertex_t>& sub_neighbours = sub_neighbours_stack.back();
std::vector<vertex_t>& sub_neighbors = sub_neighbors_stack.back();
if (sub.size() == n)
{
......@@ -86,7 +86,7 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
subgraphs.push_back(sub);
sub_stack.pop_back();
ext_stack.pop_back();
sub_neighbours_stack.pop_back();
sub_neighbors_stack.pop_back();
continue;
}
......@@ -95,14 +95,14 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
// no where else to go
ext_stack.pop_back();
sub_stack.pop_back();
sub_neighbours_stack.pop_back();
sub_neighbors_stack.pop_back();
continue;
}
else
{
// extend subgraph
std::vector<vertex_t> new_ext, new_sub = sub,
new_sub_neighbours = sub_neighbours;
new_sub_neighbors = sub_neighbors;
// remove w from ext
vertex_t w = ext.back();
......@@ -118,9 +118,9 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
vertex_t u = target(e, g);
if (u > v)
{
if (!has_val(sub_neighbours, u))
if (!has_val(sub_neighbors, u))
insert_sorted(new_ext, u);
insert_sorted(new_sub_neighbours, u);
insert_sorted(new_sub_neighbors, u);
}
}
......@@ -128,7 +128,7 @@ void get_subgraphs(Graph& g, typename boost::graph_traits<Graph>::vertex_descrip
ext_stack.push_back(new_ext);
sub_stack.push_back(new_sub);
sub_neighbours_stack.push_back(new_sub_neighbours);
sub_neighbors_stack.push_back(new_sub_neighbors);
}
}
}
......
......@@ -52,7 +52,7 @@ struct get_assortativity_coefficient
[&](auto v)
{
val_t k1 = deg(v, g);
for (auto w : out_neighbours_range(v, g))
for (auto w : out_neighbors_range(v, g))
{
val_t k2 = deg(w, g);
if (k1 == k2)
......@@ -88,7 +88,7 @@ struct get_assortativity_coefficient
[&](auto v)
{
val_t k1 = deg(v, g);
for (auto w : out_neighbours_range(v, g))
for (auto w : out_neighbors_range(v, g))
{
val_t k2 = deg(w, g);
double tl2 = (t2 * (n_edges * n_edges)
......@@ -128,7 +128,7 @@ struct get_scalar_assortativity_coefficient
[&](auto v)
{
double k1 = double(deg(v, g));
for (auto u : out_neighbours_range(v, g))
for (auto u : out_neighbors_range(v, g))
{
auto k2 = deg(u, g);
a += k1;
......@@ -166,7 +166,7 @@ struct get_scalar_assortativity_coefficient
double al = (a * n_edges - k1) / (n_edges - one);
double dal = sqrt((da - k1 * k1) / (n_edges - one) - al * al);
for (auto u : out_neighbours_range(v, g))
for (auto u : out_neighbors_range(v, g))
{
double k2 = deg(u, g);
double bl = (b * n_edges - k2 * one) / (n_edges - one);
......
......@@ -65,7 +65,7 @@ get_vertex_avg_correlation(GraphInterface& gi,
try
{
run_action<>()(gi, get_avg_correlation<GetNeighboursPairs>
run_action<>()(gi, get_avg_correlation<GetNeighborsPairs>
(avg, dev, bins, ret_bins),
scalar_selectors(), scalar_selectors(),
boost::mpl::vector<cweight_map_t>())
......
......@@ -36,7 +36,7 @@ void graph_avg_corr_imp1(GraphInterface& g, boost::python::object& avg,
{
typedef DynamicPropertyMapWrap<long double, GraphInterface::edge_t>
wrapped_weight_t;
run_action<>()(g, get_avg_correlation<GetNeighboursPairs>
run_action<>()(g, get_avg_correlation<GetNeighborsPairs>
(avg, dev, bins, ret_bins),
scalar_selectors(), scalar_selectors(),
boost::mpl::vector<wrapped_weight_t>())
......
......@@ -71,7 +71,7 @@ get_vertex_correlation_histogram(GraphInterface& gi,
try
{
run_action<>()(gi, get_correlation_histogram<GetNeighboursPairs>
run_action<>()(gi, get_correlation_histogram<GetNeighborsPairs>
(hist, bins, ret_bins),
scalar_selectors(), scalar_selectors(),
boost::mpl::vector<cweight_map_t>())
......
......@@ -33,8 +33,8 @@ namespace graph_tool
using namespace std;
using namespace boost;
// get degrees pairs from source and of neighbours
class GetNeighboursPairs
// get degrees pairs from source and of neighbors
class GetNeighborsPairs
{
public:
......
......@@ -37,7 +37,7 @@ void graph_correlations_imp1(GraphInterface& g, boost::python::object& hist,
{
typedef DynamicPropertyMapWrap<long double, GraphInterface::edge_t>
wrapped_weight_t;
run_action<>()(g, get_correlation_histogram<GetNeighboursPairs>
run_action<>()(g, get_correlation_histogram<GetNeighborsPairs>
(hist, bins, ret_bins),
scalar_selectors(), scalar_selectors(),
boost::mpl::vector<wrapped_weight_t>())
......
......@@ -242,39 +242,39 @@ all_edges(typename graph_traits<undirected_adaptor<Graph>>::vertex_descriptor u,
}
//==============================================================================
// out_neighbours(u, g)
// out_neighbors(u, g)
//==============================================================================
template <class Graph>
inline __attribute__((always_inline)) __attribute__((flatten))
auto
out_neighbours(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
out_neighbors(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
const undirected_adaptor<Graph>& g)
{
return all_neighbours(u, g.original_graph());
return all_neighbors(u, g.original_graph());
}
//==============================================================================
// in_neighbours(u, g)
// in_neighbors(u, g)
//==============================================================================
template <class Graph>
inline __attribute__((always_inline)) __attribute__((flatten))
auto
in_neighbours(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
in_neighbors(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
const undirected_adaptor<Graph>& g)
{
return out_neighbours(u, g);
return out_neighbors(u, g);
}
//==============================================================================
// all_neighbours(u, g)
// all_neighbors(u, g)
//==============================================================================
template <class Graph>
inline __attribute__((always_inline)) __attribute__((flatten))
auto
all_neighbours(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
all_neighbors(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
const undirected_adaptor<Graph>& g)
{
return out_neighbours(u, g);
return out_neighbors(u, g);
}
//==============================================================================
......@@ -287,7 +287,7 @@ adjacent_vertices
(typename graph_traits<undirected_adaptor<Graph> >::vertex_descriptor u,
const undirected_adaptor<Graph>& g)
{
return out_neighbours(u, g);
return out_neighbors(u, g);
}
//==============================================================================
......
......@@ -107,17 +107,17 @@ adjacent_vertices(Vertex v, const adj_list<Vertex>& g);
template <class Vertex>
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
out_neighbours(Vertex v, const adj_list<Vertex>& g);
out_neighbors(Vertex v, const adj_list<Vertex>& g);
template <class Vertex>
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
in_neighbours(Vertex v, const adj_list<Vertex>& g);
in_neighbors(Vertex v, const adj_list<Vertex>& g);
template <class Vertex>
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
all_neighbours(Vertex v, const adj_list<Vertex>& g);
all_neighbors(Vertex v, const adj_list<Vertex>& g);
template <class Vertex>
size_t num_vertices(const adj_list<Vertex>& g);
......@@ -554,13 +554,13 @@ private:
adjacent_vertices<>(Vertex v, const adj_list<Vertex>& g);
friend std::pair<adjacency_iterator, adjacency_iterator>
out_neighbours<>(Vertex v, const adj_list<Vertex>& g);
out_neighbors<>(Vertex v, const adj_list<Vertex>& g);
friend std::pair<adjacency_iterator, adjacency_iterator>
in_neighbours<>(Vertex v, const adj_list<Vertex>& g);
in_neighbors<>(Vertex v, const adj_list<Vertex>& g);
friend std::pair<adjacency_iterator, adjacency_iterator>
all_neighbours<>(Vertex v, const adj_list<Vertex>& g);
all_neighbors<>(Vertex v, const adj_list<Vertex>& g);
friend size_t num_vertices<>(const adj_list<Vertex>& g);
......@@ -826,7 +826,7 @@ template <class Vertex>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
out_neighbours(Vertex v, const adj_list<Vertex>& g)
out_neighbors(Vertex v, const adj_list<Vertex>& g)
{
typedef typename adj_list<Vertex>::adjacency_iterator ai_t;
const auto& pes = g._edges[v];
......@@ -839,7 +839,7 @@ template <class Vertex>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
in_neighbours(Vertex v, const adj_list<Vertex>& g)
in_neighbors(Vertex v, const adj_list<Vertex>& g)
{
typedef typename adj_list<Vertex>::adjacency_iterator ai_t;
const auto& pes = g._edges[v];
......@@ -852,7 +852,7 @@ template <class Vertex>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
all_neighbours(Vertex v, const adj_list<Vertex>& g)
all_neighbors(Vertex v, const adj_list<Vertex>& g)
{
typedef typename adj_list<Vertex>::adjacency_iterator ai_t;
const auto& pes = g._edges[v];
......@@ -866,7 +866,7 @@ std::pair<typename adj_list<Vertex>::adjacency_iterator,
typename adj_list<Vertex>::adjacency_iterator>
adjacent_vertices(Vertex v, const adj_list<Vertex>& g)
{
return out_neighbours(v, g);
return out_neighbors(v, g);
}
......
......@@ -415,7 +415,7 @@ template <typename G, typename EP, typename VP>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename filt_graph<G, EP, VP>::adjacency_iterator,
typename filt_graph<G, EP, VP>::adjacency_iterator>
out_neighbours(typename filt_graph<G, EP, VP>::vertex_descriptor u,
out_neighbors(typename filt_graph<G, EP, VP>::vertex_descriptor u,
const filt_graph<G, EP, VP>& g)
{
typedef filt_graph<G, EP, VP> Graph;
......@@ -429,7 +429,7 @@ template <typename G, typename EP, typename VP>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename filt_graph<G, EP, VP>::in_adjacency_iterator,
typename filt_graph<G, EP, VP>::in_adjacency_iterator>
in_neighbours(typename filt_graph<G, EP, VP>::vertex_descriptor u,
in_neighbors(typename filt_graph<G, EP, VP>::vertex_descriptor u,
const filt_graph<G, EP, VP>& g)
{
typedef filt_graph<G, EP, VP> Graph;
......@@ -443,7 +443,7 @@ template <typename G, typename EP, typename VP>
inline __attribute__((always_inline)) __attribute__((flatten))
std::pair<typename filt_graph<G, EP, VP>::adjacency_iterator,
typename filt_graph<G, EP, VP>::adjacency_iterator>
all_neighbours(typename filt_graph<G, EP, VP>::vertex_descriptor u,
all_neighbors(typename filt_graph<G, EP, VP>::vertex_descriptor u,
const filt_graph<G, EP, VP>& g)
{
typedef filt_graph<G, EP, VP> Graph;
......@@ -460,7 +460,7 @@ std::pair<typename filt_graph<G, EP, VP>::adjacency_iterator,
adjacent_vertices(typename filt_graph<G, EP, VP>::vertex_descriptor u,
const filt_graph<G, EP, VP>& g)
{
return out_neighbours(u, g);
return out_neighbors(u, g);
}
template <typename G, typename EP, typename VP>
......
......@@ -417,7 +417,7 @@ python::object get_in_edge_list(GraphInterface& gi, size_t v)
return wrap_vector_owned(elist);
}
python::object get_out_neighbours_list(GraphInterface& gi, size_t v)
python::object get_out_neighbors_list(GraphInterface& gi, size_t v)
{
std::vector<size_t> vlist;
run_action<>()(gi,
......@@ -427,13 +427,13 @@ python::object get_out_neighbours_list(GraphInterface& gi, size_t v)
throw ValueException("invalid vertex: " +
lexical_cast<string>(v));
vlist.reserve(out_degree(v, g));
for (auto u: out_neighbours_range(v, g))
for (auto u: out_neighbors_range(v, g))
vlist.push_back(u);
})();
return wrap_vector_owned(vlist);
}
python::object get_in_neighbours_list(GraphInterface& gi, size_t v)
python::object get_in_neighbors_list(GraphInterface& gi, size_t v)
{
std::vector<size_t> vlist;
run_action<>()(gi,
......@@ -443,7 +443,7 @@ python::object get_in_neighbours_list(GraphInterface& gi, size_t v)
throw ValueException("invalid vertex: " +
lexical_cast<string>(v));
vlist.reserve(in_degree(v, g));
for (auto u: in_neighbours_range(v, g))
for (auto u: in_neighbors_range(v, g))
vlist.push_back(u);
})();
return wrap_vector_owned(vlist);
......@@ -728,8 +728,8 @@ void export_python_interface()
def("get_edge_list", get_edge_list);
def("get_out_edge_list", get_out_edge_list);
def("get_in_edge_list", get_in_edge_list);
def("get_out_neighbours_list", get_out_neighbours_list);
def("get_in_neighbours_list", get_in_neighbours_list);
def("get_out_neighbors_list", get_out_neighbors_list);
def("get_in_neighbors_list", get_in_neighbors_list);
def("get_degree_list", get_degree_list);
def("get_vertex_index", get_vertex_index);
......
......@@ -206,28 +206,28 @@ all_edges(const typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
template <class BidirectionalGraph, class GRef>
inline std::pair<typename reversed_graph<BidirectionalGraph,GRef>::adjacency_iterator,
typename reversed_graph<BidirectionalGraph,GRef>::adjacency_iterator>
out_neighbours(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
out_neighbors(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
const reversed_graph<BidirectionalGraph,GRef>& g)
{
return in_neighbours(u, g._g);
return in_neighbors(u, g._g);
}
template <class BidirectionalGraph, class GRef>
inline std::pair<typename reversed_graph<BidirectionalGraph,GRef>::in_adjacency_iterator,
typename reversed_graph<BidirectionalGraph,GRef>::in_adjacency_iterator>
in_neighbours(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
in_neighbors(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
const reversed_graph<BidirectionalGraph,GRef>& g)
{
return out_neighbours(u, g._g);
return out_neighbors(u, g._g);
}
template <class BidirectionalGraph, class GRef>
inline std::pair<typename reversed_graph<BidirectionalGraph,GRef>::adjacency_iterator,
typename reversed_graph<BidirectionalGraph,GRef>::adjacency_iterator>
all_neighbours(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
all_neighbors(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
const reversed_graph<BidirectionalGraph,GRef>& g)
{
return all_neighbours(u, g._g);
return all_neighbors(u, g._g);
}
template <class BidirectionalGraph, class GRef>
......@@ -236,7 +236,7 @@ inline std::pair<typename reversed_graph<BidirectionalGraph,GRef>::adjacency_ite
adjacent_vertices(typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
const reversed_graph<BidirectionalGraph,GRef>& g)
{
return out_neighbours(u, g);
return out_neighbors(u, g);
}
......
......@@ -415,10 +415,10 @@ struct in_or_out_edge_iteratorS
out_edge_iteratorS<Graph>>::type
{};
// helper types for in_neighbour_iteratorS
// helper types for in_neighbor_iteratorS
template <class Graph, class IsDirected>
struct get_in_neighbours
struct get_in_neighbors
{
BOOST_MPL_ASSERT((std::is_same<IsDirected,std::true_type>));
BOOST_MPL_ASSERT((std::is_convertible
......@@ -426,37 +426,37 @@ struct get_in_neighbours
boost::directed_tag>));
typedef typename boost::graph_traits<Graph>::vertex_descriptor
vertex_descriptor;
typedef typename boost::graph_traits<Graph>::in_neighbour_iterator type;
typedef typename boost::graph_traits<Graph>::in_neighbor_iterator type;
inline __attribute__((always_inline))
static std::pair<type,type> get_edges(vertex_descriptor v,
const Graph& g)
{
return in_neighbours(v, g);
return in_neighbors(v, g);
}
};
template <class Graph>
struct get_in_neighbours<Graph,std::false_type>
struct get_in_neighbors<Graph,std::false_type>
{
BOOST_MPL_ASSERT((std::is_convertible
<typename boost::graph_traits<Graph>::directed_category,
boost::undirected_tag>));
typedef typename