C++ Reference

C++ Reference: Routing

AssignmentContainer< V, E >

Detailed Description

template<class V, class E>
class operations_research::AssignmentContainer< V, E >

Definition at line 4859 of file constraint_solver.h.

Public Member Functions

 AssignmentContainer ()
 
E * Add (V *var)
 
E * FastAdd (V *var)
 Adds element without checking its presence in the container. More...
 
E * AddAtPosition (V *var, int position)
 Advanced usage: Adds element at a given position; position has to have been allocated with AssignmentContainer::Resize() beforehand. More...
 
void Clear ()
 
void Resize (size_t size)
 Advanced usage: Resizes the container, potentially adding elements with null variables. More...
 
bool Empty () const
 
void CopyIntersection (const AssignmentContainer< V, E > &container)
 Copies the elements of 'container' which are already in the calling container. More...
 
void Copy (const AssignmentContainer< V, E > &container)
 Copies all the elements of 'container' to this container, clearing its previous content. More...
 
bool Contains (const V *const var) const
 
E * MutableElement (const V *const var)
 
E * MutableElementOrNull (const V *const var)
 
const E & Element (const V *const var) const
 
const E * ElementPtrOrNull (const V *const var) const
 
const std::vector< E > & elements () const
 
E * MutableElement (int index)
 
const E & Element (int index) const
 
int Size () const
 
void Store ()
 
void Restore ()
 
bool AreAllElementsBound () const
 
bool operator== (const AssignmentContainer< V, E > &container) const
 Returns true if this and 'container' both represent the same V* -> E map. More...
 
bool operator!= (const AssignmentContainer< V, E > &container) const
 

Constructor & Destructor Documentation

◆ AssignmentContainer()

AssignmentContainer ( )
inline

Definition at line 4861 of file constraint_solver.h.

Member Function Documentation

◆ Add()

E* Add ( V *  var)
inline

Definition at line 4862 of file constraint_solver.h.

◆ AddAtPosition()

E* AddAtPosition ( V *  var,
int  position 
)
inline

Advanced usage: Adds element at a given position; position has to have been allocated with AssignmentContainer::Resize() beforehand.

Definition at line 4879 of file constraint_solver.h.

◆ AreAllElementsBound()

bool AreAllElementsBound ( ) const
inline

Definition at line 4970 of file constraint_solver.h.

◆ Clear()

void Clear ( )
inline

2x speedup on OR-Tools.

Definition at line 4883 of file constraint_solver.h.

◆ Contains()

bool Contains ( const V *const  var) const
inline

Definition at line 4924 of file constraint_solver.h.

◆ Copy()

void Copy ( const AssignmentContainer< V, E > &  container)
inline

Copies all the elements of 'container' to this container, clearing its previous content.

Definition at line 4917 of file constraint_solver.h.

◆ CopyIntersection()

void CopyIntersection ( const AssignmentContainer< V, E > &  container)
inline

Copies the elements of 'container' which are already in the calling container.

Definition at line 4895 of file constraint_solver.h.

◆ Element() [1/2]

const E& Element ( const V *const  var) const
inline

Definition at line 4941 of file constraint_solver.h.

◆ Element() [2/2]

const E& Element ( int  index) const
inline

Definition at line 4956 of file constraint_solver.h.

◆ ElementPtrOrNull()

const E* ElementPtrOrNull ( const V *const  var) const
inline

Definition at line 4947 of file constraint_solver.h.

◆ elements()

const std::vector<E>& elements ( ) const
inline

Definition at line 4954 of file constraint_solver.h.

◆ Empty()

bool Empty ( ) const
inline

Definition at line 4892 of file constraint_solver.h.

◆ FastAdd()

E* FastAdd ( V *  var)
inline

Adds element without checking its presence in the container.

Definition at line 4872 of file constraint_solver.h.

◆ MutableElement() [1/2]

E* MutableElement ( const V *const  var)
inline

Definition at line 4928 of file constraint_solver.h.

◆ MutableElement() [2/2]

E* MutableElement ( int  index)
inline

Definition at line 4955 of file constraint_solver.h.

◆ MutableElementOrNull()

E* MutableElementOrNull ( const V *const  var)
inline

Definition at line 4934 of file constraint_solver.h.

◆ operator!=()

bool operator!= ( const AssignmentContainer< V, E > &  container) const
inline

Definition at line 4999 of file constraint_solver.h.

◆ operator==()

bool operator== ( const AssignmentContainer< V, E > &  container) const
inline

Returns true if this and 'container' both represent the same V* -> E map.

Runs in linear time; requires that the == operator on the type E is well defined.

We may not have any work to do

The == should be order-independent

Do not use the hash_map::== operator! It compares both content and how the map is hashed (e.g., number of buckets). This is not what we want.

Definition at line 4980 of file constraint_solver.h.

◆ Resize()

void Resize ( size_t  size)
inline

Advanced usage: Resizes the container, potentially adding elements with null variables.

Definition at line 4891 of file constraint_solver.h.

◆ Restore()

void Restore ( )
inline

Definition at line 4963 of file constraint_solver.h.

◆ Size()

int Size ( ) const
inline

Definition at line 4957 of file constraint_solver.h.

◆ Store()

void Store ( )
inline

Definition at line 4958 of file constraint_solver.h.


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