#include <Intg.h>
Inherits Base.
Inherited by Romb, Simp, and Trap.
Inheritance diagram for Intg:

Public Types | |
| enum | CTYPE { TRAPEZOID = 0, SIMPSON, ROMBERG, CTYPE_CNT } |
| CTYPE_CNT | |
| LOOP_CURRENT = 0 | |
| LOOP_MAXIMUM | |
| ROMBERG | |
| SIMPSON | |
| TRAPEZOID = 0 | |
| enum | VTYPE { LOOP_CURRENT = 0, LOOP_MAXIMUM, VTYPE_CNT } |
| VTYPE_CNT | |
Public Member Functions | |
| yType | eval (xType x1, xType x2) throw (IntgErr) |
| yType | evalIntegrand (xType x) const |
| int | getCount (enum Intg< xType, yType >::VTYPE vType) const |
| xType | getError (void) const |
| enum Intg< xType, yType >::CTYPE | getMethod (void) const |
| virtual bool | setCount (int nMaximum) |
| bool | setEpsilon (xType dEps) |
Static Public Attributes | |
| static const int | DEF_LOOP_MAX = 20 |
Protected Member Functions | |
| Intg (const Intg &ig) | |
| Intg (yType(&rFn)(xType), xType dEps) | |
| virtual yType | intgMethod (void)=0 throw (IntgErr) |
| yType | refine (int ninc) |
| ~Intg (void) | |
Protected Attributes | |
| enum Intg< xType, yType >::CTYPE | cTyp |
| xType | eps |
| int | nCount [VTYPE_CNT] |
Object instantiation of this class should be made only through classes which inherit this class.
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.
See the cited References to obtain more information on the mathematical theory applied here.
| enum CTYPE |
Enumeration indicates the class index of the integration method used.
| TRAPEZOID | index of a calc::Trap object using the trapezoid rule |
| SIMPSON | index of a calc::Simp object using Simpson's rule |
| ROMBERG | index of a calc::Romb object using Romberg's method |
| CTYPE_CNT | class type index count |
| enum VTYPE |
| Intg | ( | yType(&)(xType) | rFn, | |
| xType | dEps | |||
| ) | [protected] |
Constructor initializes a function integration object.
| rFn | a reference to an integrand evaluation function | |
| dEps | required error of the calculated integral (|y| units) |
yType fn(xType x); Copy constructor initializes a function integration object from the specified existing integration object.
| ig | a reference to a function integration object |
| ~Intg | ( | void | ) | [protected] |
Destructor is a place holder, no dynamic memory is allocated.
| yType eval | ( | xType | x1, | |
| xType | x2 | |||
| ) | throw (IntgErr) |
Function integrates the specified integrand function with the current integration method using decreasing step size until the specified error limit is achieved.
| x1 | integral lower bound (x units) | |
| x2 | integral upper bound (x units) |
| IntgErr | type of object thrown
|
| yType evalIntegrand | ( | xType | x | ) | const |
Function evaluates the user specified integrand function at the specified value x.
| x | value at which to evaluate the integrand function (x units) |
Function returns loop information pertaining to algorithm iterations.
| vType | variable index indentifying the type of data |
| xType getError | ( | void | ) | const |
Function returns the current error criterion used in integration evaluation.
Function returns an enumeration index indicating the calculation method used in the integration evaluation.
| virtual yType intgMethod | ( | void | ) | throw (IntgErr) [protected, pure virtual] |
Virtual function integrates the specified user function with a specific method.
| IntgErr | type of object thrown
|
| yType refine | ( | int | ninc | ) | [protected] |
Function improves integration by adding 2^(ninc-1) integration evaluation steps using the trapezoid rule.
| ninc | integration refinement index |
| bool setCount | ( | int | nMaximum | ) | [virtual] |
Virtual function sets the current maximum loop count used in the integration evaluation.
| nMaximum | the maximum loop count value |
Reimplemented in Romb.
| bool setEpsilon | ( | xType | dEps | ) |
Function sets the current error criterion used in integration evaluation.
| dEps | error tolerance of the integration value (|y| units) |
const int DEF_LOOP_MAX = 20 [static] |
default maximum iteration loop count
xType eps [protected] |
required error of integral (|y| units)
int nCount[VTYPE_CNT] [protected] |
variable values of integration
1.4.7