Class for numerical integration methods. More...
Public Member Functions | |
| Integration () | |
| Default constructor. | |
| Integration (real_t low, real_t high, function< real_t(real_t)> const &f, IntegrationScheme s, real_t error) | |
| Constructor. More... | |
| ~Integration () | |
| Destructor. | |
| void | setFunction (function< real_t(real_t)> const &f) |
| Define function to integrate numerically. More... | |
| void | setScheme (IntegrationScheme s) |
| Set time inegration scheme. More... | |
| void | setTriangle (real_t x1, real_t y1, real_t x2, real_t y2, real_t x3, real_t y3) |
| Define integration domain as a quadrilateral. More... | |
| void | setQuadrilateral (real_t x1, real_t y1, real_t x2, real_t y2, real_t x3, real_t y3, real_t x4, real_t y4) |
| Define integration domain as a quadrilateral. More... | |
| real_t | run () |
| Run numerical integration. More... | |
Detailed Description
Class for numerical integration methods.
Class NumInt defines and stores numerical integration data
- Author
- Rachid Touzani
- Copyright
- GNU Lesser Public License
Constructor & Destructor Documentation
| Integration | ( | real_t | low, |
| real_t | high, | ||
| function< real_t(real_t)> const & | f, | ||
| IntegrationScheme | s, | ||
| real_t | error | ||
| ) |
Constructor.
- Parameters
-
[in] low Lower value of integration interval [in] high Upper value of integration interval [in] f Function to integrate [in] s Integration scheme. To choose among enumerated values: -
LEFT_RECTANGLE: -
RIGHT_RECTANGLE: -
MID_RECTANGLE: -
TRAPEZOIDAL: -
SIMPSON: -
GAUSS_LEGENDRE:
[in] error -
Member Function Documentation
Define function to integrate numerically.
- Parameters
-
[in] f Function to integrate
| void setScheme | ( | IntegrationScheme | s | ) |
Set time inegration scheme.
- Parameters
-
[in] s Scheme to choose among enumerated values: -
LEFT_RECTANGLE: -
RIGHT_RECTANGLE: -
MID_RECTANGLE: -
TRAPEZOIDAL: -
SIMPSON: -
GAUSS_LEGENDRE:
-
Define integration domain as a quadrilateral.
- Parameters
-
[in] x1 x-coordinate of first vertex of triangle [in] y1 y-coordinate of first vertex of triangle [in] x2 x-coordinate of second vertex of triangle [in] y2 y-coordinate of second vertex of triangle [in] x3 x-coordinate of third vertex of triangle [in] y3 y-coordinate of third vertex of triangle
| void setQuadrilateral | ( | real_t | x1, |
| real_t | y1, | ||
| real_t | x2, | ||
| real_t | y2, | ||
| real_t | x3, | ||
| real_t | y3, | ||
| real_t | x4, | ||
| real_t | y4 | ||
| ) |
Define integration domain as a quadrilateral.
- Parameters
-
[in] x1 x-coordinate of first vertex of quadrilateral [in] y1 y-coordinate of first vertex of quadrilateral [in] x2 x-coordinate of second vertex of quadrilateral [in] y2 y-coordinate of second vertex of quadrilateral [in] x3 x-coordinate of third vertex of quadrilateral [in] y3 y-coordinate of third vertex of quadrilateral [in] x4 x-coordinate of fourth vertex of quadrilateral [in] y4 y-coordinate of fourth vertex of quadrilateral
| real_t run | ( | ) |
Run numerical integration.
- Returns
- Computed approximate value of integral