GraphLib  2.0
une librairie C# pour l’exploitation de graphes en reconnaissance des formes
 All Classes Namespaces Functions Enumerations Enumerator Properties
Matching.Permutations< T >.Enumerator Class Reference

The enumerator that enumerates each meta-collection of the enclosing Permutations class. More...

Inheritance diagram for Matching.Permutations< T >.Enumerator:
Matching.Permutations< T > Matching.IMetaCollection< T >

Public Member Functions

 Enumerator (Permutations< T > source)
 Construct a enumerator with the parent object. More...
 
void Reset ()
 Resets the permutations enumerator to the first permutation. This will be the first lexicographically order permutation. More...
 
bool MoveNext ()
 Advances to the next permutation. More...
 
virtual void Dispose ()
 Cleans up non-managed resources, of which there are none used here. More...
 
- Public Member Functions inherited from Matching.Permutations< T >
 Permutations (IList< T > values)
 Create a permutation set from the provided list of values. The values (T) must implement IComparable. If T does not implement IComparable use a constructor with an explict IComparer. The repetition type defaults to MetaCollectionType.WithholdRepetitionSets More...
 
 Permutations (IList< T > values, GenerateOption type)
 Create a permutation set from the provided list of values. If type is MetaCollectionType.WithholdRepetitionSets, then values (T) must implement IComparable. If T does not implement IComparable use a constructor with an explict IComparer. More...
 
 Permutations (IList< T > values, IComparer< T > comparer)
 Create a permutation set from the provided list of values. The values will be compared using the supplied IComparer. The repetition type defaults to MetaCollectionType.WithholdRepetitionSets More...
 
virtual IEnumerator GetEnumerator ()
 Gets an enumerator for collecting the list of permutations. More...
 

Properties

object Current [get]
 The current permutation. More...
 
- Properties inherited from Matching.Permutations< T >
long Count [get]
 The count of all permutations that will be returned. If type is MetaCollectionType.WithholdGeneratedSets, then this does not double count permutations with multiple identical values. I.e. count of permutations of "AAB" will be 3 instead of 6. If type is MetaCollectionType.WithRepetition, then this is all combinations and is therefore N!, where N is the number of values. More...
 
GenerateOption Type [get]
 The type of Permutations set that is generated. More...
 
int UpperIndex [get]
 The upper index of the meta-collection, equal to the number of items in the initial set. More...
 
int LowerIndex [get]
 The lower index of the meta-collection, equal to the number of items returned each iteration. For Permutation, this is always equal to the UpperIndex. More...
 
- Properties inherited from Matching.IMetaCollection< T >
long Count [get]
 The count of items in the collection. This is not inherited from ICollection since this meta-collection cannot be extended by users. More...
 
GenerateOption Type [get]
 The type of the meta-collection, determining how the collections are determined from the inputs. More...
 
int UpperIndex [get]
 The upper index of the meta-collection, which is the size of the input collection. More...
 
int LowerIndex [get]
 The lower index of the meta-collection, which is the size of each output collection. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Matching.Permutations< T >
 Permutations ()
 No default constructor, must at least provided a list of values. More...
 

Detailed Description

The enumerator that enumerates each meta-collection of the enclosing Permutations class.

Constructor & Destructor Documentation

Matching.Permutations< T >.Enumerator.Enumerator ( Permutations< T >  source)

Construct a enumerator with the parent object.

Parameters
sourceThe source Permutations object.

Member Function Documentation

virtual void Matching.Permutations< T >.Enumerator.Dispose ( )
virtual

Cleans up non-managed resources, of which there are none used here.

bool Matching.Permutations< T >.Enumerator.MoveNext ( )

Advances to the next permutation.

Returns
True if successfully moved to next permutation, False if no more permutations exist.

Continuation was tried (i.e. yield return) by was not nearly as efficient. Performance is further increased by using value types and removing generics, that is, the LexicographicOrder parellel array. This is a issue with the .NET CLR not optimizing as well as it could in this infrequently used scenario.

void Matching.Permutations< T >.Enumerator.Reset ( )

Resets the permutations enumerator to the first permutation. This will be the first lexicographically order permutation.

Property Documentation

object Matching.Permutations< T >.Enumerator.Current
get

The current permutation.


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