ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 14 Jun 2016 07:09:09 -0500Computing polyhedron from MIPhttps://ask.sagemath.org/question/33782/computing-polyhedron-from-mip/ I want to run the following code (I'm using SAGE v6.10 release version 2015-12-18):
P = MixedIntegerLinearProgram()
x = P.new_variable()
A = random_matrix(RR, 3, 2);
P.add_constraint(A*x <= [2.1,1.5,0.4])
P.polyhedron()
However, it outputs the error message:
> AttributeError: type object 'float'
> has no attribute 'fraction_field'
I noticed that if instead of using real variables I use only integer variables, then it works fine. For instance:
P = MixedIntegerLinearProgram()
x = P.new_variable()
A = random_matrix(ZZ, 3, 2);
P.add_constraint(A*x <= [2,1,0])
P.polyhedron()
outputs:
> A 2-dimensional polyhedron in QQ^2
> defined as the convex hull of 1 vertex
> and 2 rays
What do you suggest to overcome this problem?
ThanksmforetsTue, 14 Jun 2016 07:09:09 -0500https://ask.sagemath.org/question/33782/