1 | initial version |
Since everything is linear your solution set is a polyhedron. For simplicity, lets take it closed (use <= instead of <). Then:
sage: P = Polyhedron(eqns=[(-10,1,1,1)], ieqs=[(0,-1,1,0), (0,0,-1,1)])
sage: P.Hrepresentation()
(An equation (1, 1, 1) x - 10 == 0,
An inequality (-1, 1, 0) x + 0 >= 0,
An inequality (-1, -2, 0) x + 10 >= 0)
2 | No.2 Revision |
Since everything is linear your solution set is a polyhedron. For simplicity, lets take it closed (use <= instead of <). Then:
sage: P = Polyhedron(eqns=[(-10,1,1,1)], ieqs=[(0,-1,1,0), (0,0,-1,1)])
sage: P.Hrepresentation()
(An equation (1, 1, 1) x - 10 == 0,
An inequality (-1, 1, 0) x + 0 >= 0,
An inequality (-1, -2, 0) x + 10 >= 0)
Edit: Lattice points with all variables being positive as well (which is probably what the question is about)
sage: P = Polyhedron(eqns=[(-10,1,1,1)], ieqs=[(0,-1,1,0), (0,0,-1,1), (0,1,0,0)])
sage: P.Hrepresentation()
(An equation (1, 1, 1) x - 10 == 0,
An inequality (-1, 1, 0) x + 0 >= 0,
An inequality (-1, -2, 0) x + 10 >= 0,
An inequality (1, 0, 0) x + 0 >= 0)
sage: P.integral_points()
((0, 0, 10),
(0, 1, 9),
(0, 2, 8),
(0, 3, 7),
(0, 4, 6),
(0, 5, 5),
(1, 1, 8),
(1, 2, 7),
(1, 3, 6),
(1, 4, 5),
(2, 2, 6),
(2, 3, 5),
(2, 4, 4),
(3, 3, 4))