Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::ArrayIndexCycleHandler< DataType, IndexType > Class Template Reference

#include <permutation.h>

Inheritance diagram for operations_research::ArrayIndexCycleHandler< DataType, IndexType >:
operations_research::PermutationCycleHandler< IndexType >

Public Member Functions

 ArrayIndexCycleHandler (DataType *data)
 
 ArrayIndexCycleHandler (const ArrayIndexCycleHandler &)=delete
 This type is neither copyable nor movable.
 
ArrayIndexCycleHandleroperator= (const ArrayIndexCycleHandler &)=delete
 
void SetTempFromIndex (IndexType source) override
 
void SetIndexFromIndex (IndexType source, IndexType destination) const override
 Moves a data element one step along its cycle.
 
void SetIndexFromTemp (IndexType destination) const override
 Sets a data element from the temporary.
 
void SetSeen (IndexType *permutation_element) const override
 
bool Unseen (IndexType permutation_element) const override
 
- Public Member Functions inherited from operations_research::PermutationCycleHandler< IndexType >
 PermutationCycleHandler (const PermutationCycleHandler &)=delete
 This type is neither copyable nor movable.
 
PermutationCycleHandleroperator= (const PermutationCycleHandler &)=delete
 
virtual ~PermutationCycleHandler ()
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::PermutationCycleHandler< IndexType >
 PermutationCycleHandler ()
 

Detailed Description

template<typename DataType, typename IndexType>
class operations_research::ArrayIndexCycleHandler< DataType, IndexType >

A generic cycle handler class for the common case in which the object to be permuted is indexable with T& operator[](int), and the permutation is represented by a mutable array of nonnegative int-typed index values. To mark a permutation element as seen, we replace it by its ones-complement value.

Definition at line 142 of file permutation.h.

Constructor & Destructor Documentation

◆ ArrayIndexCycleHandler() [1/2]

template<typename DataType , typename IndexType >
operations_research::ArrayIndexCycleHandler< DataType, IndexType >::ArrayIndexCycleHandler ( DataType * data)
inlineexplicit

Definition at line 144 of file permutation.h.

◆ ArrayIndexCycleHandler() [2/2]

template<typename DataType , typename IndexType >
operations_research::ArrayIndexCycleHandler< DataType, IndexType >::ArrayIndexCycleHandler ( const ArrayIndexCycleHandler< DataType, IndexType > & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ operator=()

template<typename DataType , typename IndexType >
ArrayIndexCycleHandler & operations_research::ArrayIndexCycleHandler< DataType, IndexType >::operator= ( const ArrayIndexCycleHandler< DataType, IndexType > & )
delete

◆ SetIndexFromIndex()

template<typename DataType , typename IndexType >
void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetIndexFromIndex ( IndexType source,
IndexType destination ) const
inlineoverridevirtual

◆ SetIndexFromTemp()

template<typename DataType , typename IndexType >
void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetIndexFromTemp ( IndexType destination) const
inlineoverridevirtual

◆ SetSeen()

template<typename DataType , typename IndexType >
void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetSeen ( IndexType * unused_permutation_element) const
inlineoverridevirtual

Marks an element of the permutation as handled by PermutationHandler::Apply(), meaning that we have read the corresponding value from the data to be permuted, and put that value somewhere (either in the temp or in its ultimate destination in the data.

This method must be overridden in implementations where it is called. If an implementation doesn't call it, no need to override.

Reimplemented from operations_research::PermutationCycleHandler< IndexType >.

Definition at line 158 of file permutation.h.

◆ SetTempFromIndex()

template<typename DataType , typename IndexType >
void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetTempFromIndex ( IndexType source)
inlineoverridevirtual

Sets the internal temporary storage from the given index in the underlying container(s).

Implements operations_research::PermutationCycleHandler< IndexType >.

Reimplemented in operations_research::ForwardStaticGraph< NodeIndexType, ArcIndexType >::CycleHandlerForAnnotatedArcs.

Definition at line 150 of file permutation.h.

◆ Unseen()

template<typename DataType , typename IndexType >
bool operations_research::ArrayIndexCycleHandler< DataType, IndexType >::Unseen ( IndexType unused_permutation_element) const
inlineoverridevirtual

Returns true iff the given element of the permutation is unseen, meaning that it has not yet been handled by PermutationApplier::Apply().

This method must be overridden in implementations where it is called. If an implementation doesn't call it, no need to override.

Reimplemented from operations_research::PermutationCycleHandler< IndexType >.

Definition at line 161 of file permutation.h.


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