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

Variations defines a meta-collection, typically a list of lists, of all possible ordered subsets of a particular size from the set of values. This list is enumerable and allows the scanning of all possible Variations using a simple foreach() loop even though the variations are not all in memory. More...

Inheritance diagram for Matching.Variations< T >:
Matching.IMetaCollection< T > Matching.Variations< T >.EnumeratorWithoutRepetition Matching.Variations< T >.EnumeratorWithRepetition

Classes

class  EnumeratorWithoutRepetition
 An enumerator for Variations when the type is set to WithoutRepetition. More...
 
class  EnumeratorWithRepetition
 An enumerator for Variations when the type is set to WithRepetition. More...
 

Public Member Functions

 Variations (IList< T > values, int lowerIndex)
 Create a variation set from the indicated list of values. The upper index is calculated as values.Count, the lower index is specified. Collection type defaults to MetaCollectionType.WithoutRepetition More...
 
 Variations (IList< T > values, int lowerIndex, GenerateOption type)
 Create a variation set from the indicated list of values. The upper index is calculated as values.Count, the lower index is specified. More...
 
IEnumerator< IList< T > > GetEnumerator ()
 Gets an enumerator for the collection of Variations. More...
 

Protected Member Functions

 Variations ()
 No default constructor, must provided a list of values and size. More...
 

Properties

long Count [get]
 The number of unique variations that are defined in this meta-collection. More...
 
GenerateOption Type [get]
 The type of Variations 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. 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...
 

Detailed Description

Variations defines a meta-collection, typically a list of lists, of all possible ordered subsets of a particular size from the set of values. This list is enumerable and allows the scanning of all possible Variations using a simple foreach() loop even though the variations are not all in memory.

The MetaCollectionType parameter of the constructor allows for the creation of normal Variations and Variations with Repetition.

When given an input collect {A B C} and lower index of 2, the following sets are generated: MetaCollectionType.WithoutRepetition generates 6 sets: => {A B}, {A B}, {B A}, {B C}, {C A}, {C B} MetaCollectionType.WithRepetition generates 9 sets: {A A}, {A B}, {A B}, {B A}, {B B }, {B C}, {C A}, {C B}, {C C}

The equality of multiple inputs is not considered when generating variations.

Template Parameters
TThe type of the values within the list.

Constructor & Destructor Documentation

Matching.Variations< T >.Variations ( )
protected

No default constructor, must provided a list of values and size.

Matching.Variations< T >.Variations ( IList< T >  values,
int  lowerIndex 
)

Create a variation set from the indicated list of values. The upper index is calculated as values.Count, the lower index is specified. Collection type defaults to MetaCollectionType.WithoutRepetition

Parameters
valuesList of values to select Variations from.
lowerIndexThe size of each variation set to return.
Matching.Variations< T >.Variations ( IList< T >  values,
int  lowerIndex,
GenerateOption  type 
)

Create a variation set from the indicated list of values. The upper index is calculated as values.Count, the lower index is specified.

Parameters
valuesList of values to select variations from.
lowerIndexThe size of each vatiation set to return.
typeType indicates whether to use repetition in set generation.

Member Function Documentation

IEnumerator<IList<T> > Matching.Variations< T >.GetEnumerator ( )

Gets an enumerator for the collection of Variations.

Returns
The enumerator.

Property Documentation

long Matching.Variations< T >.Count
get

The number of unique variations that are defined in this meta-collection.

Variations with repetitions does not behave like other meta-collections and it's count is equal to N^P, where N is the upper index and P is the lower index.

int Matching.Variations< T >.LowerIndex
get

The lower index of the meta-collection, equal to the number of items returned each iteration.

GenerateOption Matching.Variations< T >.Type
get

The type of Variations set that is generated.

int Matching.Variations< T >.UpperIndex
get

The upper index of the meta-collection, equal to the number of items in the initial set.


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