|
IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Index list, a sorted list of unique integer indices. Used for tasks such as filtering specified element from a list of elements or a general data set. More...
Inheritance diagram for IG.Lib.IndexList:
Collaboration diagram for IG.Lib.IndexList:Public Member Functions | |
| IndexList () | |
| Creates an empty index table with the default capacity. More... | |
| IndexList (int initialCapacity) | |
| Creates an empty index table with the specified initial capacity. More... | |
| IndexList (params int[] items) | |
| Creates an index table containing all indices from the specified table. More... | |
| IndexList (IList< int > items) | |
| Creates an index table containing all indices from the specified list. More... | |
| IndexList (ICollection< int > items) | |
| Creates an index table containing all indices from the specified collection. More... | |
Public Member Functions inherited from IG.Lib.SortedUniqueItemList< Type > | |
| SortedUniqueItemList () | |
| Creates an empty sorted list of items with the default capacity. More... | |
| SortedUniqueItemList (int initialCapacity) | |
| Creates an empty sorted list of items with the specified initial capacity. More... | |
| SortedUniqueItemList (params Type[] items) | |
| Creates a sorted list of items containing all items from the specified table. More... | |
| SortedUniqueItemList (IList< Type > items) | |
| Creates a sorted list of items containing all items from the specified list. More... | |
| SortedUniqueItemList (ICollection< Type > items) | |
| Creates a sorted list of items containing all items from the specified collection. More... | |
| Type[] | ToArray () |
| Creates and returns an array that cotains elements of the current list, in the actual order. More... | |
| void | Clear () |
| Removes all elements from the current list. More... | |
| bool | Contains (Type item) |
| Returns true if the current list contains the specified item, or false otherwise. More... | |
| int | IndexOf (Type item) |
| Returns index of the specified item on the list, if it exists, otherwise a negative number is returned. NOT thread safe. More... | |
| void | AddChecked (Type item) |
| Adds the specified element to the list if it is not yet contained in it. If the item is already contained in the list then an exception is thrown. NOT thread safe. More... | |
| int | Add (Type item) |
| Adds the specified item to the list if it does not yet exist. NOT thread safe. More... | |
| void | RemoveChecked (Type item) |
| Temoves the item from the list that is equal to the specified item. NOT thread safe. More... | |
| int | Remove (Type item) |
| Removes the specified item from the list if it exists. NOT thread safe. The object is locked when operation is performed. More... | |
| void | Add (Type[] items) |
| Adds the specified table of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed. More... | |
| void | Add (IList< Type > items) |
| Adds the specified list of items to the current list. Items are added one by one, which is not the most efficient. More... | |
| void | Add (ICollection< Type > items) |
| Adds the specified collection of items to the current list. Items are added one by one, which is not the most efficient. The object is locked when operation is performed. More... | |
| override string | ToString () |
| Returns string representation of this sorted list. More... | |
Static Public Member Functions | |
| static IndexList | CreateRandomPermutation (int length) |
| Creates and returns a random permutation of the specified length. More... | |
| static IndexList | CreateRandomPermutation (IRandomGenerator rand, int length) |
| Creates and returns a random permutation of the specified length by using the specified random generator. More... | |
| static void | SetRandomPermutation (int length, int upperBound, ref IndexList indices) |
| Creates a random permutation of the specified length and stores them it the specified index list. More... | |
| static void | SetRandomPermutation (IRandomGenerator rand, int length, ref IndexList indices) |
| Creates a random permutation of the specified length by using the specified random generator More... | |
| static IndexList | CreateRandom (int length, int upperBound) |
| Creates a prescribed number of unique random indices in the specified range. More... | |
| static IndexList | CreateRandom (int length, int lowerBound, int upperBound) |
| Creates and returns an index list with the specified number of unique random indices in the specified range . More... | |
| static IndexList | CreateRandom (IRandomGenerator rand, int length, int upperBound) |
| Creates and returns an index list with the specified number of unique random indices in the specified range by using the specified random generator. Lower bound of generated indices is 0. More... | |
| static IndexList | CreateRandom (IRandomGenerator rand, int length, int lowerBound, int upperBound) |
| Creates and returns an index list with the specified number of unique random indices in the specified range by using the specified random generator. More... | |
| static void | SetRandom (int length, int upperBound, ref IndexList indices) |
| Creates a prescribed number of unique random indices in the specified range. More... | |
| static void | SetRandom (int length, int lowerBound, int upperBound, ref IndexList indices) |
| Creates a prescribed number of unique random indices in the specified range. More... | |
| static void | SetRandom (IRandomGenerator rand, int length, int upperBound, ref IndexList indices) |
| Creates a prescribed number of unique random indices in the specified range by using the specified random generator and stores them in the specified index list. Lower bound of generated indices is 0. More... | |
| static void | SetRandom (IRandomGenerator rand, int length, int lowerBound, int upperBound, ref IndexList indices) |
| Creates a prescribed number of unique random indices in the specified range by using the specified random generator and stores them in the specified index list. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from IG.Lib.SortedUniqueItemList< Type > | |
| void | Sort () |
| Sorts the internal list of items. NOT thread safe. More... | |
Properties inherited from IG.Lib.SortedUniqueItemList< Type > | |
| object | Lock [get] |
| This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
| Type | this[int index] [get] |
| Gets the specified element. More... | |
| int | Length [get] |
| Gets the current number of elements in the list. More... | |
| int | Capacity [get, protected set] |
| Gets the current number of elements in the list. More... | |
| int | CapacityOverhead [get, set] |
| Overhead in capacity. If differnt than 0 then when current capacity is filled, adding operations will perform resizing in such a way that this number of elements are unoccupied. In this way, the frequency of resizes is reduced. Also, removing operations can perform downsizing if the number of free elements after removal is greater than CapacityOverhead (dependent on value of the PerformDownSizing flag). More... | |
| bool | PerformDownSizing [get, protected set] |
| Flag specifying whether capacity can be reduced on removal operations which would generate large excess of list capacity with respect to the number of actual elements contained in the list. More... | |
| IComparer< Type > | Comparer [get, set] |
| Gets or sets the comparer. If a new comparer is set then re-sorting of the list is performed. Setter is thread safe, but getter is not. More... | |
Properties inherited from IG.Lib.ILockable | |
| object | Lock [get] |
Index list, a sorted list of unique integer indices. Used for tasks such as filtering specified element from a list of elements or a general data set.
$A Igor Dec08;
|
inline |
Creates an empty index table with the default capacity.
|
inline |
Creates an empty index table with the specified initial capacity.
| initialCapacity | Initial capacity of the list. |
|
inline |
Creates an index table containing all indices from the specified table.
| items | Table fo indices that are added to the created index table. |
|
inline |
Creates an index table containing all indices from the specified list.
| items | List fo indices that are added to the created index table. |
|
inline |
Creates an index table containing all indices from the specified collection.
| items | Collection fo indices that are added to the created index table. |
|
inlinestatic |
Creates and returns a random permutation of the specified length.
| length | Length of permutation, i.e. number of random indices contained in the generated list of indices. |
References IG.Num.RandomGenerator.Global.
|
inlinestatic |
Creates and returns a random permutation of the specified length by using the specified random generator.
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Length of permutation, i.e. number of random indices contained in the generated list of indices. |
|
inlinestatic |
Creates a random permutation of the specified length and stores them it the specified index list.
| length | Number of random indices contained in the generated list of indices. |
| upperBound | Upper bound. |
| indices | Index list to which the generated indices are stored. |
References IG.Num.RandomGenerator.Global.
|
inlinestatic |
Creates a random permutation of the specified length by using the specified random generator
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Number of random indices contained in the generated list of indices. |
| indices | Index list to which the generated indices are stored. |
|
inlinestatic |
Creates a prescribed number of unique random indices in the specified range.
| length | Number of random indices contained in the generated list of indices. |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
References IG.Num.RandomGenerator.Global.
Referenced by IG.Neural.NeuralTadej.ExampleCasting(), IG.Neural.NeuralTadej.ExampleQuadratic(), IG.Num.NeuralApproximatorBase.ExampleQuadratic(), IG.Neural.NeuralTadej.ExampleStore(), and IG.Script.LoadableScriptShellNeuralBase.TrainANN().
|
inlinestatic |
Creates and returns an index list with the specified number of unique random indices in the specified range .
| length | Number of random indices contained in the generated list of indices. |
| lowerBound | Lower bound for generated indices (contained indices are greater or equal to this value). |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
References IG.Num.RandomGenerator.Global.
|
inlinestatic |
Creates and returns an index list with the specified number of unique random indices in the specified range by using the specified random generator. Lower bound of generated indices is 0.
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Number of random indices contained in the generated list of indices. |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
|
inlinestatic |
Creates and returns an index list with the specified number of unique random indices in the specified range by using the specified random generator.
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Number of random indices contained in the generated list of indices. |
| lowerBound | Lower bound for generated indices (contained indices are greater or equal to this value). |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
|
inlinestatic |
Creates a prescribed number of unique random indices in the specified range.
| length | Number of random indices contained in the generated list of indices. |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
| indices | Index list to which the generated indices are stored. |
References IG.Num.RandomGenerator.Global.
|
inlinestatic |
Creates a prescribed number of unique random indices in the specified range.
| length | Number of random indices contained in the generated list of indices. |
| lowerBound | Lower bound for generated indices (contained indices are greater or equal to this value). |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
| indices | Index list to which the generated indices are stored. |
References IG.Num.RandomGenerator.Global.
|
inlinestatic |
Creates a prescribed number of unique random indices in the specified range by using the specified random generator and stores them in the specified index list. Lower bound of generated indices is 0.
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Number of random indices contained in the generated list of indices. |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
| indices | Index list to which the generated indices are stored. |
|
inlinestatic |
Creates a prescribed number of unique random indices in the specified range by using the specified random generator and stores them in the specified index list.
| rand | Random numbers generator used to generate indices randomly. There is a version of the method without this argument, which uses the global random generator. |
| length | Number of random indices contained in the generated list of indices. |
| lowerBound | Lower bound for generated indices (contained indices are greater or equal to this value). |
| upperBound | Upper bound for generated indices (contained indices are lesser or equal to this value). |
| indices | Index list to which the generated indices are stored. |
References IG.Num.IRandomGenerator.NextInclusive().