wmpy.integration.integrator.Integrator¶
- class Integrator(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for classes that can integrate polynomials over polytopes.
Classes implementing this protocol must provide methods for both single integration and batch integration operations.
Methods
Computes a convex integral.
Computes a batch of integrals.
- integrate(polytope, polynomial)[source]¶
Computes a convex integral.
- Parameters:
polytope (
Polytope) – convex integration boundspolynomial (
Polynomial) – the integrand
- 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.