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

IG::Num::VectorFunctionResults Class 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::VectorFunctionResults:
Collaboration diagram for IG::Num::VectorFunctionResults:

List of all members.

Public Member Functions

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

Protected Attributes

int _numParameters = 1
int _numFunctions = 0
IVector _parameters
List< double > _values
List< IVector_gradients
List< IMatrix_hessians
bool _copyReferences = false
bool _reqvalues = true
bool _reqGradients = false
bool _reqHessians = false
int _errorCode = 0
string _errorString = null
bool _calcValues = false
bool _calcGradients = false
bool _calcHessians = false

Properties

virtual int NumParameters [get, set]
 Number of parameters.
virtual int NumFunctions [get, set]
 Number of functions.
virtual 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.
virtual IVector Parameters [get, set]
 Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning.
virtual List< double > Values [get, set]
 Function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
virtual List< IVectorGradients [get, set]
 Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
virtual 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.
virtual bool ReqValues [get, set]
 Indicates whether calculation of functions is/was requested.
virtual bool ReqGradients [get, set]
 Indicates whether calculation of function gradients is/was requested.
virtual bool ReqHessians [get, set]
 Indicates whether calculation of functions' Hessians is/was requested.
virtual int ErrorCode [get, set]
 Error code. 0 - everything is OK. negative value - something went wrong.
virtual String ErrorString [get, set]
 Error string indicating what went wrong.
virtual 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.
virtual bool CalculatedValues [get, set]
 Indicates whether calculation of functions is/was requested.
virtual bool CalculatedGradients [get, set]
 Indicates whether calculation of functions' gradients is/was requested.
virtual bool CalculatedHessians [get, set]
 Indicates whether calculation of functions' Hessian is/was requested.

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;


Constructor & Destructor Documentation

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

1 parameter, 1 function. No gradients required

IG::Num::VectorFunctionResults::VectorFunctionResults ( bool  reqGradients) [inline]

1 parameter, 1 function, gradients required.

Parameters:
reqGradientsWhether gradient of the function gradient is required.
IG::Num::VectorFunctionResults::VectorFunctionResults ( int  numParameters) [inline]

Specified number of parameters, 1 function. No gradients required.

Parameters:
numParametersNumber of parameters.
IG::Num::VectorFunctionResults::VectorFunctionResults ( int  numParameters,
bool  reqGradients 
) [inline]

Specified number of parameters, 1 function. No gradients required.

Parameters:
numParametersNumber of parameters.
reqGradientsWhether gradients are requested.
IG::Num::VectorFunctionResults::VectorFunctionResults ( int  numParameters,
int  numFunctions 
) [inline]

Specified number of parameters and functions. No gradients required.

Parameters:
numParametersNumber of parameters.
numFunctionsNumber of functions.
IG::Num::VectorFunctionResults::VectorFunctionResults ( int  numParameters,
int  numFunctions,
bool  reqGradients 
) [inline]

Specified number of parameters and functions. No gradients required.

Parameters:
numParametersNumber of parameters.
numFunctionsNumber of functions.

Member Function Documentation

virtual IVector IG::Num::VectorFunctionResults::GetParameters ( ) [inline, virtual]

Returns vector of optimization parameters.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetParameters ( IVector  value) [inline, virtual]

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

Parameters:
valueValue to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetParametersReference ( IVector  reference) [inline, virtual]

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

Parameters:
valueReference to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual double IG::Num::VectorFunctionResults::GetParameter ( int  index) [inline, virtual]

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

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetParameter ( int  index,
double  value 
) [inline, virtual]

Sets the specified optimization parameter.

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

Implements IG::Num::IVectorFunctionResults.

virtual List<double> IG::Num::VectorFunctionResults::GetValues ( ) [inline, virtual]

Returns a list of function values.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetValues ( List< double >  values) [inline, virtual]

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

Parameters:
valuesValues of functions.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetValuesReference ( List< double >  reference) [inline, virtual]

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

Parameters:
valuesReference to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual double IG::Num::VectorFunctionResults::GetValue ( int  which) [inline, virtual]

Returns the specified function value.

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetValue ( int  which,
double  value 
) [inline, virtual]

Sets the specified function value.

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

Implements IG::Num::IVectorFunctionResults.

virtual List<IVector> IG::Num::VectorFunctionResults::GetGradients ( ) [inline, virtual]

Returns a list of function gradients.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetGradients ( List< IVector values) [inline, virtual]

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

Parameters:
valuesValue to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetGradientsReference ( List< IVector reference) [inline, virtual]

Sets function gradients. Only the list reference is copied.

Parameters:
valuesReference to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual IVector IG::Num::VectorFunctionResults::GetGradient ( int  which) [inline, virtual]

Returns the gradient of the specified function.

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

Implements IG::Num::IVectorFunctionResults.

virtual double IG::Num::VectorFunctionResults::GetGradient ( int  which,
int  index 
) [inline, virtual]

Returns the specific function gradient component.

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetGradient ( int  which,
IVector  value 
) [inline, virtual]

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.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetGradientReference ( int  which,
IVector  reference 
) [inline, virtual]

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

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetGradient ( int  which,
int  index,
double  value 
) [inline, virtual]

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.

Implements IG::Num::IVectorFunctionResults.

virtual List<IMatrix> IG::Num::VectorFunctionResults::GetHessians ( ) [inline, virtual]

Returns the list of functions' Hessians.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetHessians ( List< IMatrix values) [inline, virtual]

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

Parameters:
valuesList of Hessians to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetHessiansReference ( List< IMatrix reference) [inline, virtual]

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

Parameters:
valuesReference to be assigned.

Implements IG::Num::IVectorFunctionResults.

virtual IMatrix IG::Num::VectorFunctionResults::GetHessian ( int  which) [inline, virtual]

Returns Hessian of the specified function.

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

Implements IG::Num::IVectorFunctionResults.

virtual double IG::Num::VectorFunctionResults::GetHessian ( int  which,
int  rowIndex,
int  columnIndex 
) [inline, virtual]

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).

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetHessian ( int  which,
IMatrix  value 
) [inline, virtual]

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.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetHessianReference ( int  which,
IMatrix  reference 
) [inline, virtual]

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.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::SetHessian ( int  which,
int  rowIndex,
int  columnIndex,
double  value 
) [inline, virtual]

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).

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::NullifyAll ( ) [inline, virtual]

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::NullifyResults ( ) [inline, virtual]

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateParameters ( ) [inline, virtual]

Allocates space for parameters.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateRequested ( ) [inline, virtual]

Allocates space for all requested result objects.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateValuesList ( ) [inline, virtual]

Allocates space for list of function values.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateGradientsList ( ) [inline, virtual]

Allocates space for list of function gradients.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateGradients ( ) [inline, virtual]

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateGradient ( int  which) [inline, virtual]

Allocates space for the specified function gradient.

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateHessiansList ( ) [inline, virtual]

Allocates space for the list of functions' Hessians.

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateHessians ( ) [inline, virtual]

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::AllocateHessian ( int  which) [inline, virtual]

Allocates space for the specified fucnction's Hessian.

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::ResetResults ( ) [inline, virtual]

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

Implements IG::Num::IVectorFunctionResults.

virtual void IG::Num::VectorFunctionResults::Copy ( IVectorFunctionResults  results) [inline, virtual]

Copies data from another vector function results.

Parameters:
resVector function results which data is copied from.

Implements IG::Num::IVectorFunctionResults.

virtual IVectorFunctionResults IG::Num::VectorFunctionResults::GetCopy ( ) [inline, virtual]

Returns an exact deep copy of the current object.

Implements IG::Num::IVectorFunctionResults.

override string IG::Num::VectorFunctionResults::ToString ( ) [inline]

Member Data Documentation

List<double> IG::Num::VectorFunctionResults::_values [protected]

Property Documentation

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

Number of parameters.

Implements IG::Num::IVectorFunctionResults.

virtual int IG::Num::VectorFunctionResults::NumFunctions [get, set]

Number of functions.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::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.

Implements IG::Num::IVectorFunctionResults.

virtual IVector IG::Num::VectorFunctionResults::Parameters [get, set]

Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning.

Implements IG::Num::IVectorFunctionResults.

virtual List<double> IG::Num::VectorFunctionResults::Values [get, set]

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

Implements IG::Num::IVectorFunctionResults.

virtual List<IVector> IG::Num::VectorFunctionResults::Gradients [get, set]

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

Implements IG::Num::IVectorFunctionResults.

virtual List<IMatrix> IG::Num::VectorFunctionResults::Hessians [get, set]

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

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::ReqValues [get, set]

Indicates whether calculation of functions is/was requested.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::ReqGradients [get, set]

Indicates whether calculation of function gradients is/was requested.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::ReqHessians [get, set]

Indicates whether calculation of functions' Hessians is/was requested.

Implements IG::Num::IVectorFunctionResults.

virtual int IG::Num::VectorFunctionResults::ErrorCode [get, set]

Error code. 0 - everything is OK. negative value - something went wrong.

Implements IG::Num::IVectorFunctionResults.

virtual String IG::Num::VectorFunctionResults::ErrorString [get, set]

Error string indicating what went wrong.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::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.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::CalculatedValues [get, set]

Indicates whether calculation of functions is/was requested.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::CalculatedGradients [get, set]

Indicates whether calculation of functions' gradients is/was requested.

Implements IG::Num::IVectorFunctionResults.

virtual bool IG::Num::VectorFunctionResults::CalculatedHessians [get, set]

Indicates whether calculation of functions' Hessian is/was requested.

Implements IG::Num::IVectorFunctionResults.


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