@@ -6292,19 +6292,19 @@ def positive_integer_relations(points):
6292
6292
a = nonpivot_relations .stack (a ).transpose ()
6293
6293
# a = sage_matrix_to_maxima(a)
6294
6294
# maxima.load("simplex")
6295
- MIP = MixedIntegerLinearProgram (maximization = False )
6296
- w = MIP .new_variable (integer = True , nonnegative = True )
6297
6295
new_relations = []
6298
6296
for i in range (n_nonpivots ):
6299
6297
# Find a non-negative linear combination of relations,
6300
6298
# such that all components are non-negative and the i-th one is 1
6299
+ MIP = MixedIntegerLinearProgram (maximization = False )
6300
+ w = MIP .new_variable (integer = True , nonnegative = True )
6301
6301
b = vector ([0 ] * i + [1 ] + [0 ] * (n_nonpivots - i - 1 ))
6302
- c = [0 ] * (n + i ) + [1 ] + [0 ] * (n_nonpivots - i - 1 )
6303
6302
MIP .add_constraint (a * w == b )
6303
+ c = [0 ] * (n + i ) + [1 ] + [0 ] * (n_nonpivots - i - 1 )
6304
6304
MIP .set_objective (sum (ci * w [i ] for i , ci in enumerate (c )))
6305
6305
# x = maxima.linear_program(a, b, c)
6306
6306
MIP .solve ()
6307
- x = MIP .get_values (w ).values ()[:n ]
6307
+ x = [ ZZ ( k ) for k in MIP .get_values (w ).values ()[:n ] ]
6308
6308
# x = x.sage()[0][:n]
6309
6309
v = relations .linear_combination_of_rows (x )
6310
6310
new_relations .append (v )
@@ -6315,7 +6315,7 @@ def positive_integer_relations(points):
6315
6315
for j in range (n ):
6316
6316
coef = relations [j ,nonpivots [i ]]
6317
6317
if coef < 0 :
6318
- relations .add_multiple_of_row (j , n + i , - coef )
6318
+ relations .add_multiple_of_row (j , n + i , - coef )
6319
6319
# Get a new basis
6320
6320
relations = relations .matrix_from_rows (relations .transpose ().pivots ())
6321
6321
# Switch to integers
0 commit comments