wmpy.integration.latte.LattEIntegrator¶
- class LattEIntegrator(algorithm='--cone-decompose')[source]¶
Bases:
objectThis class is a wrapper for the LattE integrator. It computes the exact integral of a polynomial over a convex polytope.
Default constructor.
- Parameters:
algorithm (
str) – either “–triangulate” or “–cone-decompose”- Raises:
ValueError if algorithm is not supported." –
Methods
Computes a convex integral.
Computes a batch of integrals.
Attributes
ALGORITHMSALG_CONE_DECOMPOSEALG_TRIANGULATEDEF_ALGORITHM- integrate(polytope, polynomial)[source]¶
Computes a convex integral.
- Parameters:
polytope (
Polytope) – convex integration bounds (a Polytope)polynomial (
Polynomial) – integrand (a Polynomial)
- Return type:
- Returns:
The result of the integration as a non-negative scalar value.
- integrate_batch(convex_integrals)[source]¶
Computes a batch of integrals.
- Parameters:
convex_integrals (
Collection[tuple[Polytope,Polynomial]]) – a collection of bounds/integrand pairs- Return type:
ndarray- Returns:
The result of the batch of integrations as a numpy array.