quadax.GaussKronrodRule
- class quadax.GaussKronrodRule(order: int = 21, norm: Callable | float | int = inf, batch_size: int | None = None)Source
Integrate a function from a to b using a fixed order Gauss-Kronrod rule.
Integration is performed using an order n Kronrod rule with error estimated using an embedded n//2 order Gauss rule.
- Parameters:
order (
int) – Order of integration scheme, one of 15, 21, 31, 41, 51, 61.norm (
int,callable) – Norm to use for measuring error for vector valued integrands. No effect if the integrand is scalar valued. If an int, uses p-norm of the given order, otherwise should be callable.batch_size (
int, optional) – Maximum number of points at which to evaluate the integrand in parallel. Default is all of the rule’s nodes at once, which is fastest but makes peak memory scale with the order. Values above the number of nodes are clipped to it. A value that does not divide the number of nodes leaves a remainder, which is evaluated together in one smaller batch, so the integrand is traced twice but never evaluated at more points than the rule has nodes.
Methods
integrate(fun, a, b, args)Integrate a function from a to b using a nested rule.
norm(x)Norm to use for measuring error for vector valued integrands.
Attributes
How many evaluations of the integrand one application of the rule costs.