edgesBetween renamed to more descriptive weightsBetween

for/release
Denes Matetelki 12 years ago
parent 6da73fb7d3
commit d73dd4e51e

@ -79,9 +79,7 @@ public:
bool contains(const_reference data) const { return find(data) != m_vertices.end(); }
std::vector<const_pointer> vertices() const;
std::vector<const_pointer> neighboursOf(const_reference data) const;
/// @todo come up with a more clear name
std::vector<E> edgesBetween(const_reference source, const_reference destination) const;
std::vector<E> weightsBetween(const_reference source, const_reference destination) const;
std::vector<Edge> edges() const;
// iterators
@ -532,7 +530,7 @@ std::vector<typename Graph<V, E, Alloc>::const_pointer> Graph<V, E, Alloc>::neig
}
template <typename V, typename E, typename Alloc>
std::vector<E> Graph<V, E, Alloc>::edgesBetween(const_reference source, const_reference destination) const
std::vector<E> Graph<V, E, Alloc>::weightsBetween(const_reference source, const_reference destination) const
{
std::vector<E> retval;
typename std::vector<Vertex>::const_iterator vertex_it = find(source);

@ -44,7 +44,7 @@ int main()
assert(g.numberOfEdges() == 1);
{
const std::vector<int> eb = g.edgesBetween(2, 5);
const std::vector<int> eb = g.weightsBetween(2, 5);
assert(eb.size() == 1);
assert(eb[0] == 0);
}

Loading…
Cancel
Save