17using System.Collections.Generic;
102 circuit.
Tails.Add(tail);
103 circuit.
Heads.Add(head);
136 routes.
Tails.Add(tail);
137 routes.
Heads.Add(head);
171 foreach (
int value
in tuple)
173 table.Values.Add(value);
176 if (count != table.Vars.Count)
178 throw new ArgumentException(
"addTuple",
"tuple does not have the same length as the variables");
197 foreach (
long value
in tuple)
199 table.Values.Add(value);
202 if (count != table.Vars.Count)
204 throw new ArgumentException(
"addTuple",
"tuple does not have the same length as the variables");
222 if (tuples.GetLength(1) != table.
Vars.Count)
224 throw new ArgumentException(
"addTuples",
"tuples does not have the same length as the variables");
227 for (
int i = 0; i < tuples.GetLength(0); ++i)
229 for (
int j = 0; j < tuples.GetLength(1); ++j)
231 table.
Values.Add(tuples[i, j]);
250 if (tuples.GetLength(1) != table.
Vars.Count)
252 throw new ArgumentException(
"addTuples",
"tuples does not have the same length as the variables");
255 for (
int i = 0; i < tuples.GetLength(0); ++i)
257 for (
int j = 0; j < tuples.GetLength(1); ++j)
259 table.
Values.Add(tuples[i, j]);
310 this.cp_model_ = cp_model;
326 res.
TimeExprs.Add(cp_model_.GetLinearExpressionProto(cp_model_.GetLinearExpr(time)));
327 res.
LevelChanges.Add(cp_model_.GetLinearExpressionProto(cp_model_.GetLinearExpr(level_change)));
345 res.
TimeExprs.Add(cp_model_.GetLinearExpressionProto(cp_model_.GetLinearExpr(time)));
346 res.
LevelChanges.Add(cp_model_.GetLinearExpressionProto(cp_model_.GetLinearExpr(level_change)));
368 this.cp_model_ = cp_model;
376 LinearExpr demandExpr = cp_model_.GetLinearExpr(demand);
377 cumul.
Demands.Add(cp_model_.GetLinearExpressionProto(demandExpr));
385 foreach (var p
in intervals.Zip(demands, (i, d) =>
new { Interval = i, Demand = d }))
387 cumul.Intervals.Add(p.Interval.GetIndex());
388 LinearExpr demandExpr = cp_model_.GetLinearExpr(p.Demand);
389 cumul.Demands.
Add(cp_model_.GetLinearExpressionProto(demandExpr));