1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
Vquad
=====
Vquad is a work-in-progress towards a general-purpose, robust, efficient, and
parallel library for numerical integration.
History
-------
Vquad is based on algorithm 4 from the article "Increasing the Reliability of
Adaptive Quadrature Using Explicit Interpolants", Pedro Gonnet, ACM TOMS 37,
26 (2010).
Usage example
-------------
.. code-block:: python
import numpy
import vquad
# Simple usage.
igral, err = vquad.vquad(numpy.cos, -1, 1, rtol=1e-10)
# Object interface.
it = vquad.Vquad(numpy.cos, -1, 1)
igral, err = it.improve_until(rtol=1e-10)
# Evaluate interpolant.
xs = numpy.linspace(-1, 1, 101)
ys = it(xs)
Benchmarks and tests
--------------------
Vquad includes extensive tests and benchmarks. The tests focus on verifying
correctness and can be run with
.. code-block:: bash
python3 -m pytest -s
The `-s` shows some statistics that are gathered during the testing.
The benchmarks take longer to run and allow to quantitatively compare the
performance of the algorithm. The benchmark is run by executing the vquad
module. To get help, run:
.. code-block:: bash
python3 -m vquad -h
|