17using System.Collections.Generic;
23public partial class Solver
28 for (
int i = 0; i < count; ++i)
30 array[i] =
MakeVar(lb, ub, integer,
"");
38 for (
int i = 0; i < count; ++i)
40 array[i] =
MakeVar(lb, ub, integer, var_name + i);
48 for (
int i = 0; i < rows; ++i)
50 for (
int j = 0; j < cols; ++j)
52 matrix[i, j] =
MakeVar(lb, ub, integer,
"");
61 for (
int i = 0; i < rows; ++i)
63 for (
int j = 0; j < cols; ++j)
65 string var_name = name +
"[" + i +
", " + j +
"]";
66 matrix[i, j] =
MakeVar(lb, ub, integer, var_name);
85 for (
int i = 0; i < rows; ++i)
87 for (
int j = 0; j < cols; ++j)
98 for (
int i = 0; i < rows; ++i)
100 for (
int j = 0; j < cols; ++j)
102 string var_name = name +
"[" + i +
", " + j +
"]";
122 for (
int i = 0; i < rows; ++i)
124 for (
int j = 0; j < cols; ++j)
135 for (
int i = 0; i < rows; ++i)
137 for (
int j = 0; j < cols; ++j)
139 string var_name = name +
"[" + i +
", " + j +
"]";
159 for (
int i = 0; i < rows; ++i)
161 for (
int j = 0; j < cols; ++j)
172 for (
int i = 0; i < rows; ++i)
174 for (
int j = 0; j < cols; ++j)
176 string var_name = name +
"[" + i +
", " + j +
"]";
185 return constraint.
Extract(
this);
192 Dictionary<Variable, double> coefficients =
new Dictionary<Variable, double>();
193 double constant = expr.
Visit(coefficients);
194 foreach (KeyValuePair<Variable, double> pair
in coefficients)
205 Dictionary<Variable, double> coefficients =
new Dictionary<Variable, double>();
206 double constant = expr.
Visit(coefficients);
207 foreach (KeyValuePair<Variable, double> pair
in coefficients)