C++ Reference

C++ Reference: Graph

graph.h File Reference

Go to the source code of this file.

Classes

class  SVector< T >
 
class  BaseGraph< NodeIndexType, ArcIndexType, HasReverseArcs >
 
class  ListGraph< NodeIndexType, ArcIndexType >
 
class  StaticGraph< NodeIndexType, ArcIndexType >
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >
 
class  ReverseArcStaticGraph< NodeIndexType, ArcIndexType >
 
class  ReverseArcMixedGraph< NodeIndexType, ArcIndexType >
 
class  SVector< T >
 
class  ListGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 
class  ListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator
 
class  StaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcIterator
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >::IncomingArcIterator
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcIterator
 
class  ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator
 
class  ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 
class  ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcIterator
 
class  ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::IncomingArcIterator
 
class  ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcIterator
 
class  ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 
class  ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcIterator
 
class  ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::IncomingArcIterator
 
class  ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcIterator
 
class  CompleteGraph< NodeIndexType, ArcIndexType >
 
class  CompleteBipartiteGraph< NodeIndexType, ArcIndexType >
 
class  CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
 

Namespaces

 util
 

Macros

#define DEFINE_RANGE_BASED_ARC_ITERATION(c, t, e)
 
#define DEFINE_STL_ITERATOR_FUNCTIONS(iterator_class_name)
 

Typedefs

typedef ListGraph Graph
 

Functions

template<class IntVector , class Array , class ElementType >
void PermuteWithExplicitElementType (const IntVector &permutation, Array *array_to_permute, ElementType unused)
 
template<class IntVector , class Array >
void Permute (const IntVector &permutation, Array *array_to_permute)
 
template<class IntVector >
void Permute (const IntVector &permutation, std::vector< bool > *array_to_permute)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ListGraph, Outgoing, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (StaticGraph, Outgoing, DirectArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcListGraph, Outgoing, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcListGraph, Incoming, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcListGraph, OutgoingOrOppositeIncoming, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcListGraph, OppositeIncoming, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcStaticGraph, Outgoing, DirectArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcStaticGraph, Incoming, ReverseArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcStaticGraph, OutgoingOrOppositeIncoming, DirectArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcStaticGraph, OppositeIncoming, ReverseArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcMixedGraph, Outgoing, DirectArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcMixedGraph, Incoming, Base::kNilArc)
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcMixedGraph, OutgoingOrOppositeIncoming, DirectArcLimit(node))
 
 DEFINE_RANGE_BASED_ARC_ITERATION (ReverseArcMixedGraph, OppositeIncoming, Base::kNilArc)
 

Macro Definition Documentation

◆ DEFINE_RANGE_BASED_ARC_ITERATION

#define DEFINE_RANGE_BASED_ARC_ITERATION (   c,
  t,
 
)
Value:
template <typename NodeIndexType, typename ArcIndexType> \
BeginEndWrapper<typename c<NodeIndexType, ArcIndexType>::t##ArcIterator> \
c<NodeIndexType, ArcIndexType>::t##Arcs(NodeIndexType node) const { \
return BeginEndWrapper<t##ArcIterator>(t##ArcIterator(*this, node), \
t##ArcIterator(*this, node, e)); \
} \
template <typename NodeIndexType, typename ArcIndexType> \
BeginEndWrapper<typename c<NodeIndexType, ArcIndexType>::t##ArcIterator> \
c<NodeIndexType, ArcIndexType>::t##ArcsStartingFrom( \
NodeIndexType node, ArcIndexType from) const { \
return BeginEndWrapper<t##ArcIterator>(t##ArcIterator(*this, node, from), \
t##ArcIterator(*this, node, e)); \
}

Definition at line 1059 of file graph.h.

◆ DEFINE_STL_ITERATOR_FUNCTIONS

#define DEFINE_STL_ITERATOR_FUNCTIONS (   iterator_class_name)
Value:
using iterator_category = std::input_iterator_tag; \
using difference_type = ptrdiff_t; \
using pointer = const ArcIndexType*; \
using reference = const ArcIndexType&; \
using value_type = ArcIndexType; \
bool operator!=(const iterator_class_name& other) const { \
return this->index_ != other.index_; \
} \
bool operator==(const iterator_class_name& other) const { \
return this->index_ == other.index_; \
} \
ArcIndexType operator*() const { return this->Index(); } \
void operator++() { this->Next(); }

Definition at line 1076 of file graph.h.