Rosetta
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
utility::graph::UEVertex< V, E > Class Template Reference

#include <UpperEdgeGraph.hh>

Inheritance diagram for utility::graph::UEVertex< V, E >:
Inheritance graph
[legend]

Public Types

typedef UEVertex< V, E > VertexClass
 
typedef UEEdge< V, E > EdgeClass
 
typedef UpperEdgeGraph< V, E > GraphClass
 
typedef utility::vector1< EdgeClassUpperEdgeVector
 
typedef utility::vector1< EdgeClass >::iterator UpperEdgeListIter
 
typedef utility::vector1< EdgeClass >::const_iterator UpperEdgeListConstIter
 

Public Member Functions

 UEVertex (GraphClass *owner, platform::Size index)
 standard constructor; though if vertices are to be allocated in a single vector1, then this ctor requires creating and destroying an anonymous vertex to add each vertex to the graph... wasteful More...
 
 UEVertex ()
 default constructor; useful for allocating all vertices at once in a single vector1 using the resize() method. Note that both index_ and owner_ are set to 0. This state must be corrected before the vertex is of any use. More...
 
 ~UEVertex () override=default
 dstor, should be non-virtual More...
 
void reserve_edge_space ()
 reserves space for the edges. Due to the nature of vertex construction in the UEGraph, this method should be called separately from the constructor. More...
 
EdgeClassget_edge (platform::Size upper_vertex_id)
 
EdgeClass const * get_edge (platform::Size upper_vertex_id) const
 
bool edge_exists (platform::Size upper_vertex_id)
 
UpperEdgeListIter upper_edge_list_begin ()
 
UpperEdgeListIter upper_edge_list_end ()
 
UpperEdgeListConstIter const_upper_edge_list_begin () const
 
UpperEdgeListConstIter const_upper_edge_list_end () const
 
platform::Size num_upper_neighbors () const
 
platform::Size num_lower_neighbors () const
 
platform::Size num_neighbors () const
 
platform::Size num_neighbors_counting_self () const
 
void drop_all_edges ()
 
Vdata ()
 
V const & data () const
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Private Member Functions

void set_index_and_owner (platform::Size index, GraphClass *owner)
 method for completing the construction of a vertex if the defaul ctor was used. More...
 
void add_edge (platform::Size upper_vertex_index)
 add an edge More...
 
void add_edge (platform::Size upper_vertex_index, E const &edge_data)
 
void note_upper_edge_deleted ()
 
void note_lower_edge_deleted ()
 
void note_lower_edge_added ()
 
void make_edge_vector_current () const
 
void add_edge_common ()
 

Private Attributes

platform::Size index_
 
UpperEdgeVector upper_edges_
 
platform::Size num_upper_edges_
 
platform::Size num_lower_edges_
 
bool lazily_deleted_edges_present_
 
GraphClassowner_
 
V data_
 

Friends

class UEEdge< V, E >
 
class UpperEdgeGraph< V, E >
 

Member Typedef Documentation

◆ EdgeClass

template<class V , class E >
typedef UEEdge< V, E > utility::graph::UEVertex< V, E >::EdgeClass

◆ GraphClass

template<class V , class E >
typedef UpperEdgeGraph< V, E > utility::graph::UEVertex< V, E >::GraphClass

◆ UpperEdgeListConstIter

◆ UpperEdgeListIter

template<class V , class E >
typedef utility::vector1< EdgeClass >::iterator utility::graph::UEVertex< V, E >::UpperEdgeListIter

◆ UpperEdgeVector

template<class V , class E >
typedef utility::vector1< EdgeClass > utility::graph::UEVertex< V, E >::UpperEdgeVector

◆ VertexClass

template<class V , class E >
typedef UEVertex< V, E > utility::graph::UEVertex< V, E >::VertexClass

Constructor & Destructor Documentation

◆ UEVertex() [1/2]

template<class V , class E >
utility::graph::UEVertex< V, E >::UEVertex ( GraphClass owner,
platform::Size  index 
)
inline

standard constructor; though if vertices are to be allocated in a single vector1, then this ctor requires creating and destroying an anonymous vertex to add each vertex to the graph... wasteful

References utility::graph::UEVertex< V, E >::upper_edges_.

◆ UEVertex() [2/2]

template<class V , class E >
utility::graph::UEVertex< V, E >::UEVertex ( )
inline

default constructor; useful for allocating all vertices at once in a single vector1 using the resize() method. Note that both index_ and owner_ are set to 0. This state must be corrected before the vertex is of any use.

References utility::graph::UEVertex< V, E >::upper_edges_.

◆ ~UEVertex()

template<class V , class E >
utility::graph::UEVertex< V, E >::~UEVertex ( )
overridedefault

dstor, should be non-virtual

Member Function Documentation

◆ add_edge() [1/2]

template<class V , class E >
void utility::graph::UEVertex< V, E >::add_edge ( platform::Size  upper_vertex_index)
inlineprivate

add an edge

do not try to use this method or the other add_edge method to add edges to a vertex; they are for class UpperEdgeGraph only. Invoke add_edge on the graph itself.

References utility::graph::UEVertex< V, E >::add_edge_common(), utility::graph::UEVertex< V, E >::index_, utility::graph::UEVertex< V, E >::owner_, and utility::graph::UEVertex< V, E >::upper_edges_.

◆ add_edge() [2/2]

template<class V , class E >
void utility::graph::UEVertex< V, E >::add_edge ( platform::Size  upper_vertex_index,
E const &  edge_data 
)
inlineprivate

◆ add_edge_common()

template<class V , class E >
void utility::graph::UEVertex< V, E >::add_edge_common ( )
inlineprivate

◆ const_upper_edge_list_begin()

template<class V , class E >
UpperEdgeListConstIter utility::graph::UEVertex< V, E >::const_upper_edge_list_begin ( ) const
inline

◆ const_upper_edge_list_end()

template<class V , class E >
UpperEdgeListConstIter utility::graph::UEVertex< V, E >::const_upper_edge_list_end ( ) const
inline

◆ data() [1/2]

template<class V , class E >
V& utility::graph::UEVertex< V, E >::data ( )
inline

◆ data() [2/2]

template<class V , class E >
V const& utility::graph::UEVertex< V, E >::data ( ) const
inline

◆ drop_all_edges()

template<class V , class E >
void utility::graph::UEVertex< V, E >::drop_all_edges ( )
inline

◆ edge_exists()

template<class V , class E >
bool utility::graph::UEVertex< V, E >::edge_exists ( platform::Size  upper_vertex_id)
inline

◆ get_edge() [1/2]

template<class V , class E >
EdgeClass* utility::graph::UEVertex< V, E >::get_edge ( platform::Size  upper_vertex_id)
inline

◆ get_edge() [2/2]

template<class V , class E >
EdgeClass const* utility::graph::UEVertex< V, E >::get_edge ( platform::Size  upper_vertex_id) const
inline

◆ make_edge_vector_current()

template<class V , class E >
void utility::graph::UEVertex< V, E >::make_edge_vector_current ( ) const
inlineprivate

◆ note_lower_edge_added()

template<class V , class E >
void utility::graph::UEVertex< V, E >::note_lower_edge_added ( )
inlineprivate

◆ note_lower_edge_deleted()

template<class V , class E >
void utility::graph::UEVertex< V, E >::note_lower_edge_deleted ( )
inlineprivate

◆ note_upper_edge_deleted()

template<class V , class E >
void utility::graph::UEVertex< V, E >::note_upper_edge_deleted ( )
inlineprivate

◆ num_lower_neighbors()

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_lower_neighbors ( ) const
inline

◆ num_neighbors()

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_neighbors ( ) const
inline

◆ num_neighbors_counting_self()

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_neighbors_counting_self ( ) const
inline

◆ num_upper_neighbors()

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_upper_neighbors ( ) const
inline

◆ reserve_edge_space()

template<class V , class E >
void utility::graph::UEVertex< V, E >::reserve_edge_space ( )
inline

reserves space for the edges. Due to the nature of vertex construction in the UEGraph, this method should be called separately from the constructor.

class V must define a static member "NUM_EDGES_TO_RESERVE()"; the UEVertex constructor allocates space for that many edges – if fewer than that many edges are added to a sigle node, then new() need never be called. if more are added, the class does not crash – it simply grows the vector out

References utility::graph::UEVertex< V, E >::upper_edges_.

◆ set_index_and_owner()

template<class V , class E >
void utility::graph::UEVertex< V, E >::set_index_and_owner ( platform::Size  index,
GraphClass owner 
)
inlineprivate

method for completing the construction of a vertex if the defaul ctor was used.

to be called by class UEGraph only

References debug_assert, utility::graph::UEVertex< V, E >::index_, and utility::graph::UEVertex< V, E >::owner_.

◆ upper_edge_list_begin()

template<class V , class E >
UpperEdgeListIter utility::graph::UEVertex< V, E >::upper_edge_list_begin ( )
inline

◆ upper_edge_list_end()

template<class V , class E >
UpperEdgeListIter utility::graph::UEVertex< V, E >::upper_edge_list_end ( )
inline

Friends And Related Function Documentation

◆ UEEdge< V, E >

template<class V , class E >
friend class UEEdge< V, E >
friend

◆ UpperEdgeGraph< V, E >

template<class V , class E >
friend class UpperEdgeGraph< V, E >
friend

Member Data Documentation

◆ data_

template<class V , class E >
V utility::graph::UEVertex< V, E >::data_
private

◆ index_

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::index_
private

◆ lazily_deleted_edges_present_

template<class V , class E >
bool utility::graph::UEVertex< V, E >::lazily_deleted_edges_present_
mutableprivate

◆ num_lower_edges_

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_lower_edges_
private

◆ num_upper_edges_

template<class V , class E >
platform::Size utility::graph::UEVertex< V, E >::num_upper_edges_
private

◆ owner_

template<class V , class E >
GraphClass* utility::graph::UEVertex< V, E >::owner_
private

◆ upper_edges_

template<class V , class E >
UpperEdgeVector utility::graph::UEVertex< V, E >::upper_edges_
mutableprivate

The documentation for this class was generated from the following files: