wmpy.integration.axisaligned.AxisAlignedWrapper¶
- class AxisAlignedWrapper(integrator)[source]¶
Bases:
objectThis class implements an integration wrapper for efficiently handling axis-aligned integration bounds.
The enclosed integrator is called whenever the problem doesn’t fall into this subcase.
Default constructor.
- Parameters:
integrator (
Integrator) – the enclosed integrator instance
Methods
Computes a convex integral.
Computes a batch of integrals.
- integrate(polytope, polynomial)[source]¶
Computes a convex integral.
If the integration bounds are axis-aligned, the integral is computed in closed form.
- 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.