Trap Class Template Reference

Class template calculates definite integrals for user-supplied functions using the first-order trapezoid rule. More...

#include <Intg.h>

Inherits Intg< xType, yType >.

Inheritance diagram for Trap:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Trap (const Intg< xType, yType > &ig)
 Trap (const Trap &tr)
 Trap (yType(&rFn)(xType), xType dEps)
 ~Trap (void)

Detailed Description

template<typename xType, typename yType>
class calc::Trap< xType, yType >

Class template calculates definite integrals for user-supplied functions using the first-order trapezoid rule.

Successively smaller step-sizes are used within the integration interval, until an approximated error is acheived. The trapezoid rule curve-fits derivative evaluations with linear piece-wise equations (1st order polynomials), and integrates under the curve-fit.

The declaration typename <xType> specifies the form of independent variables used in integral calculations. The declaration typename <yType> specifies the form of solution variables used in integral calculations. In general, the <yType> variables should be the equal or superset of the <xType> variables.

Author
efgeorge
Date
2006/07/19 13:21:43
Revision
1.3
Examples:

example_Intg.txt.


Constructor & Destructor Documentation

Trap ( yType(&)(xType)  rFn,
xType  dEps 
)

Constructor initializes a function integration object.

Parameters:
rFn a reference to an integrand evaluation function
dEps required error of the calculated integral (|y| units)
Remarks:
  • The specified integration tolerance dEps must be greater than zero.
  • The specified function rFn(x) calculates an integrand value given an independent variable value.
  • The function rFn(x) accepts a single independent value (x units).
  • The function rFn(x) returns a single valued integrand value (y units) at the specified point x.
  • Function declaration: yType fn(xType x);

Trap ( const Trap< xType, yType > &  tr  ) 

Copy constructor initializes a function integration object from the specified existing integration object.

Parameters:
tr a reference to a function integration object

Trap ( const Intg< xType, yType > &  ig  ) 

Copy constructor initializes a function integration object from the specified existing integration object.

Parameters:
ig a reference to a function integration object

~Trap ( void   ) 

Destructor is a place holder, no dynamic memory is allocated.


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 09:24:24 2006 for CalcLib by  doxygen 1.4.7