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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Protected Attributes | Properties | Private Attributes | List of all members
IG.Num.VectorFunctionBaseGeneral Class Referenceabstract

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

Inheritance diagram for IG.Num.VectorFunctionBaseGeneral:
[legend]
Collaboration diagram for IG.Num.VectorFunctionBaseGeneral:
[legend]

## Classes
class | ObjectStoreResults
| Storage for IVectorFunctionResults objects. More...

## Public Member Functions
| VectorFunctionBaseGeneral ()
void | SetNumParameters (int num)
| Sets number of parameters of the current vector function to the specified value. More...
void | SetNumValues (int num)
| Sets number of values of the vector function to the specified value. More...
abstract void | Evaluate (IVectorFunctionResults evaluationData)
| Performs evaluation of requwester function results and writes them to the provided data structure. More...
abstract double | Value (IVectorFunctionResults evaluationData, int which)
| Calculates and returns the particular component of the vector function value. More...
abstract double | Derivative (IVectorFunctionResults evaluationData, int which, int component)
| Calculates and returns the particular component of the vector function derivative. More...
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). More...
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...
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. 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 stepSize, 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...

## 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

## Properties
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]`
VectorFunctionBase.ObjectStoreResults | ResultsStore`[get]`
| Store of result objects for reuse. More...
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]`

## Private Attributes
VectorFunctionResults | _auxResults = null
volatile VectorFunctionBase.ObjectStoreResults | _resultStore

## Detailed Description

Base class for VectorFunctionBase and VectorFunctionBaseComponentwise. In general, use and 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

void IG.Num.VectorFunctionBaseGeneral.SetNumParameters | ( | int | num | ) |
| inline

Sets number of parameters of the current vector function to the specified value.

Parameters

  num | Number of parameters.

Implements IG.Num.IVectorFunction.

void IG.Num.VectorFunctionBaseGeneral.SetNumValues | ( | int | num | ) |
| inline

Sets number of values of the vector function to the specified value.

Parameters

  num |

Implements IG.Num.IVectorFunction.

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

  evaluationData | Data structure where request parameters are obtained and where results are written.

Implements IG.Num.IVectorFunction.

Implemented in IG.Num.VectorFunctionBaseComponentWise, IG.Num.VectorFunctionExamples.RosenrockAndCircle, and IG.Num.VectorFunctionBase.

abstract double IG.Num.VectorFunctionBaseGeneral.Value | ( | IVectorFunctionResults | evaluationData,
|  | int | which
| ) |  |
| pure virtual

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

Parameters

  evaluationData | Evaluation 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.
  which | Specifies which function to evaluate.

Implements IG.Num.IVectorFunction.

Implemented in IG.Num.QuadraticBasisSafer, IG.Num.QuadraticBasis, IG.Num.VectorFunctionBaseComponentWise, IG.Num.LinearBasisSafer, IG.Num.VectorFunctionFromScalar, IG.Num.VectorFunctionBase, and IG.Num.LinearBasis.

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

  evaluationData | Evaluation 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.
  which | Specifies which function to take.
  component | Specifies which compoonent of the gradient should be returned.

Implements IG.Num.IVectorFunction.

Implemented in IG.Num.QuadraticBasisSafer, IG.Num.QuadraticBasis, IG.Num.VectorFunctionBaseComponentWise, IG.Num.LinearBasisSafer, IG.Num.VectorFunctionFromScalar, IG.Num.VectorFunctionBase, and IG.Num.LinearBasis.

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

  evaluationData | Evaluation 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.
  which | Specifies which function to take.
  rowNum | Specifies which row of the Hessian (matrix of second derivatives) should be returned.
  columnNum | Specifies which column of the Hessian (matrix of second derivatives) should be returned.

Implements IG.Num.IVectorFunction.

Implemented in IG.Num.QuadraticBasisSafer, IG.Num.QuadraticBasis, IG.Num.VectorFunctionBaseComponentWise, IG.Num.LinearBasisSafer, IG.Num.VectorFunctionFromScalar, IG.Num.VectorFunctionBase, and IG.Num.LinearBasis.

virtual double IG.Num.VectorFunctionBaseGeneral.Value | ( | IVector | parameters,
|  | int | which
| ) |  |
| inline virtual

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

Parameters

  parameters | Parameters for which value of the specified component is calculated.
  which | Specifies which function to evaluate.

Implements IG.Num.IVectorFunction.

References IG.Num.IVectorFunctionResults.CalculatedValues, IG.Num.IVectorFunctionResults.ReqGradients, IG.Num.IVectorFunctionResults.ReqHessians, IG.Num.IVectorFunctionResults.ReqValues, IG.Num.IVectorFunctionResults.SetParametersReference(), and IG.Num.IVectorFunctionResults.Values.

virtual double IG.Num.VectorFunctionBaseGeneral.Derivative | ( | IVector | parameters,
|  | int | which,
|  | int | component
| ) |  |
| inline virtual

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

Parameters

  parameters | Parameters for which derivative of the specified component is calculated.
  which | Specifies which function to take.
  component | Specifies which compoonent of the gradient should be returned.

Implements IG.Num.IVectorFunction.

References IG.Num.IVectorFunctionResults.CalculatedGradients, IG.Num.IVectorFunctionResults.Gradients, IG.Num.IVectorFunctionResults.ReqGradients, IG.Num.IVectorFunctionResults.ReqHessians, IG.Num.IVectorFunctionResults.ReqValues, and IG.Num.IVectorFunctionResults.SetParametersReference().

virtual double IG.Num.VectorFunctionBaseGeneral.SecondDerivative | ( | IVector | parameters,
|  | int | which,
|  | int | rowNum,
|  | int | columnNum
| ) |  |
| inline virtual

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

Parameters

  parameters | Parameters for which the specified second derivative of the specified component is calculated.
  which | Specifies which function to take.
  rowNum | Specifies which row of the Hessian (matrix of second derivatives) should be returned.
  columnNum | Specifies which column of the Hessian (matrix of second derivatives) should be returned.

Implements IG.Num.IVectorFunction.

References IG.Num.IVectorFunctionResults.CalculatedHessians, IG.Num.IVectorFunctionResults.ReqGradients, IG.Num.IVectorFunctionResults.ReqHessians, IG.Num.IVectorFunctionResults.ReqValues, IG.Num.IVectorFunctionResults.SetParametersReference(), and IG.Num.IVectorFunctionResults.Values.

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

  parameters | Parameters at which evaluation takes place.
  calculateValues | Flag for calculation of function values, input/output.
  values | Function values, output.
  calculateGradients | Flag for calculation of functions gradients, input/output.
  gradients | Gradients, output.
  calculateHessians | Flag for calculation of Hessians, input/output.
  hessians | Functions' hessians, output.

Implements IG.Num.IVectorFunction.

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

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationValue | ( | IVectorFunctionResults | evaluationData,
|  | IVector | coefficients
| ) |  |
| inline

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

Parameters

  evaluationData | Data used for evaluation that also contains parameters (in evaluationData.Parameters)
  coefficients | Coefficients of linear combination.

void IG.Num.VectorFunctionBaseGeneral.LinearCombinationDerivative | ( | IVectorFunctionResults | evaluationData,
|  | IVector | coefficients,
|  | ref IVector | res
| ) |  |
| inline

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

Parameters

  evaluationData | Data used for evaluation that also contains parameters (in evaluationData.Parameters)
  coefficients | Coefficients of linear combination.
  res | Output parameter where gradient is written to.

References IG.Num.IVectorFunctionResults.Parameters.

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationDerivative | ( | IVectorFunctionResults | evaluationData,
|  | IVector | coefficients,
|  | int | component
| ) |  |
| inline

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

Parameters

  evaluationData | Data used for evaluation that also contains parameters (in evaluationData.Parameters)
  coefficients | Coefficients of linear combination.
  component | Specifies which gradient component to return.

void IG.Num.VectorFunctionBaseGeneral.LinearCombinationSecondDerivative | ( | IVectorFunctionResults | evaluationData,
|  | IVector | coefficients,
|  | ref IMatrix | res
| ) |  |
| inline

References IG.Num.IVectorFunctionResults.Parameters.

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationSecondDerivative | ( | IVectorFunctionResults | evaluationData,
|  | IVector | coefficients,
|  | int | rowNum,
|  | int | columnNum
| ) |  |
| inline

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

Parameters

  evaluationData | Data used for evaluation that also contains parameters (in evaluationData.Parameters)
  coefficients | Coefficients of linear combination.
  rowNum | Row number of the returned component.
  columnNum | Column number of the returned component.

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationValue | ( | IVector | parameters,
|  | IVector | coefficients
| ) |  |
| inline

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

Parameters

  parameters | Parameters where functions are evaluated.
  coefficients | Coefficients of linear combination.

void IG.Num.VectorFunctionBaseGeneral.LinearCombinationDerivative | ( | IVector | parameters,
|  | IVector | coefficients,
|  | ref IVector | res
| ) |  |
| inline

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

Parameters

  parameters | Parameters where functions are evaluated.
  coefficients | Coefficients of linear combination.
  res | Output parameter where gradient is written to.

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationDerivative | ( | IVector | parameters,
|  | IVector | coefficients,
|  | int | component
| ) |  |
| inline

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

Parameters

  parameters | Parameters where functions are evaluated.
  coefficients | Coefficients of linear combination.
  component | Specifies which gradient component to return.

void IG.Num.VectorFunctionBaseGeneral.LinearCombinationSecondDerivative | ( | IVector | parameters,
|  | IVector | coefficients,
|  | ref IMatrix | res
| ) |  |
| inline

Calculates second derivatives of the linear combination of components of vector functions and stores them to the specified matrix.

Parameters

  parameters | Parameters where linear combination second derivative is evaluated.
  coefficients | Coefficients of the linear combination.
  res | Matrix where second derivatives of the linear combination are stored.

double IG.Num.VectorFunctionBaseGeneral.LinearCombinationSecondDerivative | ( | IVector | parameters,
|  | IVector | coefficients,
|  | int | rowNum,
|  | int | columnNum
| ) |  |
| inline

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

Parameters

  parameters | Parameters where functions are evaluated.
  coefficients | Coefficients of linear combination.
  rowNum | Row number of the returned component.
  columnNum | Column number of the returned component.

virtual void IG.Num.VectorFunctionBaseGeneral.NumericalDerivative | ( | IVector | x,
|  | IVector | stepSize,
|  | ref List< IVector > | derivative
| ) |  |
| inline virtual

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

Parameters

  x | Point at which derivative is calculated.
  stepSize | Step size.
  derivative | 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

  x | Point at which second order derivative is calculated.
  stepsizes | Step size.
  secondDerivatives | List of vectrs where the calculated second derivatives are stored.

Returns
  Numerical derivative.

## Member Data Documentation

object IG.Num.VectorFunctionBaseGeneral._lock = new object()
| protected

string IG.Num.VectorFunctionBaseGeneral._name
| protected

string IG.Num.VectorFunctionBaseGeneral._description
| protected

int IG.Num.VectorFunctionBaseGeneral._numParameters = -1
| protected

int IG.Num.VectorFunctionBaseGeneral._numValues = -1
| protected

bool IG.Num.VectorFunctionBaseGeneral._valuesDefined = true
| protected

bool IG.Num.VectorFunctionBaseGeneral._derivativeDefined = false
| protected

bool IG.Num.VectorFunctionBaseGeneral._secondDerivativeDefined = false
| protected

bool IG.Num.VectorFunctionBaseGeneral._componentEvaluation = false
| protected

VectorFunctionResults IG.Num.VectorFunctionBaseGeneral._auxResults = null
| private

volatile VectorFunctionBase.ObjectStoreResults IG.Num.VectorFunctionBaseGeneral._resultStore
| private

## Property Documentation

object IG.Num.VectorFunctionBaseGeneral.Lock
| get

virtual string IG.Num.VectorFunctionBaseGeneral.Name
| get set

Returns a short name of the function.

virtual string IG.Num.VectorFunctionBaseGeneral.Description
| get set

Returns a short description of the function.

virtual int IG.Num.VectorFunctionBaseGeneral.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).

virtual int IG.Num.VectorFunctionBaseGeneral.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).

virtual bool IG.Num.VectorFunctionBaseGeneral.ComponentWiseEvaluation
| get protected set

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

virtual bool IG.Num.VectorFunctionBaseGeneral.ValueDefined
| get protected set

Tells whether value of the function is defined by implementation.

virtual bool IG.Num.VectorFunctionBaseGeneral.DerivativeDefined
| get protected set

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

virtual bool IG.Num.VectorFunctionBaseGeneral.SecondDerivativeDefined
| get protected set

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

IVectorFunctionResults IG.Num.VectorFunctionBaseGeneral.AuxResults
| get protected

VectorFunctionBase.ObjectStoreResults IG.Num.VectorFunctionBaseGeneral.ResultsStore
| get protected

Store of result objects for reuse.

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

- igbase/numeric/FunctionVectorBaseGeneral.cs