A set is constructed using builder pattern that can be initiated by Set(String) function. The following example demonstrates construction of sets.
Set j = Set("j").Represents("Nodes of the network.").HasElementsUntil(data.NumNodes);
Set i = Set("i").Represents("Tails of edges incoming to j").DependsOn(j).HasElements(data.TailsOf);
Set k = Set("k").Represents("Heads of edges outgoing from j").DependsOn(j).HasElements(data.HeadsOf);
// or definitions can be omitted; however, they might be useful in automatically generated LaTex, html or text documentations.
Set j = Set("j").HasElementsUntil(data.NumNodes);
Set i = Set("i").DependsOn(j).HasElements(data.TailsOf);
Set k = Set("k").DependsOn(j).HasElements(data.HeadsOf);
The following flow balance constraint demonstrates the usage of the sets.
Set i = ...;
Set j = ...;
VarD2 x = ...; // arc flow variable
ParD1 supply = ...; // parameter representing the supply at each node
Constraint flowBal = forall(i)
| sum(over(j), x[i, j]) == sum(over(j), x[j, i]) + supply[i];
public class Set
Key | Key of the set. |
Alias |
Creates and returns an alias of the set.
Alias allows to reuse a set definition in different places; such as i and j in the following flow balance constraint example. C#
|
Alias(String) |
Creates and returns an alias of the set; however with a new key (recommended).
Alias allows to reuse a set definition in different places; such as i and j in the following flow balance constraint example. C#
|
Equals | (Inherited from Object) |
Finalize | (Inherited from Object) |
GetHashCode | (Inherited from Object) |
GetSummary | Returns a summary information about the set; useful for debugging. |
GetType | (Inherited from Object) |
MemberwiseClone | (Inherited from Object) |
ToString | (Inherited from Object) |
Addition(Double, Set) | Adds two scalars one of which is implicitly created from a set, and returns the resulting scalar. |
Addition(Set, Set) | Adds two scalars that are implicitly created from the sets, and returns the resulting scalar. |
Addition(Set, Double) | Adds two scalars one of which is implicitly created from a set, and returns the resulting scalar. |
Division(Double, Set) | Divides one scalar by another scalar, one of which is implicitly created from a set, and returns the resulting scalar. |
Division(Set, Set) | Divides a scalar by another which are implicitly created from the sets, and returns the resulting scalar. |
Division(Set, Double) | Divides one scalar by another scalar, one of which is implicitly created from a set, and returns the resulting scalar. |
Multiply(Double, Set) | Multiplies two scalars one of which is implicitly created from a set, and returns the resulting scalar. |
Multiply(Set, Set) | Multiplies two scalars that are implicitly created from the sets, and returns the resulting scalar. |
Multiply(Set, Double) | Multiplies two scalars one of which is implicitly created from a set, and returns the resulting scalar. |
Subtraction(Double, Set) | Subtracts one scalar from another scalar, one of which is implicitly created from a set, and returns the resulting scalar. |
Subtraction(Set, Set) | Substracts a scalar from another which are implicitly created from the sets, and returns the resulting scalar. |
Subtraction(Set, Double) | Subtracts one scalar from another scalar, one of which is implicitly created from a set, and returns the resulting scalar. |
UnaryNegation(Set) | Implicitly converts the set to a scalar which will take its value lazily; and negates the scalar. |
Definition | Definition of the set. |
GeneratorDefinition | Definition of the function that generates the set's elements. |