http://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&limit=20&action=history&feed=atomCubature (Multi-dimensional integration) - Revision history2024-03-29T04:54:43ZRevision history for this page on the wikiMediaWiki 1.7.3http://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4983&oldid=prevStevenj: /* Cubature */2017-07-19T21:06:35Z<p><span class="autocomment">Cubature</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:06, 19 July 2017</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 3:</strong></td>
<td colspan="2" align="left"><strong>Line 3:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[http://math.mit.edu/~stevenj Steven G. Johnson] has written a simple C package for '''adaptive multidimensional integration''' (''cubature'') of '''vector-valued integrands''' over '''hypercubes''', i.e. to compute integrals of the form:</td><td> </td><td style="background: #eee; font-size: smaller;">[http://math.mit.edu/~stevenj Steven G. Johnson] has written a simple C package for '''adaptive multidimensional integration''' (''cubature'') of '''vector-valued integrands''' over '''hypercubes''', i.e. to compute integrals of the form:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">:<math>\int_{a_1}^{b_1}\int_{a_2}^{b_2}\cdots\int_{a_n}^{b_n} f(\vec{x}) d^n\vec{x}</math></td><td>+</td><td style="background: #cfc; font-size: smaller;">:<math>\int_{a_1}^{b_1}\int_{a_2}^{b_2}\cdots\int_{a_n}^{b_n} <span style="color: red; font-weight: bold;">\vec{</span>f<span style="color: red; font-weight: bold;">}</span>(\vec{x}) d^n\vec{x}</math></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">(Of course, it can handle scalar integrands as the special case where <math>\vec{f}</math> is a one-dimensional vector: the dimensionalities of <math>\vec{f}</math> and <math>\vec{x}</math> are independent.) The integrand can be evaluated for an '''array of points at once''' to enable '''easy parallelization'''. The code, which is distributed as '''free software''' under the terms of the [[w:GNU General Public License|GNU General Public License]] (v2 or later), implements two algorithms for adaptive integration.</td><td> </td><td style="background: #eee; font-size: smaller;">(Of course, it can handle scalar integrands as the special case where <math>\vec{f}</math> is a one-dimensional vector: the dimensionalities of <math>\vec{f}</math> and <math>\vec{x}</math> are independent.) The integrand can be evaluated for an '''array of points at once''' to enable '''easy parallelization'''. The code, which is distributed as '''free software''' under the terms of the [[w:GNU General Public License|GNU General Public License]] (v2 or later), implements two algorithms for adaptive integration.</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4982&oldid=prevStevenj: /* Cubature */2017-07-19T21:05:21Z<p><span class="autocomment">Cubature</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 21:05, 19 July 2017</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 3:</strong></td>
<td colspan="2" align="left"><strong>Line 3:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">[http://math.mit.edu/~stevenj Steven G. Johnson] has written a simple C package for '''adaptive multidimensional integration''' (''cubature'') of '''vector-valued integrands''' over '''hypercubes''', i.e. to compute integrals of the form:</td><td> </td><td style="background: #eee; font-size: smaller;">[http://math.mit.edu/~stevenj Steven G. Johnson] has written a simple C package for '''adaptive multidimensional integration''' (''cubature'') of '''vector-valued integrands''' over '''hypercubes''', i.e. to compute integrals of the form:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">:<math>\int_{a_1}^{b_1}\int_{a_2}^{b_2}\cdots\int_{a_n}^{b_n} <span style="color: red; font-weight: bold;">\vec{</span>f<span style="color: red; font-weight: bold;">}</span>(\vec{x}) d^n\vec{x}</math></td><td>+</td><td style="background: #cfc; font-size: smaller;">:<math>\int_{a_1}^{b_1}\int_{a_2}^{b_2}\cdots\int_{a_n}^{b_n} f(\vec{x}) d^n\vec{x}</math></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">(Of course, it can handle scalar integrands as the special case where <math>\vec{f}</math> is a one-dimensional vector: the dimensionalities of <math>\vec{f}</math> and <math>\vec{x}</math> are independent.) The integrand can be evaluated for an '''array of points at once''' to enable '''easy parallelization'''. The code, which is distributed as '''free software''' under the terms of the [[w:GNU General Public License|GNU General Public License]] (v2 or later), implements two algorithms for adaptive integration.</td><td> </td><td style="background: #eee; font-size: smaller;">(Of course, it can handle scalar integrands as the special case where <math>\vec{f}</math> is a one-dimensional vector: the dimensionalities of <math>\vec{f}</math> and <math>\vec{x}</math> are independent.) The integrand can be evaluated for an '''array of points at once''' to enable '''easy parallelization'''. The code, which is distributed as '''free software''' under the terms of the [[w:GNU General Public License|GNU General Public License]] (v2 or later), implements two algorithms for adaptive integration.</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4889&oldid=prevStevenj: /* Download */ updated R interface2016-12-19T16:41:19Z<p><span class="autocomment">Download -</span> updated R interface</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 16:41, 19 December 2016</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 32:</strong></td>
<td colspan="2" align="left"><strong>Line 32:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The <code>test.c</code> file contains a little test program which is produced if you compile that file with <code>-DHCUBATURE</code> or <code>-DPCUBATURE</code> and link with <code>hcubature.c</code> or <code>pcubature.c</code>, respectively, as described below.</td><td> </td><td style="background: #eee; font-size: smaller;">The <code>test.c</code> file contains a little test program which is produced if you compile that file with <code>-DHCUBATURE</code> or <code>-DPCUBATURE</code> and link with <code>hcubature.c</code> or <code>pcubature.c</code>, respectively, as described below.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">B. Narasimhan wrote a [[w:GNU R|GNU R]] interface <span style="color: red; font-weight: bold;">for an earlier version these routines</span>, which can be downloaded here: [http://cran.r-project.org/web/packages/cubature/index.html http://cran.r-project.org/web/packages/cubature/index.html<span style="color: red; font-weight: bold;">]. The most recent version of the cubature code with the old interface (h-adaptive only) may be downloaded from [http://ab-initio.mit.edu/cubature/cubature-20101018.tgz cubature-20101018.tgz</span>].</td><td>+</td><td style="background: #cfc; font-size: smaller;">B. Narasimhan wrote a [[w:GNU R|GNU R]] interface, which can be downloaded here: [http://cran.r-project.org/web/packages/cubature/index.html http://cran.r-project.org/web/packages/cubature/index.html].</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">A [http://julialang.org/ Julia] interface can be obtained from [https://github.com/stevengj/Cubature.jl Cubature.jl]. A Python [https://github.com/saullocastro/cubature cubature.py interface] written by Saullo Castro is also available.</td><td> </td><td style="background: #eee; font-size: smaller;">A [http://julialang.org/ Julia] interface can be obtained from [https://github.com/stevengj/Cubature.jl Cubature.jl]. A Python [https://github.com/saullocastro/cubature cubature.py interface] written by Saullo Castro is also available.</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4846&oldid=prevStevenj: /* Test program */ updated2015-09-25T14:54:54Z<p><span class="autocomment">Test program -</span> updated</p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:54, 25 September 2015</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 165:</strong></td>
<td colspan="2" align="left"><strong>Line 165:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">== Test program ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Test program ==</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">To compile a test <span style="color: red; font-weight: bold;">program</span>, just compile <code><span style="color: red; font-weight: bold;">cubature</span>.c</code> <span style="color: red; font-weight: bold;">while #defining </span><code><span style="color: red; font-weight: bold;">TEST_INTEGRATOR</span></code>, e.g. (on Unix or GNU/Linux) via:</td><td>+</td><td style="background: #cfc; font-size: smaller;">To compile a test <span style="color: red; font-weight: bold;">programs</span>, just compile <code><span style="color: red; font-weight: bold;">hcubature</span>.c</code> <span style="color: red; font-weight: bold;">and/or </span><code><span style="color: red; font-weight: bold;">pcubature.c</code> along with the test program <code>test.c</span></code>, e.g. (on Unix or GNU/Linux) via:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> cc -<span style="color: red; font-weight: bold;">DTEST_INTEGRATOR </span>-o <span style="color: red; font-weight: bold;">cubature_test cubature</span>.c -lm</td><td>+</td><td style="background: #cfc; font-size: smaller;"> cc -<span style="color: red; font-weight: bold;">o htest test.c hcubature.c -l</span></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"><span style="color: red; font-weight: bold;"> cc </span>-o <span style="color: red; font-weight: bold;">ptest -DPCUBATURE test.c pcubature</span>.c -lm</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The usage is then:</td><td> </td><td style="background: #eee; font-size: smaller;">The usage is then:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> ./<span style="color: red; font-weight: bold;">cubature_test </span><dim> <tol> <integrand> <maxeval></td><td>+</td><td style="background: #cfc; font-size: smaller;"> ./<span style="color: red; font-weight: bold;">htest </span><dim> <tol> <integrand> <maxeval></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">where <dim> = # dimensions, <tol> = relative tolerance, <integrand> is 0–7 for one of eight possible test integrands (see below) and <maxeval> is the maximum number of function evaluations (0 for none, the default).</td><td>+</td><td style="background: #cfc; font-size: smaller;">where <dim> = # dimensions, <tol> = relative tolerance, <integrand> is 0–7 for one of eight possible test integrands (see below) and <maxeval> is the maximum number of function evaluations (0 for none, the default<span style="color: red; font-weight: bold;">). Similarly for <code>ptest</code> (which tests the <code>pcubature</code> function</span>).</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The different test integrands are:</td><td> </td><td style="background: #eee; font-size: smaller;">The different test integrands are:</td></tr>
<tr><td colspan="2" align="left"><strong>Line 188:</strong></td>
<td colspan="2" align="left"><strong>Line 189:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">For example:</td><td> </td><td style="background: #eee; font-size: smaller;">For example:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;"> ./<span style="color: red; font-weight: bold;">cubature_test </span>3 1e-5 4</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ./<span style="color: red; font-weight: bold;">htest </span>3 1e-5 4</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">integrates the Gaussian function (4) to a desired relative error tolerance of 10<sup>–5</sup> in 3 dimensions. The output is:</td><td> </td><td style="background: #eee; font-size: smaller;">integrates the Gaussian function (4) to a desired relative error tolerance of 10<sup>–5</sup> in 3 dimensions. The output is:</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4785&oldid=prevStevenj: /* Download */2014-11-07T14:12:51Z<p><span class="autocomment">Download</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:12, 7 November 2014</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 26:</strong></td>
<td colspan="2" align="left"><strong>Line 26:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0.<span style="color: red; font-weight: bold;">1</span>.tgz cubature-1.0.<span style="color: red; font-weight: bold;">1</span>.tgz]</td><td>+</td><td style="background: #cfc; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0.<span style="color: red; font-weight: bold;">2</span>.tgz cubature-1.0.<span style="color: red; font-weight: bold;">2</span>.tgz]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4784&oldid=prevStevenj: /* Download */2014-11-07T14:01:34Z<p><span class="autocomment">Download</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:01, 7 November 2014</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 26:</strong></td>
<td colspan="2" align="left"><strong>Line 26:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0.tgz cubature-1.0.1.tgz]</td><td>+</td><td style="background: #cfc; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0<span style="color: red; font-weight: bold;">.1</span>.tgz cubature-1.0.1.tgz]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4707&oldid=prevStevenj: /* Download */2013-08-27T14:09:00Z<p><span class="autocomment">Download</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:09, 27 August 2013</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 34:</strong></td>
<td colspan="2" align="left"><strong>Line 34:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">B. Narasimhan wrote a [[w:GNU R|GNU R]] interface for an earlier version these routines, which can be downloaded here: [http://cran.r-project.org/web/packages/cubature/index.html http://cran.r-project.org/web/packages/cubature/index.html]. The most recent version of the cubature code with the old interface (h-adaptive only) may be downloaded from [http://ab-initio.mit.edu/cubature/cubature-20101018.tgz cubature-20101018.tgz].</td><td> </td><td style="background: #eee; font-size: smaller;">B. Narasimhan wrote a [[w:GNU R|GNU R]] interface for an earlier version these routines, which can be downloaded here: [http://cran.r-project.org/web/packages/cubature/index.html http://cran.r-project.org/web/packages/cubature/index.html]. The most recent version of the cubature code with the old interface (h-adaptive only) may be downloaded from [http://ab-initio.mit.edu/cubature/cubature-20101018.tgz cubature-20101018.tgz].</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">A [http://julialang.org/ Julia] interface can be obtained from [https://github.com/stevengj/Cubature.jl Cubature.jl].</td><td>+</td><td style="background: #cfc; font-size: smaller;">A [http://julialang.org/ Julia] interface can be obtained from [https://github.com/stevengj/Cubature.jl Cubature.jl]<span style="color: red; font-weight: bold;">. A Python [https://github.com/saullocastro/cubature cubature.py interface] written by Saullo Castro is also available</span>.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">== Usage ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Usage ==</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4706&oldid=prevStevenj: /* Cubature */2013-08-23T14:54:10Z<p><span class="autocomment">Cubature</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:54, 23 August 2013</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 17:</strong></td>
<td colspan="2" align="left"><strong>Line 17:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The second, ''p''-adaptive integration (repeatedly doubling the degree of the quadrature rules until convergence is achieved), is based on a tensor product of [[w:Clenshaw–Curtis quadrature|Clenshaw–Curtis quadrature]] rules. This algorithm is often superior to ''h''-adaptive integration for [[w:Smooth function|smooth]] integrands in a few (&le;3) dimensions, but is a poor choice in higher dimensions or for non-smooth integrands.</td><td> </td><td style="background: #eee; font-size: smaller;">The second, ''p''-adaptive integration (repeatedly doubling the degree of the quadrature rules until convergence is achieved), is based on a tensor product of [[w:Clenshaw–Curtis quadrature|Clenshaw–Curtis quadrature]] rules. This algorithm is often superior to ''h''-adaptive integration for [[w:Smooth function|smooth]] integrands in a few (&le;3) dimensions, but is a poor choice in higher dimensions or for non-smooth integrands.</td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr>
<tr><td colspan="2"> </td><td>+</td><td style="background: #cfc; font-size: smaller;">For the most part, the ''p''-adaptive routines below are drop-in replacements for the ''h''-adaptive routines, with the same arguments etcetera, so you can experiment to see which one works best for your problem. One difference: the ''h''-adaptive routines do *not* evaluate the integrand on the boundaries of the integration volume, whereas the ''p''-adaptive routines *do* evaluate the integrand at the boundaries. This means that the ''p'' adaptive routines require more care in cases where there are singularities at the boundaries.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">I am also grateful to Dmitry Turbiner (dturbiner&nbsp;&alpha;&tau;&nbsp;alum.mit.edu), who implemented an initial prototype of the "vectorized" functionality (see below) for evaluating an array of points in a single call, which facilitates parallelization of the integrand evaluation.</td><td> </td><td style="background: #eee; font-size: smaller;">I am also grateful to Dmitry Turbiner (dturbiner&nbsp;&alpha;&tau;&nbsp;alum.mit.edu), who implemented an initial prototype of the "vectorized" functionality (see below) for evaluating an array of points in a single call, which facilitates parallelization of the integrand evaluation.</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4705&oldid=prevStevenj: /* Infinite intervals */2013-08-23T14:51:18Z<p><span class="autocomment">Infinite intervals</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 14:51, 23 August 2013</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 159:</strong></td>
<td colspan="2" align="left"><strong>Line 159:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">In multiple dimensions, one simply performs this change of variables on each dimension separately, as desired, multiplying the integrand by the corresponding Jacobian factor for each dimension being transformed.</td><td> </td><td style="background: #eee; font-size: smaller;">In multiple dimensions, one simply performs this change of variables on each dimension separately, as desired, multiplying the integrand by the corresponding Jacobian factor for each dimension being transformed.</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">The Jacobian factors diverge as the endpoints are approached. However, if ''f''(''x'') goes to zero at least as fast as 1/''x''<sup>2</sup>, then the limit of the integrand (including the Jacobian factor) is finite at the endpoints. If your ''f''(''x'') vanishes more slowly than 1/''x''<sup>2</sup> but still faster than 1/''x'', then the integrand blows up at the endpoints but the integral is still finite (it is an integrable singularity), so the code will work (although it may take many function evaluations to converge). If your ''f''(''x'') vanishes only as 1/''x'', then it is not [[w:Absolute convergence|absolutely convergent]] and much more care is required even to define what you are trying to compute. (In any case, the quadrature/cubature rules currently employed in <code>cubature.c</code> do not evaluate the integrand at the endpoints, so you need not implement special handling for |''t''|=1.)</td><td>+</td><td style="background: #cfc; font-size: smaller;">The Jacobian factors diverge as the endpoints are approached. However, if ''f''(''x'') goes to zero at least as fast as 1/''x''<sup>2</sup>, then the limit of the integrand (including the Jacobian factor) is finite at the endpoints. If your ''f''(''x'') vanishes more slowly than 1/''x''<sup>2</sup> but still faster than 1/''x'', then the integrand blows up at the endpoints but the integral is still finite (it is an integrable singularity), so the code will work (although it may take many function evaluations to converge). If your ''f''(''x'') vanishes only as 1/''x'', then it is not [[w:Absolute convergence|absolutely convergent]] and much more care is required even to define what you are trying to compute. (In any case, the <span style="color: red; font-weight: bold;">h-adaptive </span>quadrature/cubature rules currently employed in <code>cubature.c</code> do not evaluate the integrand at the endpoints, so you need not implement special handling for |''t''|=1.)</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">== Test program ==</td><td> </td><td style="background: #eee; font-size: smaller;">== Test program ==</td></tr>
</table>
Stevenjhttp://ab-initio.mit.edu/wiki/index.php?title=Cubature_%28Multi-dimensional_integration%29&diff=4703&oldid=prevStevenj: /* Download */2013-05-23T19:09:13Z<p><span class="autocomment">Download</span></p>
<table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;">
<tr>
<td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td>
<td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 19:09, 23 May 2013</td>
</tr>
<tr><td colspan="2" align="left"><strong>Line 24:</strong></td>
<td colspan="2" align="left"><strong>Line 24:</strong></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td><td> </td><td style="background: #eee; font-size: smaller;">The current version of the code can be downloaded from:</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td>-</td><td style="background: #ffa; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0.tgz cubature-1.0.tgz]</td><td>+</td><td style="background: #cfc; font-size: smaller;">* [http://ab-initio.mit.edu/cubature/cubature-1.0.tgz cubature-1.0<span style="color: red; font-weight: bold;">.1</span>.tgz]</td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr>
<tr><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td><td> </td><td style="background: #eee; font-size: smaller;">a [[w:gzip|gzipped]] [[w:tar (file format)|tar]] file. This unpacks to a directory containing a <code>README</code> file with instructions and a stand-alone <code>hcubature.c</code> or <code>pcubature.c</code> file (along with a couple of private header files) that you can compile and link into your program for h-adaptive and p-adaptive integration, respectively, and a header file <code>cubature.h</code> that you <code>#include</code>. </td></tr>
</table>
Stevenj