| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# IG::Lib::IndexList Class Reference

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:
[legend]
Collaboration diagram for IG::Lib::IndexList:
[legend]

List of all members.

## Public Member Functions
| IndexList ()
| Creates an empty index table with the default capacity.
| IndexList (int initialCapacity)
| Creates an empty index table with the specified initial capacity.
| IndexList (params int[] items)
| Creates an index table containing all indices from the specified table.
| IndexList (IList< int > items)
| Creates an index table containing all indices from the specified list.
| IndexList (ICollection< int > items)
| Creates an index table containing all indices from the specified collection.
## Static Public Member Functions
static IndexList | CreateRandomPermutation (int length)
| Creates and returns a random permutation of the specified length.
static IndexList | CreateRandomPermutation (IRandomGenerator rand, int length)
| Creates and returns a random permutation of the specified length by using the specified random generator.
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.
static void | SetRandomPermutation (IRandomGenerator rand, int length, ref IndexList indices)
| Creates a random permutation of the specified length by using the specified random generator.
static IndexList | CreateRandom (int length, int upperBound)
| Creates a prescribed number of unique random indices in the specified range.
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 .
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.
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.
static void | SetRandom (int length, int upperBound, ref IndexList indices)
| Creates a prescribed number of unique random indices in the specified range.
static void | SetRandom (int length, int lowerBound, int upperBound, ref IndexList indices)
| Creates a prescribed number of unique random indices in the specified range.
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.
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.

## Detailed Description

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;

## Constructor & Destructor Documentation

IG::Lib::IndexList::IndexList | ( |  | ) | `[inline]`

Creates an empty index table with the default capacity.

IG::Lib::IndexList::IndexList | ( | int | initialCapacity | ) | `[inline]`

Creates an empty index table with the specified initial capacity.

Parameters:

  initialCapacity | Initial capacity of the list.

IG::Lib::IndexList::IndexList | ( | params int[] | items | ) | `[inline]`

Creates an index table containing all indices from the specified table.

Parameters:

  items | Table fo indices that are added to the created index table.

IG::Lib::IndexList::IndexList | ( | IList< int > | items | ) | `[inline]`

Creates an index table containing all indices from the specified list.

Parameters:

  items | List fo indices that are added to the created index table.

IG::Lib::IndexList::IndexList | ( | ICollection< int > | items | ) | `[inline]`

Creates an index table containing all indices from the specified collection.

Parameters:

  items | Collection fo indices that are added to the created index table.

## Member Function Documentation

static IndexList IG::Lib::IndexList::CreateRandomPermutation | ( | int | length | ) | `[inline, static]`

Creates and returns a random permutation of the specified length.

Parameters:

  length | Length of permutation, i.e. number of random indices contained in the generated list of indices.

static IndexList IG::Lib::IndexList::CreateRandomPermutation | ( | IRandomGenerator | rand,
|  | int | length
| ) |  | `[inline, static]`

Creates and returns a random permutation of the specified length by using the specified random generator.

Parameters:

  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.

static void IG::Lib::IndexList::SetRandomPermutation | ( | int | length,
|  | int | upperBound,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

Creates a random permutation of the specified length and stores them it the specified index list.

Parameters:

  length | Number of random indices contained in the generated list of indices.
  indices | Index list to which the generated indices are stored.

static void IG::Lib::IndexList::SetRandomPermutation | ( | IRandomGenerator | rand,
|  | int | length,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

Creates a random permutation of the specified length by using the specified random generator.

Parameters:

  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.

static IndexList IG::Lib::IndexList::CreateRandom | ( | int | length,
|  | int | upperBound
| ) |  | `[inline, static]`

Creates a prescribed number of unique random indices in the specified range.

Parameters:

  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).

static IndexList IG::Lib::IndexList::CreateRandom | ( | int | length,
|  | int | lowerBound,
|  | int | upperBound
| ) |  | `[inline, static]`

Creates and returns an index list with the specified number of unique random indices in the specified range .

Parameters:

  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).

static IndexList IG::Lib::IndexList::CreateRandom | ( | IRandomGenerator | rand,
|  | int | length,
|  | int | upperBound
| ) |  | `[inline, static]`

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.

Parameters:

  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).

static IndexList IG::Lib::IndexList::CreateRandom | ( | IRandomGenerator | rand,
|  | int | length,
|  | int | lowerBound,
|  | int | upperBound
| ) |  | `[inline, static]`

Creates and returns an index list with the specified number of unique random indices in the specified range by using the specified random generator.

Parameters:

  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).

static void IG::Lib::IndexList::SetRandom | ( | int | length,
|  | int | upperBound,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

Creates a prescribed number of unique random indices in the specified range.

Parameters:

  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.

static void IG::Lib::IndexList::SetRandom | ( | int | length,
|  | int | lowerBound,
|  | int | upperBound,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

Creates a prescribed number of unique random indices in the specified range.

Parameters:

  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.

static void IG::Lib::IndexList::SetRandom | ( | IRandomGenerator | rand,
|  | int | length,
|  | int | upperBound,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

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.

Parameters:

  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.

static void IG::Lib::IndexList::SetRandom | ( | IRandomGenerator | rand,
|  | int | length,
|  | int | lowerBound,
|  | int | upperBound,
|  | ref IndexList | indices
| ) |  | `[inline, static]`

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.

Parameters:

  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.

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

- IndexList.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events