17using System.Collections.Generic;
25 Solver solver = GetSolver(vars);
31 Solver solver = GetSolver(vars);
37 Solver solver = GetSolver(vars);
43 Solver solver = GetSolver(cts);
45 for (
int i = 0; i < cts.Length; ++i)
47 vars[i] = cts[i].
Var();
53 Solver solver = GetSolver(exprs);
55 for (
int i = 0; i < exprs.Length; ++i)
57 vars[i] = exprs[i].
Var();
65 Solver solver = GetSolver(vars);
72 Solver solver = GetSolver(vars);
79 if (vars is
null || vars.Length <= 0)
80 throw new ArgumentException(
"Array <vars> cannot be null or empty");
85 private static Solver GetSolver(IntExpr[] expressions)
87 if (expressions is
null || expressions.Length <= 0)
88 throw new ArgumentException(
"Array <expr> cannot be null or empty");
90 return expressions[0].solver();
92 private static Solver GetSolver(IConstraintWithStatus[] cts)
94 if (cts is
null || cts.Length <= 0)
95 throw new ArgumentException(
"Array <cts> cannot be null or empty");
97 return cts[0].solver();
106 Solver solver = GetSolver(vars);
112 Solver solver = GetSolver(vars);
118 Solver solver = GetSolver(vars);
119 return solver.
MakeCount(vars, value, count);
124 Solver solver = GetSolver(vars);
129 Solver solver = GetSolver(vars);
134 Solver solver = GetSolver(vars);
139 Solver solver = GetSolver(vars);
144 Solver solver = GetSolver(vars);
145 return solver.
MakeDistribute(vars, card_min, card_max, card_size);
150 Solver solver = GetSolver(vars);
156 Solver solver = GetSolver(vars);
163 int rows = vars.GetLength(0);
164 int cols = vars.GetLength(1);
166 for (
int i = 0; i < rows; i++)
168 for (
int j = 0; j < cols; j++)
170 flat[i * cols + j] = vars[i, j];
178public partial class IntVarVector : IDisposable,
179 System.Collections.IEnumerable
182 System.Collections.Generic.IList<IntVar>
189 foreach (
IntVar element
in inVal)
199 var outVal =
new IntVar[inVal.Count];
200 inVal.CopyTo(outVal);
205public partial class SearchMonitorVector : IDisposable,
206 System.Collections.IEnumerable
209 System.Collections.Generic.IList<SearchMonitor>
227 inVal.CopyTo(outVal);
232public partial class DecisionBuilderVector : IDisposable,
233 System.Collections.IEnumerable
236 System.Collections.Generic.IList<DecisionBuilder>
254 inVal.CopyTo(outVal);
259public partial class IntervalVarVector : IDisposable,
260 System.Collections.IEnumerable
263 System.Collections.Generic.IList<IntervalVar>
281 inVal.CopyTo(outVal);
286public partial class SequenceVarVector : IDisposable,
287 System.Collections.IEnumerable
290 System.Collections.Generic.IList<SequenceVar>
308 inVal.CopyTo(outVal);
313public partial class LocalSearchOperatorVector : IDisposable,
314 System.Collections.IEnumerable
317 System.Collections.Generic.IList<LocalSearchOperator>
335 inVal.CopyTo(outVal);
340public partial class LocalSearchFilterVector : IDisposable,
341 System.Collections.IEnumerable
344 System.Collections.Generic.IList<LocalSearchFilter>
362 inVal.CopyTo(outVal);
367public partial class SymmetryBreakerVector : IDisposable,
368 System.Collections.IEnumerable
371 System.Collections.Generic.IList<SymmetryBreaker>
389 inVal.CopyTo(outVal);