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

Detailed Description

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

Definition at line 52 of file flow_graph.h.

#include <flow_graph.h>

Inheritance diagram for util::FlowGraph< NodeIndexType, ArcIndexType >:
util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >

Public Member Functions

 FlowGraph ()=default
 FlowGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity)
NodeIndexType Head (ArcIndexType arc) const
NodeIndexType Tail (ArcIndexType arc) const
ArcIndexType OppositeArc (ArcIndexType arc) const
util::IntegerRange< ArcIndexType > OutgoingArcs (NodeIndexType node) const
util::IntegerRange< ArcIndexType > OutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const
util::IntegerRange< ArcIndexType > OutgoingOrOppositeIncomingArcs (NodeIndexType node) const
util::IntegerRange< ArcIndexType > OutgoingOrOppositeIncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const
absl::Span< const NodeIndexType > operator[] (NodeIndexType node) const
void ReserveArcs (ArcIndexType bound) override
void AddNode (NodeIndexType node)
ArcIndexType AddArc (NodeIndexType tail, NodeIndexType head)
void Build ()
void Build (std::vector< ArcIndexType > *permutation) final
void SetDetectReverse (bool value)
void SetSortByHead (bool value)
Public Member Functions inherited from util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >
 BaseGraph ()
BaseGraphoperator= (const BaseGraph &)=default
virtual ~BaseGraph ()=default
int32_t num_nodes () const
int32_t size () const
int32_t num_arcs () const
IntegerRange< NodeIndexAllNodes () const
IntegerRange< ArcIndexAllForwardArcs () const
bool IsNodeValid (int32_t node) const
bool IsArcValid (int32_t arc) const
int32_t node_capacity () const
int32_t arc_capacity () const
virtual void ReserveNodes (int32_t bound)
virtual void ReserveArcs (int32_t bound)
void Reserve (int32_t node_capacity, int32_t arc_capacity)
void FreezeCapacities ()
virtual void Build (std::vector< int32_t > *permutation)
virtual bool IsBuilt () const

Additional Inherited Members

Public Types inherited from util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >
typedef int32_t NodeIndex
typedef int32_t ArcIndex
Static Public Attributes inherited from util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >
static constexpr bool kHasNegativeReverseArcs
static constexpr int32_t kNilNode
static constexpr int32_t kNilArc
Protected Member Functions inherited from util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >
void ComputeCumulativeSum (internal::Vector< int32_t, int32_t > *v)
void BuildStartAndForwardHead (internal::SVector< int32_t, int32_t > *head, internal::Vector< int32_t, int32_t > *start, std::vector< int32_t > *permutation)
Protected Attributes inherited from util::BaseGraph< FlowGraph< int32_t, int32_t >, int32_t, int32_t, false >
int32_t num_nodes_
int32_t node_capacity_
int32_t num_arcs_
int32_t arc_capacity_
bool const_capacities_

Constructor & Destructor Documentation

◆ FlowGraph() [1/2]

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::FlowGraph< NodeIndexType, ArcIndexType >::FlowGraph ( )
default

◆ FlowGraph() [2/2]

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::FlowGraph< NodeIndexType, ArcIndexType >::FlowGraph ( NodeIndexType num_nodes,
ArcIndexType arc_capacity )
inline

Definition at line 68 of file flow_graph.h.

Member Function Documentation

◆ AddArc()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
ArcIndexType util::FlowGraph< NodeIndexType, ArcIndexType >::AddArc ( NodeIndexType tail,
NodeIndexType head )
inline

Definition at line 144 of file flow_graph.h.

◆ AddNode()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::FlowGraph< NodeIndexType, ArcIndexType >::AddNode ( NodeIndexType node)
inline

Definition at line 140 of file flow_graph.h.

◆ Build() [1/2]

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::FlowGraph< NodeIndexType, ArcIndexType >::Build ( )
inline

Definition at line 151 of file flow_graph.h.

◆ Build() [2/2]

template<typename NodeIndexType, typename ArcIndexType>
void util::FlowGraph< NodeIndexType, ArcIndexType >::Build ( std::vector< ArcIndexType > * permutation)
final

Definition at line 317 of file flow_graph.h.

◆ Head()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
NodeIndexType util::FlowGraph< NodeIndexType, ArcIndexType >::Head ( ArcIndexType arc) const
inline

Definition at line 74 of file flow_graph.h.

◆ operator[]()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
absl::Span< const NodeIndexType > util::FlowGraph< NodeIndexType, ArcIndexType >::operator[] ( NodeIndexType node) const
inline

Definition at line 127 of file flow_graph.h.

◆ OppositeArc()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
ArcIndexType util::FlowGraph< NodeIndexType, ArcIndexType >::OppositeArc ( ArcIndexType arc) const
inline

Definition at line 95 of file flow_graph.h.

◆ OutgoingArcs()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::IntegerRange< ArcIndexType > util::FlowGraph< NodeIndexType, ArcIndexType >::OutgoingArcs ( NodeIndexType node) const
inline

Definition at line 103 of file flow_graph.h.

◆ OutgoingArcsStartingFrom()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::IntegerRange< ArcIndexType > util::FlowGraph< NodeIndexType, ArcIndexType >::OutgoingArcsStartingFrom ( NodeIndexType node,
ArcIndexType from ) const
inline

Definition at line 106 of file flow_graph.h.

◆ OutgoingOrOppositeIncomingArcs()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::IntegerRange< ArcIndexType > util::FlowGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcs ( NodeIndexType node) const
inline

Definition at line 118 of file flow_graph.h.

◆ OutgoingOrOppositeIncomingArcsStartingFrom()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
util::IntegerRange< ArcIndexType > util::FlowGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcsStartingFrom ( NodeIndexType node,
ArcIndexType from ) const
inline

Definition at line 122 of file flow_graph.h.

◆ ReserveArcs()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::FlowGraph< NodeIndexType, ArcIndexType >::ReserveArcs ( ArcIndexType bound)
inlineoverride

Definition at line 134 of file flow_graph.h.

◆ SetDetectReverse()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::FlowGraph< NodeIndexType, ArcIndexType >::SetDetectReverse ( bool value)
inline

Definition at line 158 of file flow_graph.h.

◆ SetSortByHead()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
void util::FlowGraph< NodeIndexType, ArcIndexType >::SetSortByHead ( bool value)
inline

Definition at line 163 of file flow_graph.h.

◆ Tail()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
NodeIndexType util::FlowGraph< NodeIndexType, ArcIndexType >::Tail ( ArcIndexType arc) const
inline

Definition at line 81 of file flow_graph.h.


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