| 1 | initial version |
A workaround ould be the following. Thanks to linearity, you can:
approximate all the real numbers by closest rational, for example
sage: QQ(1.2) 6/5
find a common denominator of each entry (using the gcd function an the denominator method for rational numbers)
P is a polyhedron and q is an integer, the fraction P/q is well defined in Sage and will result into a rescaled polyhedron. | 2 | No.2 Revision |
A workaround ould be the following. Thanks to linearity, you can:
sage: QQ(1.2)
QQ(1.2) results in 6/5gcd function an the denominator method for rational numbers)P is a polyhedron and q is an integer, the fraction P/q is well defined in Sage and will result into a rescaled polyhedron. | 3 | No.3 Revision |
A workaround ould be the following. Thanks to linearity, you can:
QQ(1.2) results in 6/5gcd function an the denominator method for rational numbers)P is a polyhedron and q is an integer, the fraction P/q is well defined in Sage and will result into a rescaled polyhedron.EDIT: note that with recent versions of Sage the polyhedron method works again for floating-point linear programs:
sage: 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()
....:
A 2-dimensional polyhedron in RDF^2 defined as the convex hull of 2 vertices and 2 rays
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.