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

Base class for defining Vector functions whose evaluation is defined in bulk, and evaluation of individual components can not be performed directly. For these functioons, individual values and individual gradient or vector components are evaluated in such a way thet the function is first evaluated as whole, storing its results to an object implementing IVectorFunctionResults. More...

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

Public Member Functions

abstract override void Evaluate (IVectorFunctionResults evaluationData)
 Performs evaluation of requwester function results and writes them to the provided data structure. More...
 
override double Value (IVectorFunctionResults evaluationData, int which)
 Calculates and returns the particular component of the vector function value. More...
 
override double Derivative (IVectorFunctionResults evaluationData, int which, int component)
 Calculates and returns the particular component of the vector function derivative. More...
 
override double SecondDerivative (IVectorFunctionResults evaluationData, int which, int rowNum, int columnNum)
 Calculates and returns the particular component of the vector function's second derivative (Hessian). More...
 
override void Evaluate (IVector parameters, ref bool calculateValues, ref List< double > values, ref bool calculateGradients, ref List< IVector > gradients, ref bool calculateHessians, ref List< IMatrix > hessians)
 Calculation of values, gradients, and hessians of the vector function according to request flags. Calculated by using Evaluate(IVectorFunctionResults) in this class. More...
 
- Public Member Functions inherited from IG.Num.VectorFunctionBaseGeneral
 VectorFunctionBaseGeneral ()
 
virtual double Value (IVector parameters, int which)
 Calculates and returns the particular component of the vector function value. More...
 
virtual double Derivative (IVector parameters, int which, int component)
 Calculates and returns the particular component of the vector function derivative. More...
 
virtual double SecondDerivative (IVector parameters, int which, int rowNum, int columnNum)
 Calculates and returns the particular component of the vector function's second derivative (Hessian). More...
 
void Value (IVector parameters, ref List< double > values)
 Returns the value of vector function at the specified parameter. More...
 
void Derivative (IVector parameters, ref List< IVector > gradients)
 Returns the first derivative of this function at the specified parameter. More...
 
void SecondDerivative (IVector parameters, ref List< IMatrix > hessians)
 Returns the second derivative (Hessian) of this function at the specified arameter. More...
 
double LinearCombinationValue (IVectorFunctionResults evaluationData, IVector coefficients)
 Returns value of linear combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
void LinearCombinationDerivative (IVectorFunctionResults evaluationData, IVector coefficients, ref IVector res)
 Returns gradient of linear combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
double LinearCombinationDerivative (IVectorFunctionResults evaluationData, IVector coefficients, int component)
 Returns the specified component of gradient of combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
void LinearCombinationSecondDerivative (IVectorFunctionResults evaluationData, IVector coefficients, ref IMatrix res)
 
double LinearCombinationSecondDerivative (IVectorFunctionResults evaluationData, IVector coefficients, int rowNum, int columnNum)
 Returns the specified component of Hessian of combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
double LinearCombinationValue (IVector parameters, IVector coefficients)
 Returns value of linear combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
void LinearCombinationDerivative (IVector parameters, IVector coefficients, ref IVector res)
 Returns gradient of linear combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
double LinearCombinationDerivative (IVector parameters, IVector coefficients, int component)
 Returns the specified component of gradient of combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
void LinearCombinationSecondDerivative (IVector parameters, IVector coefficients, ref IMatrix res)
 Calculates second derivatives of the linear combination of components of vector functions and stores them to the specified matrix. More...
 
double LinearCombinationSecondDerivative (IVector parameters, IVector coefficients, int rowNum, int columnNum)
 Returns the specified component of Hessian of combination of functions contained in this vector function, with specified coefficients at specified parameters. More...
 
virtual void NumericalDerivative (IVector x, IVector stepSizes, ref List< IVector > derivative)
 Calculates numerical derivative of this function. Central difference formula is used. More...
 
virtual void NumericalSecondDerivative (IVector x, IVector stepsizes, ref List< IVector > secondDerivatives)
 Calculates numerical second order derivative of this function. Central difference formula is used. More...
 

Properties

override bool ComponentWiseEvaluation [get, protected set]
 Returns true, indicating that individual components of functions and eventually their deirvatives is performed directly. More...
 
- Properties inherited from IG.Num.VectorFunctionBaseGeneral
object Lock [get]
 
virtual string Name [get, set]
 Returns a short name of the function. More...
 
virtual string Description [get, set]
 Returns a short description of the function. More...
 
virtual int NumParameters [get, protected set]
 Gets number of parameters of the current vector function (-1 for not defined, in case that function works with different numbers of parameters). More...
 
virtual int NumValues [get, protected set]
 Gets number of values of the current vector function (-1 for not defined, e.g. in case that function works with different numbers of parameters and number of functions depends on number of parameters). More...
 
virtual bool ComponentWiseEvaluation [get, protected set]
 Tells whether the function supports evaluation of individual components. If not then evaluation is performed through the Evaluate function. More...
 
virtual bool ValueDefined [get, protected set]
 Tells whether value of the function is defined by implementation. More...
 
virtual bool DerivativeDefined [get, protected set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically) More...
 
virtual bool SecondDerivativeDefined [get, protected set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically) More...
 
IVectorFunctionResults AuxResults [get]
 
- Properties inherited from IG.Num.IVectorFunction
string Name [get]
 Returns a short name of the function. More...
 
string Description [get]
 Returns a short description of the function. More...
 
int NumParameters [get]
 Gets number of parameters of the current vector function (-1 for not defined, in case that function works with different numbers of parameters). More...
 
int NumValues [get]
 Gets number of values of the current vector function (-1 for not defined, e.g. in case that function works with different numbers of parameters and number of functions depends on number of parameters). 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 ComponentWiseEvaluation [get]
 Tells whether the function supports evaluation of individual components. If not then evaluation is performed through the Evaluate function. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Additional Inherited Members

- Protected Attributes inherited from IG.Num.VectorFunctionBaseGeneral
object _lock = new object()
 
string _name
 
string _description
 
int _numParameters = -1
 
int _numValues = -1
 
bool _valuesDefined = true
 
bool _derivativeDefined = false
 
bool _secondDerivativeDefined = false
 
bool _componentEvaluation = false
 
VectorFunctionBase.ObjectStoreResults ResultsStore
 Store of result objects for reuse. More...
 

Detailed Description

Base class for defining Vector functions whose evaluation is defined in bulk, and evaluation of individual components can not be performed directly. For these functioons, individual values and individual gradient or vector components are evaluated in such a way thet the function is first evaluated as whole, storing its results to an object implementing IVectorFunctionResults.

$A Igor xx May10 Dec10; TODO: implement ICloneable

Member Function Documentation

abstract override void IG.Num.VectorFunctionBase.Evaluate ( IVectorFunctionResults  evaluationData)
pure virtual

Performs evaluation of requwester function results and writes them to the provided data structure.

Parameters
analysisDataData structure where request parameters are obtained and where results are written.

Implements IG.Num.VectorFunctionBaseGeneral.

Implemented in IG.Num.VectorFunctionExamples.RosenBrockAndCircle.

override double IG.Num.VectorFunctionBase.Value ( IVectorFunctionResults  evaluationData,
int  which 
)
inlinevirtual

Calculates and returns the particular component of the vector function value.

Parameters
evaluationDataEvaluation data that contains function parameters and can store function resuts. If the function does not support component-wise evaluation then results will be stored to this structure and returned from it. This makes reuse possible - when different components are evaluated subsequently with the same parameters, results are calculated only for the first time.
whichSpecifies which function to evaluate.

Implements IG.Num.VectorFunctionBaseGeneral.

References IG.Num.IVectorFunctionResults.CalculatedValues, IG.Num.IVectorFunctionResults.ErrorCode, IG.Num.IVectorFunctionResults.ErrorString, IG.Num.IVectorFunctionResults.GetValue(), and IG.Num.IVectorFunctionResults.ReqValues.

override double IG.Num.VectorFunctionBase.Derivative ( IVectorFunctionResults  evaluationData,
int  which,
int  component 
)
inlinevirtual

Calculates and returns the particular component of the vector function derivative.

Parameters
evaluationDataEvaluation data that contains function parameters and can store function resuts. If the function does not support component-wise evaluation then results will be stored to this structure and returned from it. This makes reuse possible - when different components are evaluated subsequently with the same parameters, results are calculated only for the first time.
whichSpecifies which function to take.
componentSpecifies which compoonent of the gradient should be returned.

Implements IG.Num.VectorFunctionBaseGeneral.

References IG.Num.IVectorFunctionResults.CalculatedGradients, IG.Num.IVectorFunctionResults.ErrorCode, IG.Num.IVectorFunctionResults.ErrorString, IG.Num.IVectorFunctionResults.GetGradient(), and IG.Num.IVectorFunctionResults.ReqGradients.

override double IG.Num.VectorFunctionBase.SecondDerivative ( IVectorFunctionResults  evaluationData,
int  which,
int  rowNum,
int  columnNum 
)
inlinevirtual

Calculates and returns the particular component of the vector function's second derivative (Hessian).

Parameters
evaluationDataEvaluation data that contains function parameters and can store function resuts. If the function does not support component-wise evaluation then results will be stored to this structure and returned from it. This makes reuse possible - when different components are evaluated subsequently with the same parameters, results are calculated only for the first time.
whichSpecifies which function to take.
rowNumSpecifies which row of the Hessian (matrix of second derivatives) should be returned.
columnNumSpecifies which column of the Hessian (matrix of second derivatives) should be returned.

Implements IG.Num.VectorFunctionBaseGeneral.

References IG.Num.IVectorFunctionResults.CalculatedHessians, IG.Num.IVectorFunctionResults.ErrorCode, IG.Num.IVectorFunctionResults.ErrorString, IG.Num.IVectorFunctionResults.GetHessian(), and IG.Num.IVectorFunctionResults.ReqHessians.

override void IG.Num.VectorFunctionBase.Evaluate ( IVector  parameters,
ref bool  calculateValues,
ref List< double >  values,
ref bool  calculateGradients,
ref List< IVector gradients,
ref bool  calculateHessians,
ref List< IMatrix hessians 
)
inlinevirtual

Calculation of values, gradients, and hessians of the vector function according to request flags. Calculated by using Evaluate(IVectorFunctionResults) in this class.

Parameters
parametersParameters at which evaluation takes place.
calculateValuesFlag for calculation of function values, input/output.
valuesFunction values, output.
calculateGradientsFlag for calculation of functions gradients, input/output.
gradientsGradients, output.
calculateHessiansFlag for calculation of Hessians, input/output.
hessiansFunctions' hessians, output.
Returns

Implements IG.Num.VectorFunctionBaseGeneral.

References IG.Num.IVectorFunctionResults.CalculatedGradients, IG.Num.IVectorFunctionResults.CalculatedHessians, IG.Num.IVectorFunctionResults.CalculatedValues, IG.Num.IVectorFunctionResults.ErrorCode, IG.Num.IVectorFunctionResults.ErrorString, IG.Num.IVectorFunctionResults.GetGradient(), IG.Num.IVectorFunctionResults.GetHessian(), IG.Num.IVectorFunctionResults.GetValue(), IG.Num.IVectorFunctionResults.NumFunctions, IG.Num.IVectorFunctionResults.NumParameters, IG.Num.IVectorFunctionResults.Parameters, IG.Num.IVectorFunctionResults.ReqGradients, IG.Num.IVectorFunctionResults.ReqHessians, and IG.Num.IVectorFunctionResults.ReqValues.

Property Documentation

override bool IG.Num.VectorFunctionBase.ComponentWiseEvaluation
getprotected set

Returns true, indicating that individual components of functions and eventually their deirvatives is performed directly.


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