4

Is there a science/math related C/C++ programming library that includes functions for mathematical integration? This might be useful for finding values for a cumulative distribution function, etc. Symbolic manipulation ideal but not required. Thanks!

P.S. I've looked at GSL but it does not contain functions specific for integration.

hpy
  • 1,989
  • 7
  • 26
  • 56

6 Answers6

6

But GSL does have numerical integration capabilities ...is there some other reason this library doesn't meet your needs?

For symbolic math, Mathematica is a popular choice. They support a C API .

Jim Lewis
  • 43,505
  • 7
  • 82
  • 96
  • I'm using gls, but I need to integrate a function (also a non standard CDF) in a grid of points instead of single value (say, 0.1, 0.3, 0.5, 0.6). I'm wondering if there is library that implements this with an efficient algorithm. – eaponte May 07 '16 at 17:15
2

ROOT. This is a free open source software package for physicists, it inludes integration techniques of course, Math_GSLIntegrator.html">http://root.cern.ch/root/html/ROOT_Math_GSLIntegrator.html

Yaroslav Nikitenko
  • 1,695
  • 2
  • 23
  • 31
1

Regarding the numerical integration, you can also look at some commercial package, for exmaple, NAG

fairstar
  • 163
  • 2
1

Wikipedia has lists and comparisons of numerical analysis software (many of which will do numerical integration, and some of which are C/C++ libraries or have an appropriate API), and comparisons of computer algebra software.

Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
1

You can find cumulative distribution functions using integration, but there are direct methods that far more efficient and more accurate. For example, there is a library, DCDFLIB, for computing CDFs. It's available in C and Fortran here and in managed C++ here.

John D. Cook
  • 29,517
  • 10
  • 67
  • 94
1

As suggested by John, if you want the Cumulative Distribution Function of a standard function, using a specific solution would be a better approach. He pointed out DCDFLIB. GSL has a very large number of specific CDFs, hidden in Chapter 19, "Random Number Distributions".

To do numerically evaluate the CDF of a unusual function, there are several choices in GSL, e.g., gsl_integration_qag for an integral from a to b, or gsl_integration_qagiu, which does semi-infinite integrals from a to +infinity.

M. S. B.
  • 28,968
  • 2
  • 46
  • 73