SetBuilderDefinitionHasElements(FuncIEnumerableInt32, String) Method

Finalizes the set builder and returns the resulting set.

The set generates elements by the function getIndices.

For instance, the following set:

C#
IEnumerable<int> GetHighPriorityIndices() => new int[] { 1, 4, 9 };
Set p = Set("p").Represents("prioritized projects").HasElements(GetHighPriorityIndices);
has elements { 1, 4, 9 }.

Definition

Namespace: Orx.MathProg
Assembly: Orx.MathProg (in Orx.MathProg.dll) Version: 1.0.0
C#
public Set HasElements(
	Func<IEnumerable<int>> getIndices,
	string expression = ""
)

Parameters

getIndices  FuncIEnumerableInt32
Function to generate indices/elements of the set.
expression  String  (Optional)
Element generator expression.

Return Value

Set

See Also