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

Detailed Description

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

Definition at line 662 of file graph.h.

#include <graph.h>

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

Classes

struct  OutgoingArcIteratorTag

Public Types

using OutgoingArcIterator
using OutgoingHeadIterator = ArcHeadIterator<ListGraph, OutgoingArcIterator>
Public Types inherited from util::BaseGraph< ListGraph< int32_t, int32_t >, int32_t, int32_t, false >
typedef int32_t NodeIndex
typedef int32_t ArcIndex

Public Member Functions

 ListGraph ()=default
 ListGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity)
void AddNode (NodeIndexType node)
ArcIndexType AddArc (NodeIndexType tail, NodeIndexType head)
NodeIndexType Tail (ArcIndexType arc) const
NodeIndexType Head (ArcIndexType arc) const
ArcIndexType OutDegree (NodeIndexType node) const
BeginEndWrapper< OutgoingArcIteratorOutgoingArcs (NodeIndexType node) const
BeginEndWrapper< OutgoingArcIteratorOutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const
BeginEndWrapper< OutgoingHeadIteratoroperator[] (NodeIndexType node) const
void ReserveNodes (NodeIndexType bound) override
void ReserveArcs (ArcIndexType bound) override
bool IsArcValid (ArcIndexType arc) const
Public Member Functions inherited from util::BaseGraph< ListGraph< 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

Static Public Attributes inherited from util::BaseGraph< ListGraph< 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< ListGraph< 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< ListGraph< 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_

Member Typedef Documentation

◆ OutgoingArcIterator

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
using util::ListGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
Initial value:
ChasingIterator<ArcIndexType, Base::kNilArc, OutgoingArcIteratorTag>

Definition at line 707 of file graph.h.

◆ OutgoingHeadIterator

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
using util::ListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator = ArcHeadIterator<ListGraph, OutgoingArcIterator>

Definition at line 709 of file graph.h.

Constructor & Destructor Documentation

◆ ListGraph() [1/2]

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

◆ ListGraph() [2/2]

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

Definition at line 680 of file graph.h.

Member Function Documentation

◆ AddArc()

template<typename NodeIndexType, typename ArcIndexType>
ArcIndexType util::ListGraph< NodeIndexType, ArcIndexType >::AddArc ( NodeIndexType tail,
NodeIndexType head )

Definition at line 1355 of file graph.h.

◆ AddNode()

template<typename NodeIndexType, typename ArcIndexType>
void util::ListGraph< NodeIndexType, ArcIndexType >::AddNode ( NodeIndexType node)

Definition at line 1347 of file graph.h.

◆ Head()

template<typename NodeIndexType, typename ArcIndexType>
NodeIndexType util::ListGraph< NodeIndexType, ArcIndexType >::Head ( ArcIndexType arc) const

Definition at line 1332 of file graph.h.

◆ IsArcValid()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
bool util::BaseGraph< ListGraph< NodeIndexType, ArcIndexType >, NodeIndexType, ArcIndexType, HasNegativeReverseArcs >::IsArcValid ( ArcIndexType arc) const
inline

Definition at line 248 of file graph.h.

◆ operator[]()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
BeginEndWrapper< OutgoingHeadIterator > util::ListGraph< NodeIndexType, ArcIndexType >::operator[] ( NodeIndexType node) const
inline

Definition at line 741 of file graph.h.

◆ OutDegree()

template<typename NodeIndexType, typename ArcIndexType>
ArcIndexType util::ListGraph< NodeIndexType, ArcIndexType >::OutDegree ( NodeIndexType node) const

Definition at line 1339 of file graph.h.

◆ OutgoingArcs()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
BeginEndWrapper< OutgoingArcIterator > util::ListGraph< NodeIndexType, ArcIndexType >::OutgoingArcs ( NodeIndexType node) const
inline

Definition at line 721 of file graph.h.

◆ OutgoingArcsStartingFrom()

template<typename NodeIndexType = int32_t, typename ArcIndexType = int32_t>
BeginEndWrapper< OutgoingArcIterator > util::ListGraph< NodeIndexType, ArcIndexType >::OutgoingArcsStartingFrom ( NodeIndexType node,
ArcIndexType from ) const
inline

Definition at line 730 of file graph.h.

◆ ReserveArcs()

template<typename NodeIndexType, typename ArcIndexType>
void util::ListGraph< NodeIndexType, ArcIndexType >::ReserveArcs ( ArcIndexType bound)
override

Definition at line 1376 of file graph.h.

◆ ReserveNodes()

template<typename NodeIndexType, typename ArcIndexType>
void util::ListGraph< NodeIndexType, ArcIndexType >::ReserveNodes ( NodeIndexType bound)
override

Definition at line 1369 of file graph.h.

◆ Tail()

template<typename NodeIndexType, typename ArcIndexType>
NodeIndexType util::ListGraph< NodeIndexType, ArcIndexType >::Tail ( ArcIndexType arc) const

Definition at line 1325 of file graph.h.


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