Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator Class Reference

#include <graph.h>

Public Member Functions

 OutgoingArcIterator (const StaticGraph &graph, NodeIndexType node)
 
 OutgoingArcIterator (const StaticGraph &graph, NodeIndexType node, ArcIndexType arc)
 
bool Ok () const
 
ArcIndexType Index () const
 
void Next ()
 
 DEFINE_STL_ITERATOR_FUNCTIONS (OutgoingArcIterator)
 

Detailed Description

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
class util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator

Definition at line 1438 of file graph.h.

Constructor & Destructor Documentation

◆ OutgoingArcIterator() [1/2]

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::OutgoingArcIterator ( const StaticGraph & graph,
NodeIndexType node )
inline

Definition at line 1440 of file graph.h.

◆ OutgoingArcIterator() [2/2]

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::OutgoingArcIterator ( const StaticGraph & graph,
NodeIndexType node,
ArcIndexType arc )
inline

Definition at line 1442 of file graph.h.

Member Function Documentation

◆ DEFINE_STL_ITERATOR_FUNCTIONS()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::DEFINE_STL_ITERATOR_FUNCTIONS ( OutgoingArcIterator )

Note(user): we lose a bit by returning a BeginEndWrapper<> on top of this iterator rather than a simple IntegerRange<> on the arc indices. On my computer: around 420M arcs/sec instead of 440M arcs/sec.

However, it is slightly more consistent to do it this way, and we don't have two different codes depending on the way a client iterates on the arcs.

◆ Index()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
ArcIndexType util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::Index ( ) const
inline

Definition at line 1449 of file graph.h.

◆ Next()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::Next ( )
inline

Definition at line 1450 of file graph.h.

◆ Ok()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
bool util::StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator::Ok ( ) const
inline

Definition at line 1448 of file graph.h.


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