IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Num::RealFunction Class Reference

Represents a real function of a real variabe. More...

Inheritance diagram for IG::Num::RealFunction:
Collaboration diagram for IG::Num::RealFunction:

List of all members.

Public Member Functions

 RealFunction (DlgFunctionValue valueDelegate)
 Constructs a new function where delegates are provided for calculation of function valu.
 RealFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate)
 Constructs a new function where delegates are provided for calculation of function valu and first derivative.
 RealFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate, DlgFunctionValue secondDerivativeDelegate)
 RealFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate, DlgFunctionValue secondDerivativeDelegate, DlgFunctionValue integralDelegate)
 Constructs a new function where delegates are provided for calculation of function value, derivatives and integral.
 RealFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate, DlgFunctionValue secondDerivativeDelegate, DlgFunctionValue integralDelegate, DlgFunctionValue inverseDelegate)
 Constructs a new function where delegates are provided for calculation of function value, derivatives, integral and inverse.
 RealFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate, DlgFunctionValue secondDerivativeDelegate, DlgFunctionHigherDerivative higherDerivativeDelegate, DlgFunctionValue integralDelegate, DlgFunctionValue inverseDelegate)
 Constructs a new function where delegates are provided for calculation of function value, derivatives, integral and inverse.
RealFunction CloneFunction ()
object Clone ()
double TransformedArgument (double t)
double InverseTransformedArgument (double x)
virtual void SetTransformationParameters (double kx, double sx, double ky, double sy)
 Sets parameters of the affine transformation parameters for both co-ordinates.
virtual void SetXTransformationParameters (double kx, double sx)
 Sets parameters of the affine transformation parameters for independent variable.
override double Value (double x)
 Returns the value of this function at the specified parameter.
override double Derivative (double x)
 Returns the first derivative of this function at the specified parameter.
override double Derivative (double x, int order)
 Returns the derivative of the given order of this function at the specified parameter.
override bool HigherDerivativeDefined (int order)
 Tells whether the derivative of the given order is defined for this function (by implementation, not mathematically). Returns true if either the internal variable indicates true or the appropriate delegate is non-null.
override double SecondDerivative (double x)
 Returns the second derivative of the given order of this function at the specified arameter.
override double Integral (double x)
 Returns definite integral of the current function from 0 to the function argument.
override double Inverse (double y)
 Returns value of the inverse of the current function at the specified value of dependent variable.

Static Public Member Functions

static void TestSpeed ()
 Compares calculation times of three ways of evaluations of exponential function: directly by Math.Exp(), through a delegate initialized by this function, and through a Function object initialized by this function. The number of repetitions is pre-defined.
static void TestSpeed (long numiterations)
 Compares calculation times of three ways of evaluations of exponential function: directly by Math.Exp(), through a delegate initialized by this function, and through a Function object initialized by this function.

Protected Member Functions

 RealFunction ()
virtual double RefValue (double x)
 Returns the value of reference (untransformed) function.
virtual double RefDerivative (double x)
 Returns the first derivative of reference (untransformed) function.
virtual double RefDerivative (double x, int order)
 Returns the derivative of the given order of reference (untransformed) function.
virtual double RefSecondDerivative (double x)
 Returns the second derivative of the given order of reference (untransformed) function.
virtual double RefIntegral (double x)
 Returns definite integral of reference (untransformed) function from 0 to the function argument.
virtual double RefInverse (double y)
 Returns inverse of the reference (untransformed) function.
virtual internal void setHighestDerivativeDefined (int order)
 Sets the internal variable that specifies which is the highest order derivative devined (-1 for unlimited).

Protected Attributes

internal DlgFunctionTransformation DerivativeFunctionDlg = null
internal DlgFunctionValue ValueDlg = null
 Returns function value.
internal DlgFunctionValue DerivativeDlg = null
 Returns function derivative.
internal DlgFunctionValue SecondDerivativeDlg = null
 Returns function derivative.
internal
DlgFunctionHigherDerivative 
HigherDerivativeDlg = null
 Returns function arbitrary order derivative.
internal DlgFunctionValue IntegralDlg = null
 Returns function definite integral from 0 to function argument.
internal DlgFunctionValue InverseDlg = null
 Returns function definite integral from 0 to function argument.
bool _valueDefined = false
bool _derivativeDefined = false
int _highestDerivativeDefined = 0
bool _secondDerivativeDefined = false
bool _integralDefined = false
bool _inverseDefined = false

Properties

override string Name [get, set]
 Returns a code name of the function (not necessarily unique).
override string Description [get, set]
 Returns a short description of the function (not necessarily unique).
override RealFunctionBase DerivativeFunction [get]
 Returns a function that represents a derivative of the current function.
override RealFunctionBase InverseFunction [get]
 Returns a function that represents inverse of the current function.
override RealFunctionBase IntegralFunction [get]
 Returns a function that represents definite integral of the current function from 0 to function argument.
bool DoTransform [get, set]
 Whether or not transformation (stretch/shift) is applied to the reference function, either in x or to y. Setter sets value both for transformation in X and Y direction.
bool TransformX [get, set]
 Whether or not reference function is stretched/shifted in x direction.
bool TransformY [get, set]
 Whether or not reference function is stretched/shifted in x direction.
double ScaleX [get, set]
 Gets or sets the scaling factor for independent variable.
double ShiftX [get, set]
 Gets or sets the shift of independent variable.
double ScaleY [get, set]
 Gets or sets the scaling factor for function value.
double ShiftY [get, set]
 Gets or sets the shift for function value.
override bool ValueDefined [get, set]
 Tells whether value of the function is defined by implementation. Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool DerivativeDefined [get, set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool SecondDerivativeDefined [get, set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool IntegralDefined [get, set]
 Indicates whether integral is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).
override bool InverseDefined [get, set]
 Indicates whether inverse is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Private Member Functions

void UpdateInternalData ()
 Updates internal data dependencies. This function must be called whenever data on which other data is dependent changes.

Private Attributes

string _name
string _description
RealFunction funcDerivative = null
RealFunction funcIntegral = null
RealFunction funcInverse = null
internal DlgFunctionTransformation InverseFunctionDlg = null
internal DlgFunctionTransformation IntegralFunctionDlg = null
bool _transfX = false
bool _transfY = false
double _scaleX = 1.0
double _shiftX = 0.0
double _scaleY = 1.0
double _shiftY = 0.0

Detailed Description

Represents a real function of a real variabe.

$A Igor xx;


Constructor & Destructor Documentation

IG::Num::RealFunction::RealFunction ( ) [inline, protected]
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate) [inline]

Constructs a new function where delegates are provided for calculation of function valu.

Parameters:
valueDelegateDelegate that calculates funciton value. If null then the function does not have value defined.
derivativeDelegateDelegate that calculates function derivative. If null then the function does not have derivative defined.
secondDerivativeDelegateDelegate that calculates function second derivative. If null then the function does not have second derivative defined.
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate,
DlgFunctionValue  derivativeDelegate 
) [inline]

Constructs a new function where delegates are provided for calculation of function valu and first derivative.

Parameters:
valueDelegateDelegate that calculates funciton value. If null then the function does not have value defined.
derivativeDelegateDelegate that calculates function derivative. If null then the function does not have derivative defined.
secondDerivativeDelegateDelegate that calculates function second derivative. If null then the function does not have second derivative defined.
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate,
DlgFunctionValue  derivativeDelegate,
DlgFunctionValue  secondDerivativeDelegate 
) [inline]
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate,
DlgFunctionValue  derivativeDelegate,
DlgFunctionValue  secondDerivativeDelegate,
DlgFunctionValue  integralDelegate 
) [inline]

Constructs a new function where delegates are provided for calculation of function value, derivatives and integral.

Parameters:
valueDelegateDelegate that calculates funciton value. If null then the function does not have value defined.
derivativeDelegateDelegate that calculates function derivative. If null then the function does not have derivative defined.
secondDerivativeDelegateDelegate that calculates function second derivative. If null then the function does not have second derivative defined.
integralDelegateDelegate that calculates funciton integral. If null then the function does not have integral defined.
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate,
DlgFunctionValue  derivativeDelegate,
DlgFunctionValue  secondDerivativeDelegate,
DlgFunctionValue  integralDelegate,
DlgFunctionValue  inverseDelegate 
) [inline]

Constructs a new function where delegates are provided for calculation of function value, derivatives, integral and inverse.

Parameters:
valueDelegateDelegate that calculates funciton value. If null then the function does not have value defined.
derivativeDelegateDelegate that calculates function derivative. If null then the function does not have derivative defined.
secondDerivativeDelegateDelegate that calculates function second derivative. If null then the function does not have second derivative defined.
integralDelegateDelegate that calculates funciton integral. If null then the function does not have integral defined.
inverseDelegateDelegate that calculates funciton inverse. If null then the function does not have inverse defined.
IG::Num::RealFunction::RealFunction ( DlgFunctionValue  valueDelegate,
DlgFunctionValue  derivativeDelegate,
DlgFunctionValue  secondDerivativeDelegate,
DlgFunctionHigherDerivative  higherDerivativeDelegate,
DlgFunctionValue  integralDelegate,
DlgFunctionValue  inverseDelegate 
) [inline]

Constructs a new function where delegates are provided for calculation of function value, derivatives, integral and inverse.

Parameters:
valueDelegateDelegate that calculates funciton value. If null then the function does not have value defined.
derivativeDelegateDelegate that calculates function derivative. If null then the function does not have derivative defined.
secondDerivativeDelegateDelegate that calculates function second derivative. If null then the function does not have second derivative defined.
higherDerivativeDelegateDelegate that calculates function higher derivatives. If null then the function does not have higher derivatives defined.
integralDelegateDelegate that calculates funciton integral. If null then the function does not have integral defined.
inverseDelegateDelegate that calculates funciton inverse. If null then the function does not have inverse defined.

Member Function Documentation

RealFunction IG::Num::RealFunction::CloneFunction ( ) [inline]
object IG::Num::RealFunction::Clone ( ) [inline]
void IG::Num::RealFunction::UpdateInternalData ( ) [inline, private]

Updates internal data dependencies. This function must be called whenever data on which other data is dependent changes.

double IG::Num::RealFunction::TransformedArgument ( double  t) [inline]
double IG::Num::RealFunction::InverseTransformedArgument ( double  x) [inline]
virtual void IG::Num::RealFunction::SetTransformationParameters ( double  kx,
double  sx,
double  ky,
double  sy 
) [inline, virtual]

Sets parameters of the affine transformation parameters for both co-ordinates.

Parameters:
kxScaling factor for independent variable.
sxShift for independent variable.
kyScaling factor for function value.
syShift for function value.
Returns:
virtual void IG::Num::RealFunction::SetXTransformationParameters ( double  kx,
double  sx 
) [inline, virtual]

Sets parameters of the affine transformation parameters for independent variable.

Parameters:
kxScaling factor for independent variable.
sxShift for independent variable.
virtual double IG::Num::RealFunction::RefDerivative ( double  x,
int  order 
) [inline, protected, virtual]
virtual double IG::Num::RealFunction::RefIntegral ( double  x) [inline, protected, virtual]
override double IG::Num::RealFunction::Value ( double  x) [inline]
override double IG::Num::RealFunction::Derivative ( double  x) [inline]

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

Implements IG::Num::IRealFunction.

override double IG::Num::RealFunction::Derivative ( double  x,
int  order 
) [inline]

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

Implements IG::Num::IRealFunction.

Reimplemented in IG::Num::Func::Identity, and IG::Num::Func::Constant.

override bool IG::Num::RealFunction::HigherDerivativeDefined ( int  order) [inline]
virtual internal void IG::Num::RealFunction::setHighestDerivativeDefined ( int  order) [inline, protected, virtual]

Sets the internal variable that specifies which is the highest order derivative devined (-1 for unlimited).

Parameters:
orderHighest order for which derivative is defined. -1 means that all derivatives are defined.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.

override double IG::Num::RealFunction::SecondDerivative ( double  x) [inline]

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

Implements IG::Num::IRealFunction.

override double IG::Num::RealFunction::Integral ( double  x) [inline]

Returns definite integral of the current function from 0 to the function argument.

Implements IG::Num::IRealFunction.

override double IG::Num::RealFunction::Inverse ( double  y) [inline]

Returns value of the inverse of the current function at the specified value of dependent variable.

Implements IG::Num::IRealFunction.

static void IG::Num::RealFunction::TestSpeed ( ) [inline, static]

Compares calculation times of three ways of evaluations of exponential function: directly by Math.Exp(), through a delegate initialized by this function, and through a Function object initialized by this function. The number of repetitions is pre-defined.

static void IG::Num::RealFunction::TestSpeed ( long  numiterations) [inline, static]

Compares calculation times of three ways of evaluations of exponential function: directly by Math.Exp(), through a delegate initialized by this function, and through a Function object initialized by this function.

Parameters:
numiterationsNumber of repeated evaluations of function.

Member Data Documentation

string IG::Num::RealFunction::_name [private]

Reimplemented from IG::Num::RealFunctionBase.

Reimplemented from IG::Num::RealFunctionBase.

internal DlgFunctionTransformation IG::Num::RealFunction::DerivativeFunctionDlg = null [protected]
internal DlgFunctionTransformation IG::Num::RealFunction::InverseFunctionDlg = null [private]
internal DlgFunctionTransformation IG::Num::RealFunction::IntegralFunctionDlg = null [private]
internal DlgFunctionValue IG::Num::RealFunction::ValueDlg = null [protected]

Returns function value.

internal DlgFunctionValue IG::Num::RealFunction::DerivativeDlg = null [protected]

Returns function derivative.

internal DlgFunctionValue IG::Num::RealFunction::SecondDerivativeDlg = null [protected]

Returns function derivative.

internal DlgFunctionHigherDerivative IG::Num::RealFunction::HigherDerivativeDlg = null [protected]

Returns function arbitrary order derivative.

internal DlgFunctionValue IG::Num::RealFunction::IntegralDlg = null [protected]

Returns function definite integral from 0 to function argument.

internal DlgFunctionValue IG::Num::RealFunction::InverseDlg = null [protected]

Returns function definite integral from 0 to function argument.

bool IG::Num::RealFunction::_transfX = false [private]
bool IG::Num::RealFunction::_transfY = false [private]
double IG::Num::RealFunction::_scaleX = 1.0 [private]
double IG::Num::RealFunction::_shiftX = 0.0 [private]
double IG::Num::RealFunction::_scaleY = 1.0 [private]
double IG::Num::RealFunction::_shiftY = 0.0 [private]
bool IG::Num::RealFunction::_valueDefined = false [protected]
bool IG::Num::RealFunction::_integralDefined = false [protected]
bool IG::Num::RealFunction::_inverseDefined = false [protected]

Property Documentation

override string IG::Num::RealFunction::Name [get, set]

Returns a code name of the function (not necessarily unique).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase.

override string IG::Num::RealFunction::Description [get, set]

Returns a short description of the function (not necessarily unique).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase.

override RealFunctionBase IG::Num::RealFunction::DerivativeFunction [get]

Returns a function that represents a derivative of the current function.

Reimplemented from IG::Num::RealFunctionBase.

override RealFunctionBase IG::Num::RealFunction::InverseFunction [get]

Returns a function that represents inverse of the current function.

Reimplemented from IG::Num::RealFunctionBase.

override RealFunctionBase IG::Num::RealFunction::IntegralFunction [get]

Returns a function that represents definite integral of the current function from 0 to function argument.

Reimplemented from IG::Num::RealFunctionBase.

bool IG::Num::RealFunction::DoTransform [get, set, protected]

Whether or not transformation (stretch/shift) is applied to the reference function, either in x or to y. Setter sets value both for transformation in X and Y direction.

bool IG::Num::RealFunction::TransformX [get, set, protected]

Whether or not reference function is stretched/shifted in x direction.

bool IG::Num::RealFunction::TransformY [get, set, protected]

Whether or not reference function is stretched/shifted in x direction.

double IG::Num::RealFunction::ScaleX [get, set]

Gets or sets the scaling factor for independent variable.

double IG::Num::RealFunction::ShiftX [get, set]

Gets or sets the shift of independent variable.

double IG::Num::RealFunction::ScaleY [get, set]

Gets or sets the scaling factor for function value.

double IG::Num::RealFunction::ShiftY [get, set]

Gets or sets the shift for function value.

override bool IG::Num::RealFunction::ValueDefined [get, set]

Tells whether value of the function is defined by implementation. Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::FunctionPolynomial, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.

override bool IG::Num::RealFunction::DerivativeDefined [get, set]

Tells whether the first derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::FunctionPolynomial, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.

override bool IG::Num::RealFunction::SecondDerivativeDefined [get, set]

Tells whether the second derivative is defined for this function (by implementation, not mathematically). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::FunctionPolynomial, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.

override bool IG::Num::RealFunction::IntegralDefined [get, set]

Indicates whether integral is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::FunctionPolynomial, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.

override bool IG::Num::RealFunction::InverseDefined [get, set]

Indicates whether inverse is defined for this function (w.r. implementation). Getter returns true if internal flag is set OR appropriate delegate is defined. Setter sets the internal flag (i.e. delegate must also be set to null if getter should return false).

Implements IG::Num::IRealFunction.

Reimplemented in IG::Lib::LoadableRealFunctionBase, IG::Num::FunctionPolynomial, IG::Num::Func::Exp, IG::Num::Func::ReciprocalPower, IG::Num::Func::Identity, IG::Num::Func::Constant, IG::Num::Func::Linear, IG::Num::Func::Quadratic, IG::Num::Func::Cubic, IG::Num::Func::PenaltyPower, IG::Num::Func::WeightGauss, IG::Num::Func::WeightReciprocalPower, IG::Num::Func::WeightPol3, IG::Num::Func::WeightPol4, IG::Num::Func::WeightPol5, and IG::Num::Func::WeightPol7.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events