Iterators.Product Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Product(Int32[]) | Enumerates the indexes of the Cartesian product of the specified length from a set of the specified size. |
Product( | Enumerates the indexes of the Cartesian product of the specified length from a set of the specified size. |
Product(Int32[], Int32[]) | Enumerates the indexes of the Cartesian product of the specified length from a set of the specified size. |
Product( | Enumerates the indexes of the Cartesian product of the specified length from a set of the specified size. |
Product<T>(IList<T>, Int32) | Enumerates the Cartesian product of the specified length from a set of items. |
Product(Int32[])
Enumerates the indexes of the Cartesian product of the specified length
from a set of the specified size.
public static IEnumerable<int[]> Product(
int[] counts
)
Parameters
- counts Int32[]
- An array containing the length of each dimension.
Return Value
IEnumerable<Int32[]>A sequence of integer arrays that contain the indexes of all selections of elements from sets of size counts.
Exceptions
Argument | counts is null. |
Product<T>(IList<T>, Int32)
Enumerates the Cartesian product of the specified length from a set of items.
public static IEnumerable<T[]> Product<T>(
IList<T> items,
int length
)
Parameters
Type Parameters
- T
- The type of the items.
Return Value
IEnumerable<T[]>A sequence of arrays that contain all selections of length elements with replacement from items.
Exceptions
Argument | items is null. |
Argument | length is less than zero. |
Product(Int32, Int32)
Enumerates the indexes of the Cartesian product of the specified length
from a set of the specified size.
public static IEnumerable<int[]> Product(
int count,
int length
)
Parameters
Return Value
IEnumerable<Int32[]>A sequence of integer arrays that contain the indexes of all selections of length elements with replacement from a set of size count.
Exceptions
Argument | length is less than zero. |
Product(Int32[], Int32[])
Enumerates the indexes of the Cartesian product of the specified length
from a set of the specified size.
public static IEnumerable<int[]> Product(
int[] counts,
int[] result
)
Parameters
- counts Int32[]
- An array containing the length of each dimension.
- result Int32[]
- An array that is to hold the result.
Return Value
IEnumerable<Int32[]>A sequence of integer arrays that contain the indexes of all selections of elements from sets of size counts.
Remarks
The indexes are returned each time in the same array, result. Its elements should not be modified. If they are modified, the results are unpredictable.
Exceptions
Argument | counts is null. |
Dimension | The length of result is not equal to the length of counts. |
Product(Int32, Int32, Int32[])
Enumerates the indexes of the Cartesian product of the specified length
from a set of the specified size.
public static IEnumerable<int[]> Product(
int count,
int length,
int[] result
)
Parameters
- count Int32
- The size of the set to draw selections from.
- length Int32
- The length of the selections.
- result Int32[]
- An array that is to hold the result.
Return Value
IEnumerable<Int32[]>A sequence of integer arrays that contain the indexes of all selections of length elements with replacement from a set of size count.
Remarks
The indexes are returned each time in the same array, result. Its elements should not be modified. If they are modified, the results are unpredictable.
Exceptions
Argument | length is less than zero. |