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

IG::Num::VectorFunctionBaseGeneral Class Reference

Base class for VectorFunctionBase and VectorFunctionBaseComponentwise. In general, use VectorFunctionBase and VectorFunctionBase in order to derive from. More...

Inheritance diagram for IG::Num::VectorFunctionBaseGeneral:
Collaboration diagram for IG::Num::VectorFunctionBaseGeneral:

List of all members.

Classes

class  ObjectStoreResults

Public Member Functions

 VectorFunctionBaseGeneral ()
abstract void Evaluate (IVectorFunctionResults evaluationData)
 Performs evaluation of requwester function results and writes them to the provided data structure.
abstract double Value (IVectorFunctionResults evaluationData, int which)
 Calculates and returns the particular component of the vector function value.
abstract double Derivative (IVectorFunctionResults evaluationData, int which, int component)
 Calculates and returns the particular component of the vector function derivative.
abstract double SecondDerivative (IVectorFunctionResults evaluationData, int which, int rowNum, int columnNum)
 Calculates and returns the particular component of the vector function's second derivative (Hessian).
void Value (IVector parameters, ref List< double > values)
 Returns the value of vector function at the specified parameter.
void Derivative (IVector parameters, ref List< IVector > gradients)
 Returns the first derivative of this function at the specified parameter.
void SecondDerivative (IVector parameters, ref List< IMatrix > hessians)
 Returns the second derivative (Hessian) of this function at the specified arameter.
abstract 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.
virtual void NumericalDerivative (IVector x, IVector stepSizes, ref List< IVector > derivative)
 Calculates numerical derivative of this function. Central difference formula is used.
virtual void NumericalSecondDerivative (IVector x, IVector stepsizes, ref List< IVector > secondDerivatives)
 Calculates numerical second order derivative of this function. Central difference formula is used.

Protected Attributes

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.

Properties

object Lock [get]
virtual string Name [get, set]
 Returns a short name of the function.
virtual string Description [get, set]
 Returns a short description of the function.
virtual int NumParameters [get, set]
 Gets number of parameters of the current vector function (-1 for not defined, in case that function works with different numbers of parameters).
virtual int NumValues [get, 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).
virtual bool ComponentWiseEvaluation [get, set]
 Tells whether the function supports evaluation of individual components. If not then evaluation is performed through the Evaluate function.
virtual bool ValueDefined [get, set]
 Tells whether value of the function is defined by implementation.
virtual bool DerivativeDefined [get, set]
 Tells whether the first derivative is defined for this function (by implementation, not mathematically)
virtual bool SecondDerivativeDefined [get, set]
 Tells whether the second derivative is defined for this function (by implementation, not mathematically)

Private Member Functions

double LinearCombinationValue (IVectorFunctionResults evaluationData, IVector coefficients)
 Returns value of linear combination of functions contained in this vector function, with specified coefficients at specified parameters.
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.
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.
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.

Detailed Description

Base class for VectorFunctionBase and VectorFunctionBaseComponentwise. In general, use VectorFunctionBase and VectorFunctionBase in order to derive from.

$A Igor xx May10 Dec10; TODO: Implement linear combination of functions (and add them to the interface!!!)


Constructor & Destructor Documentation

IG::Num::VectorFunctionBaseGeneral::VectorFunctionBaseGeneral ( ) [inline]

Member Function Documentation

abstract void IG::Num::VectorFunctionBaseGeneral::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::IVectorFunction.

Implemented in IG::Num::VectorFunctionBase, IG::Num::VectorFunctionBaseComponentWise, and IG::Num::VectorFunctionExamples::RosenBrockAndCircle.

abstract double IG::Num::VectorFunctionBaseGeneral::Value ( IVectorFunctionResults  evaluationData,
int  which 
) [pure virtual]

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::IVectorFunction.

Implemented in IG::Num::VectorFunctionBase, and IG::Num::VectorFunctionBaseComponentWise.

abstract double IG::Num::VectorFunctionBaseGeneral::Derivative ( IVectorFunctionResults  evaluationData,
int  which,
int  component 
) [pure virtual]

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::IVectorFunction.

Implemented in IG::Num::VectorFunctionBase, and IG::Num::VectorFunctionBaseComponentWise.

abstract double IG::Num::VectorFunctionBaseGeneral::SecondDerivative ( IVectorFunctionResults  evaluationData,
int  which,
int  rowNum,
int  columnNum 
) [pure virtual]

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::IVectorFunction.

Implemented in IG::Num::VectorFunctionBase, and IG::Num::VectorFunctionBaseComponentWise.

void IG::Num::VectorFunctionBaseGeneral::Value ( IVector  parameters,
ref List< double >  values 
) [inline]

Returns the value of vector function at the specified parameter.

Implements IG::Num::IVectorFunction.

void IG::Num::VectorFunctionBaseGeneral::Derivative ( IVector  parameters,
ref List< IVector gradients 
) [inline]

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

Implements IG::Num::IVectorFunction.

void IG::Num::VectorFunctionBaseGeneral::SecondDerivative ( IVector  parameters,
ref List< IMatrix hessians 
) [inline]

Returns the second derivative (Hessian) of this function at the specified arameter.

Implements IG::Num::IVectorFunction.

abstract void IG::Num::VectorFunctionBaseGeneral::Evaluate ( IVector  parameters,
ref bool  calculateValues,
ref List< double >  values,
ref bool  calculateGradients,
ref List< IVector gradients,
ref bool  calculateHessians,
ref List< IMatrix hessians 
) [pure virtual]

Calculation of values, gradients, and hessians of the vector function according to request flags.

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.

Implements IG::Num::IVectorFunction.

Implemented in IG::Num::VectorFunctionBase, and IG::Num::VectorFunctionBaseComponentWise.

double IG::Num::VectorFunctionBaseGeneral::LinearCombinationValue ( IVectorFunctionResults  evaluationData,
IVector  coefficients 
) [inline, private]

Returns value of linear combination of functions contained in this vector function, with specified coefficients at specified parameters.

Parameters:
evaluationDataData used for evaluation that also contains parameters (in evaluationData.Parameters)
coefficientsCoefficients of linear combination.
void IG::Num::VectorFunctionBaseGeneral::LinearCombinationDerivative ( IVectorFunctionResults  evaluationData,
IVector  coefficients,
ref IVector  res 
) [inline, private]

Returns gradient of linear combination of functions contained in this vector function, with specified coefficients at specified parameters.

Parameters:
evaluationDataData used for evaluation that also contains parameters (in evaluationData.Parameters)
coefficientsCoefficients of linear combination.
resOutput parameter where gradient is written to.
double IG::Num::VectorFunctionBaseGeneral::LinearCombinationDerivative ( IVectorFunctionResults  evaluationData,
IVector  coefficients,
int  component 
) [inline, private]

Returns the specified component of gradient of combination of functions contained in this vector function, with specified coefficients at specified parameters.

Parameters:
evaluationDataData used for evaluation that also contains parameters (in evaluationData.Parameters)
coefficientsCoefficients of linear combination.
componentSpecifies which gradient component to return.
void IG::Num::VectorFunctionBaseGeneral::LinearCombinationSecondDerivative ( IVectorFunctionResults  evaluationData,
IVector  coefficients,
ref IMatrix  res 
) [inline, private]
double IG::Num::VectorFunctionBaseGeneral::LinearCombinationSecondDerivative ( IVectorFunctionResults  evaluationData,
IVector  coefficients,
int  rowNum,
int  columnNum 
) [inline, private]

Returns the specified component of Hessian of combination of functions contained in this vector function, with specified coefficients at specified parameters.

Parameters:
evaluationDataData used for evaluation that also contains parameters (in evaluationData.Parameters)
coefficientsCoefficients of linear combination.
rowNumRow number of the returned component.</parparam>

Parameters:
columnNumColumn number of the returned component.
virtual void IG::Num::VectorFunctionBaseGeneral::NumericalDerivative ( IVector  x,
IVector  stepSizes,
ref List< IVector derivative 
) [inline, virtual]

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

Parameters:
xPoint at which derivative is calculated.
stepsizeStep size.
Returns:
Numerical derivative.
virtual void IG::Num::VectorFunctionBaseGeneral::NumericalSecondDerivative ( IVector  x,
IVector  stepsizes,
ref List< IVector secondDerivatives 
) [inline, virtual]

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.

Member Data Documentation

object IG::Num::VectorFunctionBaseGeneral::_lock = new object() [protected]

Property Documentation

object IG::Num::VectorFunctionBaseGeneral::Lock [get]

Implements IG::Lib::ILockable.

virtual string IG::Num::VectorFunctionBaseGeneral::Name [get, set]

Returns a short name of the function.

Implements IG::Num::IVectorFunction.

virtual string IG::Num::VectorFunctionBaseGeneral::Description [get, set]

Returns a short description of the function.

Implements IG::Num::IVectorFunction.

virtual int IG::Num::VectorFunctionBaseGeneral::NumParameters [get, set]

Gets number of parameters of the current vector function (-1 for not defined, in case that function works with different numbers of parameters).

Implements IG::Num::IVectorFunction.

virtual int IG::Num::VectorFunctionBaseGeneral::NumValues [get, 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).

Implements IG::Num::IVectorFunction.

virtual bool IG::Num::VectorFunctionBaseGeneral::ComponentWiseEvaluation [get, set]

Tells whether the function supports evaluation of individual components. If not then evaluation is performed through the Evaluate function.

Implements IG::Num::IVectorFunction.

Reimplemented in IG::Num::VectorFunctionBase, and IG::Num::VectorFunctionBaseComponentWise.

virtual bool IG::Num::VectorFunctionBaseGeneral::ValueDefined [get, set]

Tells whether value of the function is defined by implementation.

Implements IG::Num::IVectorFunction.

virtual bool IG::Num::VectorFunctionBaseGeneral::DerivativeDefined [get, set]

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

Implements IG::Num::IVectorFunction.

virtual bool IG::Num::VectorFunctionBaseGeneral::SecondDerivativeDefined [get, set]

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

Implements IG::Num::IVectorFunction.


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