Builder pattern is used for creating all mathematical symbols, to make creating rather complicated variants more convenient.
ParD0 bigM = Parameter("M").Represents("sufficiently large number").HasValue(Math.Max(demands.Max(), capacities.Max()));
ParD0 lazyBigM = Parameter("M").Represents("sufficiently large number").HasValue(() => Math.Max(demands.Max(), capacities.Max()));
ParD1 demand = Parameter("dem").Represents("Node demand; i.e., amount of flow that needs to be transported to each node.")
.HasIndices(i).HasValues(data.NodeDemand);
ParD2 costFlow = Parameter("c").Represents("Unit flow cost on edge (i, j).").HasIndices(i, j).HasValues(data.EdgeFlowCost);
// or definitions can be omitted; however, they might be useful in automatically generated LaTex, html or text documentations.
ParD0 bigM = Parameter("M").HasValue(Math.Max(demands.Max(), capacities.Max()));
ParD0 lazyBigM = Parameter("M").HasValue(() => Math.Max(demands.Max(), capacities.Max()));
ParD1 demand = Parameter("dem").HasIndices(i).HasValues(data.NodeDemand);
ParD2 costFlow = Parameter("c").HasIndices(i, j).HasValues(data.EdgeFlowCost);
public static ParameterBuilderKey Parameter(
string key
)