|
|
Edge traversal support works in precisely the same way as for Vertices. (See the section, ``Vertex Traversal Support''). All of the member and non-member functions described for Vertices are defined in versions for Edge. The functions below are the non-Ticket versions which change the mark value,
int set_visited(); // sets the visited mark at this Edge to 1 int reset_visited(); // resets the visited mark at this Edge to 0 int set_val(int value); // sets the val mark at this Edge to the // given value
the non-Ticket versions which test the values of the marks,
int visited(); // tests whether this Edge has been visited // (initially 0) int val(); // returns the val mark associated with this // Edge (initially 0)
and the non-member functions which assist in zeroing out marked Edges,
void reset_visited(Set_of_p<Edge>& eset); void reset_val(Set_of_p<Edge>& eset);
The Ticket versions of these functions are also defined. Note that two new Tickets, Vis_e_ticket and Val_e_ticket, which are similar to the Vertex versions but specific to Edges, are required:
int set_visited(const Vis_e_ticket& vis_e_t); int reset_visited(const Vis_e_ticket& vis_e_t); int visited(const Vis_e_ticket& vis_e_t); int set_val(const Val_e_ticket& val_e_t, int value); int val(const Val_e_ticket& val_e_t); reset_visited(const Vis_e_ticket& vis_e_t, Set_of_p<Edge>& eset); reset_val(const Val_e_ticket& val_e_t, Set_of_p<Edge>& eset);
A Vis_e_ticketand Val_e_ticketare obtained in a manner similar to that for Vertices:
Vis_e_ticket vis_e_t = Edge::get_vis_e_ticket(); Val_e_ticket val_e_t = Edge::get_val_e_ticket();
and are freed similarly:
Edge::free_vis_e_ticket(Vis_e_ticket& vis_e_t); Edge::free_val_e_ticket(Val_e_ticket& val_e_t);