https://github.com/larzw/gausslegendrerule
Gauss-Legendre Quadrature
https://github.com/larzw/gausslegendrerule
gauss-legendre integration quadrature
Last synced: about 1 month ago
JSON representation
Gauss-Legendre Quadrature
- Host: GitHub
- URL: https://github.com/larzw/gausslegendrerule
- Owner: larzw
- License: other
- Created: 2016-03-10T04:12:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-16T02:33:06.000Z (about 9 years ago)
- Last Synced: 2025-02-06T08:21:30.504Z (3 months ago)
- Topics: gauss-legendre, integration, quadrature
- Language: C++
- Homepage:
- Size: 157 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
[](https://travis-ci.org/larzw/GaussLegendreRule) **Travis CI: Linux (gcc) and OS X (clang)**
[](https://ci.appveyor.com/project/larzw/gausslegendrerule/branch/master) **AppVeyor: Windows (VS2015)**
## Dependencies
* [Boost](http://www.boost.org/doc/libs/1_42_0/libs/test/doc/html/index.html) is used for the unit tests.
* [CMake](https://cmake.org/) is used for the builds.
* [Doxygen](http://www.stack.nl/~dimitri/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
[](https://www.gnu.org/copyleft/gpl.html)This code is a modified version of the GNU Scientific Library function [glfixed](http://www.gnu.org/software/gsl/manual/html_node/Fixed-order-Gauss_002dLegendre-integration.html#Fixed-order-Gauss_002dLegendre-integration). The original project can be found at [Pavel Holoborodko](http://www.holoborodko.com/pavel/numerical-methods/numerical-integration/).