Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ util/

operations_research::ArrayIndexCycleHandler< DataType, IndexType > Class Template Reference

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. More...

#include <permutation.h>

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

operations_research::PermutationCycleHandler< IndexType >

List of all members.

Public Member Functions

 ArrayIndexCycleHandler (DataType *data)
virtual void SetTempFromIndex (IndexType source)
 Sets the internal temporary storage from the given index in the underlying container(s).
virtual void SetIndexFromIndex (IndexType source, IndexType destination) const
 Moves a data element one step along its cycle.
virtual void SetIndexFromTemp (IndexType destination) const
 Sets a data element from the temporary.
virtual void SetSeen (IndexType *permutation_element) const
 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.
virtual bool Unseen (IndexType permutation_element) const
 Returns true iff the given element of the permutation is unseen, meaning that it has not yet been handled by PermutationApplier::Apply().


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 144 of file permutation.h.


Constructor & Destructor Documentation

template<typename DataType, typename IndexType>
operations_research::ArrayIndexCycleHandler< DataType, IndexType >::ArrayIndexCycleHandler ( DataType *  data  )  [inline, explicit]

Definition at line 147 of file permutation.h.


Member Function Documentation

template<typename DataType, typename IndexType>
virtual void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetTempFromIndex ( IndexType  source  )  [inline, virtual]

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

Implements operations_research::PermutationCycleHandler< IndexType >.

Definition at line 149 of file permutation.h.

template<typename DataType, typename IndexType>
virtual void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetIndexFromIndex ( IndexType  source,
IndexType  destination 
) const [inline, virtual]

Moves a data element one step along its cycle.

Implements operations_research::PermutationCycleHandler< IndexType >.

Definition at line 152 of file permutation.h.

template<typename DataType, typename IndexType>
virtual void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetIndexFromTemp ( IndexType  destination  )  const [inline, virtual]

Sets a data element from the temporary.

Implements operations_research::PermutationCycleHandler< IndexType >.

Definition at line 156 of file permutation.h.

template<typename DataType, typename IndexType>
virtual void operations_research::ArrayIndexCycleHandler< DataType, IndexType >::SetSeen ( IndexType *  unused_permutation_element  )  const [inline, virtual]

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 159 of file permutation.h.

template<typename DataType, typename IndexType>
virtual bool operations_research::ArrayIndexCycleHandler< DataType, IndexType >::Unseen ( IndexType  unused_permutation_element  )  const [inline, virtual]

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 162 of file permutation.h.


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