Skip to content

larzw/GaussLegendreRule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gauss-Legendre Quadrature/Numerical Integration

A lightweight, simple, fast, and cross-platform double precision C++11 routine that computes the abscissas (nodes) and weights for an N-point Gauss-Legendre rule over an arbitrary interval (a,b). See the unit tests in the folder test/ for examples.

Latest Builds

Build Status Travis CI: Linux (gcc) and OS X (clang)

Build status AppVeyor: Windows (VS2015)

Dependencies

  • Boost is used for the unit tests.
  • CMake is used for the builds.
  • Doxygen is used to create documentation.

If your intentions are to simply use the code, the above dependencies don't apply. You only need GassLegendreRule.cpp and the corresponding header file.

Documentation

The API reference can be found in the folder doc/latex/refman.pdf

Algorithm

Newton's method is used to compute the abscissas, which are the roots of an Nth order Legendre polynomial. Although alternative methods exist, direct root finding is typically faster by a factor of 3 to 5 [Press et al., Numerical Recipes 3rd ed. (2007)]. For further efficiency, pre-computed abscissas/weights correct to 25 decimal places for the orders = 2-20,32,64,96,100,128,256,512,1024 are used, otherwise abscissas/weights are computed on the fly.

License

GPLv3

This code is a modified version of the GNU Scientific Library function glfixed. The original project can be found at Pavel Holoborodko.

Releases

No releases published

Packages

No packages published