File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,28 @@ namespace lp {
171
171
}
172
172
}
173
173
174
+ // total := - sum_{a_j > 0} a_j * ub(x_j) - sum_{a_j < 0} a_j * lb(x_j)
175
+ //
176
+ // for each a_j* x_j in row,
177
+ // bound := total / a_j + ub(x_j) = (total + (a_j * ub(x_j))) / a_j if a_j > 0
178
+ // bound := total / a_j + lb(x_j) = (total + (a_j * lb(x_j))) / a_j if a_j < 0
179
+
180
+ // example
181
+ // 3x + 2y + z = 0
182
+ // x <= 1, y <= 2, z <= 1
183
+ // total = - (3*1 + 2*2 + 1) = -8
184
+ // bound := -8/1 + 1 = -7
185
+ // => z >= -7
186
+
187
+ // If all variables are integer (or if x_j is integer).
188
+ // let K = lcm(a_j)
189
+ //
190
+ // totalK = K*total
191
+ // sum without x_j: bound := totalK + K * a_j * ub(x_j)
192
+ // K*a_j x >= bound
193
+ // x >= ceil(bound / K*a_j) = ceil ((total + a_j * ub(x_j)) / a_j) = ceil ((total / a_j) + ub(x_j))
194
+ //
195
+
174
196
void limit_all_monoids_from_below () {
175
197
int strict = 0 ;
176
198
m_total = m_rs.x ;
You can’t perform that action at this time.
0 commit comments