(9)

Integration Class Reference

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

Constructor & Destructor Documentation

◆ Integration()

Integration ( real_t  low,
real_t  high,
function< real_t(real_t)> const &  f,
IntegrationScheme  s,
real_t  error 
)

Constructor.

Parameters
[in]lowLower value of integration interval
[in]highUpper value of integration interval
[in]fFunction to integrate
[in]sIntegration scheme. To choose among enumerated values:
  • LEFT_RECTANGLE:
  • RIGHT_RECTANGLE:
  • MID_RECTANGLE:
  • TRAPEZOIDAL:
  • SIMPSON:
  • GAUSS_LEGENDRE:
[in]error

Member Function Documentation

◆ run()

real_t run ( )

Run numerical integration.

Returns
Computed approximate value of integral

◆ setFunction()

void setFunction ( function< real_t(real_t)> const &  f)

Define function to integrate numerically.

Parameters
[in]fFunction to integrate

◆ setQuadrilateral()

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]x1x-coordinate of first vertex of quadrilateral
[in]y1y-coordinate of first vertex of quadrilateral
[in]x2x-coordinate of second vertex of quadrilateral
[in]y2y-coordinate of second vertex of quadrilateral
[in]x3x-coordinate of third vertex of quadrilateral
[in]y3y-coordinate of third vertex of quadrilateral
[in]x4x-coordinate of fourth vertex of quadrilateral
[in]y4y-coordinate of fourth vertex of quadrilateral

◆ setScheme()

void setScheme ( IntegrationScheme  s)

Set time inegration scheme.

Parameters
[in]sScheme to choose among enumerated values:
  • LEFT_RECTANGLE:
  • RIGHT_RECTANGLE:
  • MID_RECTANGLE:
  • TRAPEZOIDAL:
  • SIMPSON:
  • GAUSS_LEGENDRE:

◆ setTriangle()

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.

Parameters
[in]x1x-coordinate of first vertex of triangle
[in]y1y-coordinate of first vertex of triangle
[in]x2x-coordinate of second vertex of triangle
[in]y2y-coordinate of second vertex of triangle
[in]x3x-coordinate of third vertex of triangle
[in]y3y-coordinate of third vertex of triangle