HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_CycleDetectEx< T > Class Template Reference

#include <UT_Algorithm.h>

Public Types

enum  { MAX_CYCLE_FACTOR = 3 }
 

Public Member Functions

 UT_CycleDetectEx ()
 
void reset ()
 
exint length () const
 
bool detect (const T &tail, exint min_length=2)
 

Detailed Description

template<typename T>
class UT_CycleDetectEx< T >

A version of UT_CycleDetect that additionally supports querying of the cycle length and detection of cycles with a minimum length.

Note
Does not support cycle lengths larger than an exint

Definition at line 170 of file UT_Algorithm.h.

Member Enumeration Documentation

template<typename T >
anonymous enum

The algorithm guarantees that will detect a cycle with no more than MAX_CYCLE_FACTOR*min_length calls to detect()

Enumerator
MAX_CYCLE_FACTOR 

Definition at line 220 of file UT_Algorithm.h.

Constructor & Destructor Documentation

template<typename T >
UT_CycleDetectEx< T >::UT_CycleDetectEx ( )
inline

Definition at line 173 of file UT_Algorithm.h.

Member Function Documentation

template<typename T >
bool UT_CycleDetectEx< T >::detect ( const T tail,
exint  min_length = 2 
)
inline

Definition at line 192 of file UT_Algorithm.h.

template<typename T >
exint UT_CycleDetectEx< T >::length ( void  ) const
inline

Definition at line 187 of file UT_Algorithm.h.

template<typename T >
void UT_CycleDetectEx< T >::reset ( void  )
inline

Definition at line 178 of file UT_Algorithm.h.


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