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.IVectorFunctionResults Interface Reference

Vector function results. Used to transfer parameters input (e.g. vector of parameters, request flags) to the vector function and to store function output results (e.g. values, their gradients, error codes, and flags indicating what has actually been calculated). REMARKS: Property CopyReferences specifies whether only references are copied when individial object fields are assigned & set (when the property is true), or values are actually copied (when false - deep copy). Each setter method also has the variant that always copies only the reference (function name appended by "Reference"). This makes possible to avoid duplication of allocated data and also to avoid having different data with the same references. In the beginning of analysis functions, call ResetResults(). More...

+ Inheritance diagram for IG.Num.IVectorFunctionResults:

Public Member Functions

IVector GetParameters ()
 Returns vector of optimization parameters. More...
 
void SetParameters (IVector value)
 Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied. More...
 
void SetParametersReference (IVector reference)
 Sets the vector of optimization parameters. Only the reference is copied. More...
 
double GetParameter (int index)
 Returns specific optimization parameter. Throws exception if not defined or index out of bounds. More...
 
void SetParameter (int index, double value)
 Sets the specified optimization parameter. More...
 
List< double > GetValues ()
 Returns a list of function values. More...
 
void SetValues (List< double > values)
 Sets the list of function values. If CopyReferences=true (false by default) then only the list reference is copied. More...
 
void SetValuesReference (List< double > reference)
 Sets the list of function values. Only the list reference is copied. More...
 
double GetValue (int which)
 Returns the specified function value. More...
 
void SetValue (int which, double value)
 Sets the specified function value. More...
 
List< IVectorGetGradients ()
 Returns a list of function gradients. More...
 
void SetGradients (List< IVector > values)
 Sets function gradients. If CopyReferences=true (false by default) then only the list reference is copied. More...
 
void SetGradientsReference (List< IVector > reference)
 Sets function gradients. Only the list reference is copied. More...
 
IVector GetGradient (int which)
 Returns the gradient of the specified function. More...
 
double GetGradient (int which, int index)
 Returns the specific function gradient component. More...
 
void SetGradient (int which, IVector value)
 Sets the specified function gradient. If CopyReferences=true (false by default) then only the reference is copied. More...
 
void SetGradientReference (int which, IVector reference)
 Sets the specified function gradient. Only the reference is copied. More...
 
void SetGradient (int which, int index, double value)
 Sets the specified fuction gradient component. More...
 
List< IMatrixGetHessians ()
 Returns the list of functions' Hessians. More...
 
void SetHessians (List< IMatrix > values)
 Sets functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied. More...
 
void SetHessiansReference (List< IMatrix > reference)
 Sets functios' Hessians. Only the list reference is copied. More...
 
IMatrix GetHessian (int which)
 Returns Hessian of the specified function. More...
 
double GetHessian (int which, int rowIndex, int columnIndex)
 Returns the specified component of Hessian of the specified function. More...
 
void SetHessian (int which, IMatrix value)
 Sets the specified function's Hessian. If CopyReferences=true (false by default) then only the reference is copied. More...
 
void SetHessianReference (int which, IMatrix reference)
 Sets the specified function's Hessian. Only the reference is copied. More...
 
void SetHessian (int which, int rowIndex, int columnIndex, double value)
 Sets the specified component of the specified function's Hessian. More...
 
void NullifyAll ()
 Sets all objects (parameter and result objects) to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection. More...
 
void NullifyResults ()
 Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection. More...
 
void AllocateParameters ()
 Allocates space for parameters. More...
 
void AllocateRequested ()
 Allocates space for all requested result objects. More...
 
void AllocateValuesList ()
 Allocates space for list of function values. More...
 
void AllocateGradientsList ()
 Allocates space for list of function gradients. More...
 
void AllocateGradients ()
 Allocates space for function gradients (including for the list, if necessarty). More...
 
void AllocateGradient (int which)
 Allocates space for the specified function gradient. More...
 
void AllocateHessiansList ()
 Allocates space for the list of functions' Hessians. More...
 
void AllocateHessians ()
 Allocates space for functions' Hessians (including space for the list, if necessary). More...
 
void AllocateHessian (int which)
 Allocates space for the specified fucnction's Hessian. More...
 
void ResetResults ()
 Sets all calculated flags to false, error code to 0 (no error) and error string to null. More...
 
void Copy (IVectorFunctionResults results)
 Copies data from another vector function results. More...
 
IVectorFunctionResults GetCopy ()
 Returns an exact deep copy of the current object. More...
 

Properties

int NumParameters [get, set]
 Number of parameters. More...
 
int NumFunctions [get, set]
 Number of functions. More...
 
bool CopyReferences [get, set]
 Indicates whether just references can be copied when setting optimization parameters or results. If false then deep copy is always be performed. Default is false. More...
 
IVector Parameters [get, set]
 Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning. More...
 
List< double > Values [get, set]
 Function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More...
 
List< IVectorGradients [get, set]
 Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More...
 
List< IMatrixHessians [get, set]
 Functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments. More...
 
bool ReqValues [get, set]
 Indicates whether calculation of function values is/was requested. More...
 
bool ReqGradients [get, set]
 Indicates whether calculation of functions gradients is/was requested. More...
 
bool ReqHessians [get, set]
 Indicates whether calculation of functions Hessian is/was requested. More...
 
int ErrorCode [get, set]
 Error code. 0 - everything is OK. negative value - something went wrong. More...
 
String ErrorString [get, set]
 Error string indicating what went wrong. More...
 
bool Calculated [get, set]
 Collectively gets or sets calculated flags. Set false: all calculated flags are set to false. Set true: all calculated flags for which the corresponding request flags are true, are set to truee, others are set to false. Get: returns true if all the flags for which the corresponding request flags are true, are also true. Otherwise returns false. More...
 
bool CalculatedValues [get, set]
 Indicates whether calculation of function values is/was requested. More...
 
bool CalculatedGradients [get, set]
 Indicates whether calculation of functions gradient is/was requested. More...
 
bool CalculatedHessians [get, set]
 Indicates whether calculation of functions' Hessians are/was requested. More...
 

Detailed Description

Vector function results. Used to transfer parameters input (e.g. vector of parameters, request flags) to the vector function and to store function output results (e.g. values, their gradients, error codes, and flags indicating what has actually been calculated). REMARKS: Property CopyReferences specifies whether only references are copied when individial object fields are assigned & set (when the property is true), or values are actually copied (when false - deep copy). Each setter method also has the variant that always copies only the reference (function name appended by "Reference"). This makes possible to avoid duplication of allocated data and also to avoid having different data with the same references. In the beginning of analysis functions, call ResetResults().

$A Igor xx Apr10;

Member Function Documentation

IVector IG.Num.IVectorFunctionResults.GetParameters ( )

Returns vector of optimization parameters.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetParameters ( IVector  value)

Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied.

Parameters
valueValue to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetParametersReference ( IVector  reference)

Sets the vector of optimization parameters. Only the reference is copied.

Parameters
valueReference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBaseGeneral.Derivative(), IG.Num.VectorFunctionBaseComponentWise.Evaluate(), IG.Num.VectorFunctionBaseGeneral.SecondDerivative(), and IG.Num.VectorFunctionBaseGeneral.Value().

double IG.Num.IVectorFunctionResults.GetParameter ( int  index)

Returns specific optimization parameter. Throws exception if not defined or index out of bounds.

Parameters
iindexIndex of parameter to be returned (counting from 0).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.LinearBasis.Value(), and IG.Num.LinearBasisSafer.Value().

void IG.Num.IVectorFunctionResults.SetParameter ( int  index,
double  value 
)

Sets the specified optimization parameter.

Parameters
indexIndex of parameter to be set (counting from 0).
valueParameter value.

Implemented in IG.Num.VectorFunctionResults.

List<double> IG.Num.IVectorFunctionResults.GetValues ( )

Returns a list of function values.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetValues ( List< double >  values)

Sets the list of function values. If CopyReferences=true (false by default) then only the list reference is copied.

Parameters
valuesValues of functions.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetValuesReference ( List< double >  reference)

Sets the list of function values. Only the list reference is copied.

Parameters
valuesReference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBaseComponentWise.Evaluate().

double IG.Num.IVectorFunctionResults.GetValue ( int  which)

Returns the specified function value.

Parameters
whichSpecifies which function to return (counting from 0).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBase.Evaluate(), and IG.Num.VectorFunctionBase.Value().

void IG.Num.IVectorFunctionResults.SetValue ( int  which,
double  value 
)

Sets the specified function value.

Parameters
whichSpecifies which function is set (counting from 0).
valueAssigned value of the function.

Implemented in IG.Num.VectorFunctionResults.

List<IVector> IG.Num.IVectorFunctionResults.GetGradients ( )

Returns a list of function gradients.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetGradients ( List< IVector values)

Sets function gradients. If CopyReferences=true (false by default) then only the list reference is copied.

Parameters
valuesValue to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetGradientsReference ( List< IVector reference)

Sets function gradients. Only the list reference is copied.

Parameters
valuesReference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBaseComponentWise.Evaluate().

IVector IG.Num.IVectorFunctionResults.GetGradient ( int  which)

Returns the gradient of the specified function.

Parameters
whichSpecifies which function to take (couonted from 0).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBase.Derivative(), and IG.Num.VectorFunctionBase.Evaluate().

double IG.Num.IVectorFunctionResults.GetGradient ( int  which,
int  index 
)

Returns the specific function gradient component.

Parameters
whichSpecifies which function to take (couonted from 0).
indexSpecifies gradient component (conted form 0).

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetGradient ( int  which,
IVector  value 
)

Sets the specified function gradient. If CopyReferences=true (false by default) then only the reference is copied.

Parameters
whichSpecifies which function to take (couonted from 0).
valueValue of the gradient to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetGradientReference ( int  which,
IVector  reference 
)

Sets the specified function gradient. Only the reference is copied.

Parameters
whichSpecifies which function to take (couonted from 0).
valueGradient reference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetGradient ( int  which,
int  index,
double  value 
)

Sets the specified fuction gradient component.

Parameters
whichSpecifies which function to take (couonted from 0).
indexSpecified index of gradient coponent to be set.
valueValue to be assigned to the specified component.

Implemented in IG.Num.VectorFunctionResults.

List<IMatrix> IG.Num.IVectorFunctionResults.GetHessians ( )

Returns the list of functions' Hessians.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetHessians ( List< IMatrix values)

Sets functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied.

Parameters
valuesList of Hessians to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetHessiansReference ( List< IMatrix reference)

Sets functios' Hessians. Only the list reference is copied.

Parameters
valuesReference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBaseComponentWise.Evaluate().

IMatrix IG.Num.IVectorFunctionResults.GetHessian ( int  which)

Returns Hessian of the specified function.

Parameters
whichSpecifies which function it applies to (counting from 0).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBase.Evaluate(), and IG.Num.VectorFunctionBase.SecondDerivative().

double IG.Num.IVectorFunctionResults.GetHessian ( int  which,
int  rowIndex,
int  columnIndex 
)

Returns the specified component of Hessian of the specified function.

Parameters
whichSpecifies which function it applies to (counting from 0).
rowIndexRow index of the component (counting from 0).
columnIndexColumn index of the component (counting from 0).

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetHessian ( int  which,
IMatrix  value 
)

Sets the specified function's Hessian. If CopyReferences=true (false by default) then only the reference is copied.

Parameters
whichSpecifies which function it applies to (counting from 0).
valueHessian matrix to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetHessianReference ( int  which,
IMatrix  reference 
)

Sets the specified function's Hessian. Only the reference is copied.

Parameters
whichSpecifies which function it applies to (counting from 0).
valueHessian matrix reference to be assigned.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.SetHessian ( int  which,
int  rowIndex,
int  columnIndex,
double  value 
)

Sets the specified component of the specified function's Hessian.

Parameters
whichSpecifies which function it applies to (counting from 0).
rowIndexRow index of the component (counting from 0).
columnIndexColumn index of the component (counting from 0).

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.NullifyAll ( )

Sets all objects (parameter and result objects) to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionBaseGeneral.ObjectStoreResults.TryStore().

void IG.Num.IVectorFunctionResults.NullifyResults ( )

Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateParameters ( )

Allocates space for parameters.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateRequested ( )

Allocates space for all requested result objects.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateValuesList ( )

Allocates space for list of function values.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate().

void IG.Num.IVectorFunctionResults.AllocateGradientsList ( )

Allocates space for list of function gradients.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateGradients ( )

Allocates space for function gradients (including for the list, if necessarty).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate().

void IG.Num.IVectorFunctionResults.AllocateGradient ( int  which)

Allocates space for the specified function gradient.

Parameters
whichSpecifies which function it applies to (countinf form 0).

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateHessiansList ( )

Allocates space for the list of functions' Hessians.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.AllocateHessians ( )

Allocates space for functions' Hessians (including space for the list, if necessary).

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate().

void IG.Num.IVectorFunctionResults.AllocateHessian ( int  which)

Allocates space for the specified fucnction's Hessian.

Parameters
whichSpecifies which function it applies to (conting form 0).

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.ResetResults ( )

Sets all calculated flags to false, error code to 0 (no error) and error string to null.

Implemented in IG.Num.VectorFunctionResults.

void IG.Num.IVectorFunctionResults.Copy ( IVectorFunctionResults  results)

Copies data from another vector function results.

Parameters
resVector function results which data is copied from.

Implemented in IG.Num.VectorFunctionResults.

Referenced by IG.Num.VectorFunctionResults.GetCopy().

IVectorFunctionResults IG.Num.IVectorFunctionResults.GetCopy ( )

Returns an exact deep copy of the current object.

Implemented in IG.Num.VectorFunctionResults.

Property Documentation

bool IG.Num.IVectorFunctionResults.CopyReferences
getset

Indicates whether just references can be copied when setting optimization parameters or results. If false then deep copy is always be performed. Default is false.

List<double> IG.Num.IVectorFunctionResults.Values
getset
List<IVector> IG.Num.IVectorFunctionResults.Gradients
getset

Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments.

Referenced by IG.Num.VectorFunctionResults.Copy(), IG.Num.VectorFunctionBaseGeneral.Derivative(), IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate(), and IG.Num.VectorFunctionBaseComponentWise.Evaluate().

List<IMatrix> IG.Num.IVectorFunctionResults.Hessians
getset

Functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments.

Referenced by IG.Num.VectorFunctionResults.Copy(), IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate(), and IG.Num.VectorFunctionBaseComponentWise.Evaluate().

int IG.Num.IVectorFunctionResults.ErrorCode
getset
String IG.Num.IVectorFunctionResults.ErrorString
getset
bool IG.Num.IVectorFunctionResults.Calculated
getset

Collectively gets or sets calculated flags. Set false: all calculated flags are set to false. Set true: all calculated flags for which the corresponding request flags are true, are set to truee, others are set to false. Get: returns true if all the flags for which the corresponding request flags are true, are also true. Otherwise returns false.

Referenced by IG.Num.VectorFunctionExamples.RosenBrockAndCircle.Evaluate().

bool IG.Num.IVectorFunctionResults.CalculatedHessians
getset

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