Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Integrate with Latte : error during the second calculation

I need to calculate integrals of polynomials over polyhedra. I'm using the latte package in a jupyter notebook. Here is a small problematic example:

from sage.features.latte import Latte
R.<x,y>=PolynomialRing(QQ)
P=Polyhedron(vertices=((0, -1), (2, 1), (-1, 1), (-1, -1)))
poly=R('2*(1+x)')
P.integrate(poly,algorithm='latte')

The first execution of the cell gives the (probably) correct result: 26/3. But on the second run, there appears a long error message, first an error message from Python, then a error from latte that ends with :

starting to integrate 1 product of linear forms.
Valuation.cpp: the methods are different.
triangulateion    : 26/3
cone-decomposition: 26/3
prod linear form  : 32/3

(Sorry I can't attaching a screenshot with the full message). I specify that I tried to change the algorithm option by indicating 'cone-decomposition' or 'triangulation' without success. I also checked that the error also occurs if we run the script directly in sage. Thanks to anyone who can help me.