Template Class HugenholtzVertex

Class Documentation

template<typename Edge, typename EdgeEquality>
class HugenholtzVertex

HugenholtzVertex represents a sequence of edges arranged into groups by (topological) equivalence.

Template Parameters:
  • Edge – the edge type; it must be EqualityComparable

  • EdgeEquality – type of equality tester for Edge objects; EdgeEquality(const Edge&, const Edge&) must be implicitly convertible to bool and evaluate to true for equivalent arguments.

Public Functions

HugenholtzVertex() = default
HugenholtzVertex(const HugenholtzVertex&) = default
HugenholtzVertex(HugenholtzVertex&&) = default
template<typename EdgeRange, typename = std::enable_if_t<!std::is_same_v<HugenholtzVertex, std::decay_t<EdgeRange>>>>
inline HugenholtzVertex(EdgeRange &&edge_range, EdgeEquality equals = EdgeEquality{})
inline auto num_edges() const

reports the total number of edges

Returns:

the total number of edges

inline auto num_groups() const

reports the total number of groups

Note

since erase() never erases groups, this returns the total number of groups ever constructed, i.e. some of the groups may be empty. Use num_nonempty_groups() to get the number of groups with edges assigned to them.

Returns:

the total number of groups

inline auto num_nonempty_groups() const

reports the number of nonempty groups

Returns:

the number of nonempty groups

inline const auto &group(size_t edge_idx) const

Group accessor

Parameters:

edge_idx – the edge index

Returns:

the group to which this edge belongs

inline const auto &group_at(size_t grp_idx) const

Group accessor

Parameters:

grp_idx – the group ordinal index

Returns:

the group whose ordinal index is group_idx

inline const size_t group_size(size_t edge_idx) const

Group size accessor

Note

this is equivalent to group(edge_idx).size()

Parameters:

edge_idx – the edge index

Returns:

the size of the group to which this edge belongs

inline void erase(size_t edge_idx, const Edge &edge)
Parameters:
  • edge_idx – the ordinal index of the edge to be removed

  • edge – the edge descriptor, only used to assert logic when NDEBUG is not defined

inline void insert(const size_t edge_idx, const Edge &edge)
Parameters:
  • edge_idx – the ordinal index of the edge to be inserted

  • edge – the edge descriptor