IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.RealFunctionBase Class Referenceabstract

Base class for real functions of real variable. More...

+ Inheritance diagram for IG.Num.RealFunctionBase:
+ Collaboration diagram for IG.Num.RealFunctionBase:

Public Member Functions

abstract double Value (double x)
 Returns the value of this function at the specified parameter. More...
 
abstract double Derivative (double x)
 Returns the first derivative of this function at the specified parameter. More...
 
abstract double Derivative (double x, int order)
 Returns the derivative of the given order of this function at the specified parameter. More...
 
abstract bool HigherDerivativeDefined (int order)
 Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically) More...
 
abstract double SecondDerivative (double x)
 Returns the second derivative of the given order of this function at the specified arameter. More...
 
abstract double Integral (double x)
 Returns integral from 0 to x of the function. Throws an exception if the integral is not defined. More...
 
abstract double Inverse (double y)
 Returns Inverse of the current function applied to function argument. Throws an exception if the inverse function is not defined. More...
 
void Tabulate (double from, double to, int numPoints)
 Tabulates the current function and its first and second derivatives (when available) on the specified interval, in the specified number of points. More...
 
void Tabulate (double from, double to, int numPoints, bool printDerivatives)
 Tabulates the current function and its first and eventually second derivatives (when available) on the specified interval, in the specified number of points. More...
 
void Tabulate (double from, double to, int numPoints, bool printDerivatives, bool printSecondDerivatives)
 Tabulates the current function and eventually its first and second derivatives (when available) on the specified interval, in the specified number of points. More...
 
virtual double NumericalIntegral (double from, double to, int numintervals)
 Calculates numerical integral of this function. Simpson's formula is used. More...
 
virtual double NumericalDerivative (double x, double stepsize)
 Calculates numerical derivative of this function. Central difference formula is used. More...
 
virtual double NumericalSecondDerivative (double x, double stepsize)
 Calculates numerical second order derivative of this function. Central difference formula is used. More...
 
virtual void Test ()
 Performs numerical tests with parameters adjusted for specific function. This function can be be overridden in derived classes, however its current implementation may be relatively well suited for most weighting and basic functions. More...
 
virtual void Test (double from, double to, int numProbes, double stepSize, double tolerance)
 Performs some numerical tests on the current function, such as correctness of first and second derivatives, integral and inverse of the function. Results are written to the standard output. Whenever a numerical result does not match the corresponding analytical value calculated by the function, a visible notification is written. More...
 
override string ToString ()
 

Static Public Member Functions

static void ExampleTests ()
 

Protected Attributes

string _name
 
string _description
 

Properties

virtual string Name [get, set]
 Returns a short name of thecurrent function. More...
 
virtual string Description [get, set]
 Returns a short description of the current function. More...
 
virtual RealFunctionBase DerivativeFunction [get]
 Returns a function object that represents a derivative of this function. Returns null if this is not implemented. More...
 
virtual RealFunctionBase IntegralFunction [get]
 Returns a function object that represents a definite integral of this function from 0 to 1. Returns null if not implemented. More...
 
virtual RealFunctionBase InverseFunction [get]
 Returns a function object that represents an inverse function of this function. Returns null if not implemented. More...
 
abstract bool ValueDefined [get, set]
 Tells whether value of the function is defined by implementation. More...
 
abstract bool DerivativeDefined [get, set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically) More...
 
abstract bool SecondDerivativeDefined [get, set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically) More...
 
abstract bool IntegralDefined [get, set]
 Tells whether analytical itegral of the function is defined or not. More...
 
abstract bool InverseDefined [get, set]
 Tells whether analytical inverse function is defined or not. More...
 
- Properties inherited from IG.Num.IRealFunction
string Name [get]
 Returns a short name of the function. More...
 
string Description [get]
 Returns a short description of the function. More...
 
bool ValueDefined [get]
 Tells whether value of the function is defined by implementation. More...
 
bool DerivativeDefined [get]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically) More...
 
bool SecondDerivativeDefined [get]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically) More...
 
bool IntegralDefined [get]
 Tells whether analytical itegral of the function is defined or not. More...
 
bool InverseDefined [get]
 Tells whether analytical inverse function is defined or not. More...
 

Detailed Description

Base class for real functions of real variable.

A number of predefined functions can be bound in the class Func.

$A Igor xx;

Member Function Documentation

abstract double IG.Num.RealFunctionBase.Value ( double  x)
pure virtual
abstract double IG.Num.RealFunctionBase.Derivative ( double  x)
pure virtual

Returns the first derivative of this function at the specified parameter.

Implements IG.Num.IRealFunction.

Implemented in IG.Num.RealFunction.

abstract double IG.Num.RealFunctionBase.Derivative ( double  x,
int  order 
)
pure virtual

Returns the derivative of the given order of this function at the specified parameter.

Implements IG.Num.IRealFunction.

Implemented in IG.Num.RealFunction, IG.Num.Func.Constant, and IG.Num.Func.Identity.

abstract bool IG.Num.RealFunctionBase.HigherDerivativeDefined ( int  order)
pure virtual
abstract double IG.Num.RealFunctionBase.SecondDerivative ( double  x)
pure virtual

Returns the second derivative of the given order of this function at the specified arameter.

Implements IG.Num.IRealFunction.

Implemented in IG.Num.RealFunction.

abstract double IG.Num.RealFunctionBase.Integral ( double  x)
pure virtual

Returns integral from 0 to x of the function. Throws an exception if the integral is not defined.

Parameters
xUpper bound of the integral.

Implements IG.Num.IRealFunction.

Implemented in IG.Num.RealFunction.

abstract double IG.Num.RealFunctionBase.Inverse ( double  y)
pure virtual

Returns Inverse of the current function applied to function argument. Throws an exception if the inverse function is not defined.

Implements IG.Num.IRealFunction.

Implemented in IG.Num.RealFunction.

void IG.Num.RealFunctionBase.Tabulate ( double  from,
double  to,
int  numPoints 
)
inline

Tabulates the current function and its first and second derivatives (when available) on the specified interval, in the specified number of points.

Parameters
fromLeft interval bound.
toRight interval bound.
numPointsNumber of points in which the function is calculated.

Implements IG.Num.IRealFunction.

void IG.Num.RealFunctionBase.Tabulate ( double  from,
double  to,
int  numPoints,
bool  printDerivatives 
)
inline

Tabulates the current function and its first and eventually second derivatives (when available) on the specified interval, in the specified number of points.

Parameters
fromLeft interval bound.
toRight interval bound.
numPointsNumber of points in which the function is calculated.
printDerivativesWhether to print the derivatives.

Implements IG.Num.IRealFunction.

void IG.Num.RealFunctionBase.Tabulate ( double  from,
double  to,
int  numPoints,
bool  printDerivatives,
bool  printSecondDerivatives 
)
inline

Tabulates the current function and eventually its first and second derivatives (when available) on the specified interval, in the specified number of points.

Parameters
fromLeft interval bound.
toRight interval bound.
numPointsNumber of points in which the function is calculated.
printDerivativesWhether to print the derivatives.
printSecondDerivativesWhether to print the second derivatives.

Implements IG.Num.IRealFunction.

virtual double IG.Num.RealFunctionBase.NumericalIntegral ( double  from,
double  to,
int  numintervals 
)
inlinevirtual

Calculates numerical integral of this function. Simpson's formula is used.

Parameters
fromLower integral limit.
toUpper integral limit.
numintervalsNumber of subintervals (1 less thatn the number of evaluation points)
Returns
Numerical integral.

Implements IG.Num.IRealFunction.

References IG.Num.Numeric.IntegralSimpson().

virtual double IG.Num.RealFunctionBase.NumericalDerivative ( double  x,
double  stepsize 
)
inlinevirtual

Calculates numerical derivative of this function. Central difference formula is used.

Parameters
xPoint at which derivative is calculated.
stepsizeStep size.
Returns
Numerical derivative.

Implements IG.Num.IRealFunction.

References IG.Num.Numeric.DerivativeCD().

virtual double IG.Num.RealFunctionBase.NumericalSecondDerivative ( double  x,
double  stepsize 
)
inlinevirtual

Calculates numerical second order derivative of this function. Central difference formula is used.

Parameters
xPoint at which second order derivative is calculated.
stepsizeStep size.
Returns
Numerical derivative.

Implements IG.Num.IRealFunction.

References IG.Num.Numeric.SecondDerivativeCD().

virtual void IG.Num.RealFunctionBase.Test ( )
inlinevirtual

Performs numerical tests with parameters adjusted for specific function. This function can be be overridden in derived classes, however its current implementation may be relatively well suited for most weighting and basic functions.

Referenced by IG.Num.RealFunctionBase.ExampleTests().

virtual void IG.Num.RealFunctionBase.Test ( double  from,
double  to,
int  numProbes,
double  stepSize,
double  tolerance 
)
inlinevirtual

Performs some numerical tests on the current function, such as correctness of first and second derivatives, integral and inverse of the function. Results are written to the standard output. Whenever a numerical result does not match the corresponding analytical value calculated by the function, a visible notification is written.

Parameters
fromLower bound of the interval where tests are performed.
toUpper bound of the interval where tests are performed.
numProbesNumber of points for which evaluations and comparisons are performed.
stepSizeStep size used for numerical integration and differentiation.
toleranceAbsolute tolarence for match between analytical and numeriacl values (visible notification is launched whenever difference is larger than tolerance).
static void IG.Num.RealFunctionBase.ExampleTests ( )
inlinestatic
override string IG.Num.RealFunctionBase.ToString ( )
inline

Member Data Documentation

string IG.Num.RealFunctionBase._name
protected
string IG.Num.RealFunctionBase._description
protected

Property Documentation

virtual string IG.Num.RealFunctionBase.Name
getset

Returns a short name of thecurrent function.

virtual string IG.Num.RealFunctionBase.Description
getset

Returns a short description of the current function.

virtual RealFunctionBase IG.Num.RealFunctionBase.DerivativeFunction
get

Returns a function object that represents a derivative of this function. Returns null if this is not implemented.

virtual RealFunctionBase IG.Num.RealFunctionBase.IntegralFunction
get

Returns a function object that represents a definite integral of this function from 0 to 1. Returns null if not implemented.

virtual RealFunctionBase IG.Num.RealFunctionBase.InverseFunction
get

Returns a function object that represents an inverse function of this function. Returns null if not implemented.

abstract bool IG.Num.RealFunctionBase.ValueDefined
getset

Tells whether value of the function is defined by implementation.

abstract bool IG.Num.RealFunctionBase.DerivativeDefined
getset

Tells whether the first derivative is defined for this function (by implementation, not mathematically)

abstract bool IG.Num.RealFunctionBase.SecondDerivativeDefined
getset

Tells whether the second derivative is defined for this function (by implementation, not mathematically)

abstract bool IG.Num.RealFunctionBase.IntegralDefined
getset

Tells whether analytical itegral of the function is defined or not.

abstract bool IG.Num.RealFunctionBase.InverseDefined
getset

Tells whether analytical inverse function is defined or not.


The documentation for this class was generated from the following file: