GraphLib
2.0
une librairie C# pour l’exploitation de graphes en reconnaissance des formes
|
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...
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... | |
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.
T | The type of the values within the list. |
|
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
values | List of values to select Variations from. |
lowerIndex | The 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.
values | List of values to select variations from. |
lowerIndex | The size of each vatiation set to return. |
type | Type indicates whether to use repetition in set generation. |
IEnumerator<IList<T> > Matching.Variations< T >.GetEnumerator | ( | ) |
Gets an enumerator for the collection of Variations.
|
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.
|
get |
The lower index of the meta-collection, equal to the number of items returned each iteration.
|
get |
The type of Variations set that is generated.
|
get |
The upper index of the meta-collection, equal to the number of items in the initial set.