Is there a C++ implementation for numerical quadrature/cubature?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a C++ implementation for numerical quadrature/cubature?

Boost - Users mailing list
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
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a C++ implementation for numericalquadrature/cubature?

Boost - Users mailing list

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ó: [hidden email]
Elküldve: 2017. augusztus 19., szombat 6:10
Címzett: [hidden email]
Másolatot kap: [hidden email]
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

[hidden email]

https://lists.boost.org/mailman/listinfo.cgi/boost-users

 


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a C++ implementation for numerical quadrature/cubature?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list


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

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a C++ implementation for numericalquadrature/cubature?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list


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

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a C++ implementation for numerical quadrature/cubature?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
>>>>> "JMvB" == John Maddock via Boost-users <[hidden email]> 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
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Is there a C++ implementation for numerical quadrature/cubature?

Boost - Users mailing list


On 20/08/2017 03:09, Easior Lars via Boost-users wrote:

>>>>>> "JMvB" == John Maddock via Boost-users <[hidden email]> 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

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users