Public Member Functions | List of all members
operations_research::AssignmentContainer< V, E > Class Template Reference

--— Assignment element container --— More...

#include <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
 

Detailed Description

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

--— Assignment element container --—

Definition at line 4824 of file constraint_solver.h.

Constructor & Destructor Documentation

◆ AssignmentContainer()

template<class V, class E>
operations_research::AssignmentContainer< V, E >::AssignmentContainer ( )
inline

Definition at line 4826 of file constraint_solver.h.

Member Function Documentation

◆ Add()

template<class V, class E>
E* operations_research::AssignmentContainer< V, E >::Add ( V *  var)
inline

Definition at line 4827 of file constraint_solver.h.

◆ AddAtPosition()

template<class V, class E>
E* operations_research::AssignmentContainer< V, 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 4844 of file constraint_solver.h.

◆ AreAllElementsBound()

template<class V, class E>
bool operations_research::AssignmentContainer< V, E >::AreAllElementsBound ( ) const
inline

Definition at line 4935 of file constraint_solver.h.

◆ Clear()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::Clear ( )
inline

Definition at line 4848 of file constraint_solver.h.

◆ Contains()

template<class V, class E>
bool operations_research::AssignmentContainer< V, E >::Contains ( const V *const  var) const
inline

Definition at line 4889 of file constraint_solver.h.

◆ Copy()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::Copy ( const AssignmentContainer< V, E > &  container)
inline

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

Definition at line 4882 of file constraint_solver.h.

◆ CopyIntersection()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::CopyIntersection ( const AssignmentContainer< V, E > &  container)
inline

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

Definition at line 4860 of file constraint_solver.h.

◆ Element() [1/2]

template<class V, class E>
const E& operations_research::AssignmentContainer< V, E >::Element ( const V *const  var) const
inline

Definition at line 4906 of file constraint_solver.h.

◆ Element() [2/2]

template<class V, class E>
const E& operations_research::AssignmentContainer< V, E >::Element ( int  index) const
inline

Definition at line 4921 of file constraint_solver.h.

◆ ElementPtrOrNull()

template<class V, class E>
const E* operations_research::AssignmentContainer< V, E >::ElementPtrOrNull ( const V *const  var) const
inline

Definition at line 4912 of file constraint_solver.h.

◆ elements()

template<class V, class E>
const std::vector<E>& operations_research::AssignmentContainer< V, E >::elements ( ) const
inline

Definition at line 4919 of file constraint_solver.h.

◆ Empty()

template<class V, class E>
bool operations_research::AssignmentContainer< V, E >::Empty ( ) const
inline

Definition at line 4857 of file constraint_solver.h.

◆ FastAdd()

template<class V, class E>
E* operations_research::AssignmentContainer< V, E >::FastAdd ( V *  var)
inline

Adds element without checking its presence in the container.

Definition at line 4837 of file constraint_solver.h.

◆ MutableElement() [1/2]

template<class V, class E>
E* operations_research::AssignmentContainer< V, E >::MutableElement ( const V *const  var)
inline

Definition at line 4893 of file constraint_solver.h.

◆ MutableElement() [2/2]

template<class V, class E>
E* operations_research::AssignmentContainer< V, E >::MutableElement ( int  index)
inline

Definition at line 4920 of file constraint_solver.h.

◆ MutableElementOrNull()

template<class V, class E>
E* operations_research::AssignmentContainer< V, E >::MutableElementOrNull ( const V *const  var)
inline

Definition at line 4899 of file constraint_solver.h.

◆ operator!=()

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

Definition at line 4964 of file constraint_solver.h.

◆ operator==()

template<class V, class E>
bool operations_research::AssignmentContainer< V, E >::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 4945 of file constraint_solver.h.

◆ Resize()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::Resize ( size_t  size)
inline

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

Definition at line 4856 of file constraint_solver.h.

◆ Restore()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::Restore ( )
inline

Definition at line 4928 of file constraint_solver.h.

◆ Size()

template<class V, class E>
int operations_research::AssignmentContainer< V, E >::Size ( ) const
inline

Definition at line 4922 of file constraint_solver.h.

◆ Store()

template<class V, class E>
void operations_research::AssignmentContainer< V, E >::Store ( )
inline

Definition at line 4923 of file constraint_solver.h.


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