wmpy.integration.rejection.RejectionIntegrator¶
- class RejectionIntegrator(n_samples=None, seed=None)[source]¶
Bases:
objectThis class implements an integrator based on rejection sampling. The integral is approximated with its Monte Carlo (MC) estimate.
Default constructor.
- Parameters:
Methods
Computes a convex integral.
Computes a batch of integrals.
Attributes
DEF_N_SAMPLES- 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.