Is there a C++ implementation for numerical quadrature/cubature?
Hi, all in the list! I need some functions to handle numerical quadrature/cubature in C++. I found that only few packages, e.g. GSL, could do this end. However, those ones are not pure C++ implementations. Although, odeint package in Boost can partially satisfy my need. I want to know whether there is a C++ implementation for numerical quadrature/cubature in Boost. Any suggestion? -- Best wishes, Easior ------ "It was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only." TALES OF TWO CITIES, by Charles Dickens
Even outside Boost, I would be interested. Having quadrature/cubature methods that are actually templated and an arbitrary precision/double-double type can be inserted with zero hassle would be nice. By the way, does anyone know of a complete double-double implementation? (with transecendental functions) Feladó: Easior Lars via Boost-users Elküldve: 2017. augusztus 19., szombat 6:10 Címzett: boost-users@lists.boost.org Másolatot kap: Easior Lars Tárgy: [Boost-users] Is there a C++ implementation for numericalquadrature/cubature? Hi, all in the list! I need some functions to handle numerical quadrature/cubature in C++. I found that only few packages, e.g. GSL, could do this end. However, those ones are not pure C++ implementations. Although, odeint package in Boost can partially satisfy my need. I want to know whether there is a C++ implementation for numerical quadrature/cubature in Boost. Any suggestion? -- Best wishes, Easior ------ "It was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only." TALES OF TWO CITIES, by Charles Dickens _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
On 19/08/2017 06:26, Máté Ferenc Nagy-Egri via Boost-users wrote:
Even outside Boost, I would be interested. Having quadrature/cubature methods that are actually templated and an arbitrary precision/double-double type can be inserted with zero hassle would be nice.
By the way, does anyone know of a complete double-double implementation? (with transecendental functions)
Not a double-double (which sucks IMO, as it's impossible to reason rationally about) but Boost.Multiprecision has: * float128: thin wrapper around __float128 and libquadmath for compilers that support that type (mostly GCC). * cpp_bin_float_quad: all C++ quad precision emulation, much slower than the above, but available for all compilers. Both have full std lib support, and work with all the Boost.Math functions too (so all the special functions and other FP utilities). For quadrature support see my reply to the OP. John. --- This email has been checked for viruses by AVG. http://www.avg.com
On 19/08/2017 05:10, Easior Lars via Boost-users wrote:
Hi, all in the list!
I need some functions to handle numerical quadrature/cubature in C++. I found that only few packages, e.g. GSL, could do this end. However, those ones are not pure C++ implementations. Although, odeint package in Boost can partially satisfy my need. I want to know whether there is a C++ implementation for numerical quadrature/cubature in Boost. Any suggestion?
We're working on it for Boost.Math: * The next release will have fairly simple adaptive trapezoidal quadrature. * I'm trying to quash the last few CI failures for double-exponential quadrature now (tanh-sinh, exp-sinh and sinh-sinh) - that looks to be a remarkably efficient and general purpose integrator (and yes it works very well with arbitrary precision types). That's targeted for 1.66. * We have the bits in place for adaptive Gauss-Konrad, but haven't worked out the details yet.... not sure if that one will make 1.66 or a later release. If you wanted to try out the double-exponential code now, it's here: https://github.com/boostorg/math/pull/72, I've currently broken the tests (!), but the headers are all ready to go, and if you'd like to give the new code a test drive and report back that would be great. As with most quadrature routines, it's fairly easy to break if you're cunning enough (which is why the tests are currently broken!), but it does handle endpoint singularities very well, and is a lot more robust and efficient than I expected. I've put a PDF build of the docs from that branch here: https://www.dropbox.com/s/9uwe1tujc0p12b5/math.pdf?dl=0 you will need to navigate to the tools->quadrature section (page 745). HTH, John. --- This email has been checked for viruses by AVG. http://www.avg.com
"JMvB" == John Maddock via Boost-users
writes:
Thank you for your useful information. JMvB> * The next release will have fairly simple adaptive trapezoidal quadrature. JMvB> * I'm trying to quash the last few CI failures for double-exponential quadrature JMvB> now (tanh-sinh, exp-sinh and sinh-sinh) - that looks to be a remarkably efficient JMvB> and general purpose integrator (and yes it works very well with arbitrary JMvB> precision types). That's targeted for 1.66. JMvB> * We have the bits in place for adaptive Gauss-Konrad, but haven't worked out the JMvB> details yet.... not sure if that one will make 1.66 or a later release. I have forked boost math library on GitHub and want to make some testing. However, I have three issues to ask you: * Which branch does the quadrature exist in? develop or other branch? * Can I build boost library just only with math module? I guess, I should checkout all of boost modules in order to success in building boost library. JMvB> If you wanted to try out the double-exponential code now, it's here: JMvB> https://github.com/boostorg/math/pull/72, I've currently broken the tests (!), JMvB> but the headers are all ready to go, and if you'd like to give the new code a JMvB> test drive and report back that would be great. As with most quadrature routines, JMvB> it's fairly easy to break if you're cunning enough (which is why the tests are JMvB> currently broken!), but it does handle endpoint singularities very well, and is a JMvB> lot more robust and efficient than I expected. I've put a PDF build of the docs JMvB> from that branch here: https://www.dropbox.com/s/9uwe1tujc0p12b5/math.pdf?dl=0you JMvB> will need to navigate to the tools->quadrature section (page 745). * Can you tell how to build Boost.math documentation? I found it is diffcult to build Boost documentations by boostbook. Is there any guideline to do this? -- Best wishes, Easior Lars ------ "It was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only." TALES OF TWO CITIES, by Charles Dickens
On 20/08/2017 03:09, Easior Lars via Boost-users wrote:
"JMvB" == John Maddock via Boost-users
writes: Thank you for your useful information. JMvB> * The next release will have fairly simple adaptive trapezoidal quadrature. JMvB> * I'm trying to quash the last few CI failures for double-exponential quadrature JMvB> now (tanh-sinh, exp-sinh and sinh-sinh) - that looks to be a remarkably efficient JMvB> and general purpose integrator (and yes it works very well with arbitrary JMvB> precision types). That's targeted for 1.66. JMvB> * We have the bits in place for adaptive Gauss-Konrad, but haven't worked out the JMvB> details yet.... not sure if that one will make 1.66 or a later release.
I have forked boost math library on GitHub and want to make some testing. However, I have three issues to ask you:
* Which branch does the quadrature exist in? develop or other branch?
Currently branch "pr66", I'm hoping to get the double-exponential in develop in the next week or so.
* Can I build boost library just only with math module? I guess, I should checkout all of boost modules in order to success in building boost library.
There's nothing to build to use the math lib - just place the headers in libs/math/include in your include path *before* the rest of boost.
JMvB> If you wanted to try out the double-exponential code now, it's here: JMvB> https://github.com/boostorg/math/pull/72, I've currently broken the tests (!), JMvB> but the headers are all ready to go, and if you'd like to give the new code a JMvB> test drive and report back that would be great. As with most quadrature routines, JMvB> it's fairly easy to break if you're cunning enough (which is why the tests are JMvB> currently broken!), but it does handle endpoint singularities very well, and is a JMvB> lot more robust and efficient than I expected. I've put a PDF build of the docs JMvB> from that branch here: https://www.dropbox.com/s/9uwe1tujc0p12b5/math.pdf?dl=0you JMvB> will need to navigate to the tools->quadrature section (page 745). * Can you tell how to build Boost.math documentation? I found it is diffcult to build Boost documentations by boostbook. Is there any guideline to do this?
If you just want to read the docs, then I'd suggest you stick to the PDF I posted to: https://www.dropbox.com/s/9uwe1tujc0p12b5/math.pdf?dl=0 However, the quadrature docs haven't been proof-read yet, so patches are welcome ;) To build the Math lib docs you will need to: * Copy tools/build/example/user-config.jam to your home directory. * Install xsltproc, the docbook xsl stylesheets (https://sourceforge.net/projects/docbook/files/docbook-xsl/), and the docbook 4.2 DTD (http://docbook.org/xml/4.2/). * In user-config.jam add to the end: using xsltproc ; using boostbook : path-to-xsl-stylesheets : path-to-xml-dtd-4.2 ; using quickbook ; Then cd into libs/math/doc and: ../../../b2 release which will build the html docs. Additional Boost tools (quickbook and auto_index) will get built on demand. There's more information at https://svn.boost.org/trac10/wiki/BoostDocs/GettingStarted but it's more complex than it needs to be as it covers what you need to do *everything* with *any* library. HTH, John. --- This email has been checked for viruses by AVG. http://www.avg.com
participants (3)
-
Easior Lars
-
John Maddock
-
Máté Ferenc Nagy-Egri