IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
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...
Public Member Functions | |
VectorFunctionResults () | |
1 parameter, 1 function. No gradients required More... | |
VectorFunctionResults (bool reqGradients) | |
1 parameter, 1 function, gradients required. More... | |
VectorFunctionResults (int numParameters) | |
Specified number of parameters, 1 function. No gradients required. More... | |
VectorFunctionResults (int numParameters, bool reqGradients) | |
Specified number of parameters, 1 function. No gradients required. More... | |
VectorFunctionResults (int numParameters, int numFunctions) | |
Specified number of parameters and functions. No gradients required. More... | |
VectorFunctionResults (int numParameters, int numFunctions, bool reqGradients) | |
Specified number of parameters and functions. No gradients required. More... | |
virtual IVector | GetParameters () |
Returns vector of optimization parameters. More... | |
virtual void | SetParameters (IVector value) |
Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetParametersReference (IVector reference) |
Sets the vector of optimization parameters. Only the reference is copied. More... | |
virtual double | GetParameter (int index) |
Returns specific optimization parameter. Throws exception if not defined or index out of bounds. More... | |
virtual void | SetParameter (int index, double value) |
Sets the specified optimization parameter. More... | |
virtual List< double > | GetValues () |
Returns a list of function values. More... | |
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. More... | |
virtual void | SetValuesReference (List< double > reference) |
Sets the list of function values. Only the list reference is copied. More... | |
virtual double | GetValue (int which) |
Returns the specified function value. More... | |
virtual void | SetValue (int which, double value) |
Sets the specified function value. More... | |
virtual List< IVector > | GetGradients () |
Returns a list of function gradients. More... | |
virtual void | SetGradients (List< IVector > values) |
Sets function gradients. If CopyReferences=true (false by default) then only the list reference is copied. More... | |
virtual void | SetGradientsReference (List< IVector > reference) |
Sets function gradients. Only the list reference is copied. More... | |
virtual IVector | GetGradient (int which) |
Returns the gradient of the specified function. More... | |
virtual double | GetGradient (int which, int index) |
Returns the specific function gradient component. More... | |
virtual void | SetGradient (int which, IVector value) |
Sets the specified function gradient. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetGradientReference (int which, IVector reference) |
Sets the specified function gradient. Only the reference is copied. More... | |
virtual void | SetGradient (int which, int index, double value) |
Sets the specified fuction gradient component. More... | |
virtual List< IMatrix > | GetHessians () |
Returns the list of functions' Hessians. More... | |
virtual void | SetHessians (List< IMatrix > values) |
Sets functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied. More... | |
virtual void | SetHessiansReference (List< IMatrix > reference) |
Sets functios' Hessians. Only the list reference is copied. More... | |
virtual IMatrix | GetHessian (int which) |
Returns Hessian of the specified function. More... | |
virtual double | GetHessian (int which, int rowIndex, int columnIndex) |
Returns the specified component of Hessian of the specified function. More... | |
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. More... | |
virtual void | SetHessianReference (int which, IMatrix reference) |
Sets the specified function's Hessian. Only the reference is copied. More... | |
virtual void | SetHessian (int which, int rowIndex, int columnIndex, double value) |
Sets the specified component of the specified function's Hessian. More... | |
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. More... | |
virtual void | NullifyResults () |
Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection. More... | |
virtual void | AllocateParameters () |
Allocates space for parameters. More... | |
virtual void | AllocateRequested () |
Allocates space for all requested result objects. More... | |
virtual void | AllocateValuesList () |
Allocates space for list of function values. More... | |
virtual void | AllocateGradientsList () |
Allocates space for list of function gradients. More... | |
virtual void | AllocateGradients () |
Allocates space for function gradients (including for the list, if necessarty). More... | |
virtual void | AllocateGradient (int which) |
Allocates space for the specified function gradient. More... | |
virtual void | AllocateHessiansList () |
Allocates space for the list of functions' Hessians. More... | |
virtual void | AllocateHessians () |
Allocates space for functions' Hessians (including space for the list, if necessary). More... | |
virtual void | AllocateHessian (int which) |
Allocates space for the specified fucnction's Hessian. More... | |
virtual void | ResetResults () |
Sets all calculated flags to false, error code to 0 (no error) and error string to null. More... | |
virtual void | Copy (IVectorFunctionResults results) |
Copies data from another vector function results. More... | |
virtual IVectorFunctionResults | GetCopy () |
Returns an exact deep copy of the current object. More... | |
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. More... | |
virtual int | NumFunctions [get, set] |
Number of functions. More... | |
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. More... | |
virtual IVector | Parameters [get, set] |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning. More... | |
virtual List< double > | Values [get, set] |
Function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual List< IVector > | Gradients [get, set] |
Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual List< IMatrix > | Hessians [get, set] |
Functions' Hessians (matrices of second derivatives). If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
virtual bool | ReqValues [get, set] |
Indicates whether calculation of functions is/was requested. More... | |
virtual bool | ReqGradients [get, set] |
Indicates whether calculation of function gradients is/was requested. More... | |
virtual bool | ReqHessians [get, set] |
Indicates whether calculation of functions' Hessians is/was requested. More... | |
virtual int | ErrorCode [get, set] |
Error code. 0 - everything is OK. negative value - something went wrong. More... | |
virtual String | ErrorString [get, set] |
Error string indicating what went wrong. More... | |
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. More... | |
virtual bool | CalculatedValues [get, set] |
Indicates whether calculation of functions is/was requested. More... | |
virtual bool | CalculatedGradients [get, set] |
Indicates whether calculation of functions' gradients is/was requested. More... | |
virtual bool | CalculatedHessians [get, set] |
Indicates whether calculation of functions' Hessian is/was requested. More... | |
![]() | |
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< IVector > | Gradients [get, set] |
Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments. More... | |
List< IMatrix > | Hessians [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... | |
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;
|
inline |
1 parameter, 1 function. No gradients required
|
inline |
1 parameter, 1 function, gradients required.
reqGradients | Whether gradient of the function gradient is required. |
|
inline |
Specified number of parameters, 1 function. No gradients required.
numParameters | Number of parameters. |
|
inline |
Specified number of parameters, 1 function. No gradients required.
numParameters | Number of parameters. |
reqGradients | Whether gradients are requested. |
|
inline |
Specified number of parameters and functions. No gradients required.
numParameters | Number of parameters. |
numFunctions | Number of functions. |
|
inline |
Specified number of parameters and functions. No gradients required.
numParameters | Number of parameters. |
numFunctions | Number of functions. |
|
inlinevirtual |
Returns vector of optimization parameters.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the vector of optimization parameters. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the vector of optimization parameters. Only the reference is copied.
value | Reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
Referenced by IG.Num.LinearBasis.Example().
|
inlinevirtual |
Returns specific optimization parameter. Throws exception if not defined or index out of bounds.
iindex | Index of parameter to be returned (counting from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified optimization parameter.
index | Index of parameter to be set (counting from 0). |
value | Parameter value. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns a list of function values.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the list of function values. If CopyReferences=true (false by default) then only the list reference is copied.
values | Values of functions. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the list of function values. Only the list reference is copied.
values | Reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns the specified function value.
which | Specifies which function to return (counting from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified function value.
which | Specifies which function is set (counting from 0). |
value | Assigned value of the function. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns a list of function gradients.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets function gradients. If CopyReferences=true (false by default) then only the list reference is copied.
values | Value to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets function gradients. Only the list reference is copied.
values | Reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns the gradient of the specified function.
which | Specifies which function to take (couonted from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns the specific function gradient component.
which | Specifies which function to take (couonted from 0). |
index | Specifies gradient component (conted form 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified function gradient. If CopyReferences=true (false by default) then only the reference is copied.
which | Specifies which function to take (couonted from 0). |
value | Value of the gradient to be assigned. |
Implements IG.Num.IVectorFunctionResults.
References IG.Num.IVector.GetCopy().
|
inlinevirtual |
Sets the specified function gradient. Only the reference is copied.
which | Specifies which function to take (couonted from 0). |
value | Gradient reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified fuction gradient component.
which | Specifies which function to take (couonted from 0). |
index | Specified index of gradient coponent to be set. |
value | Value to be assigned to the specified component. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns the list of functions' Hessians.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets functios' Hessians. If CopyReferences=true (false by default) then only the list reference is copied.
values | List of Hessians to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets functios' Hessians. Only the list reference is copied.
values | Reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns Hessian of the specified function.
which | Specifies which function it applies to (counting from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Returns the specified component of Hessian of the specified function.
which | Specifies which function it applies to (counting from 0). |
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified function's Hessian. If CopyReferences=true (false by default) then only the reference is copied.
which | Specifies which function it applies to (counting from 0). |
value | Hessian matrix to be assigned. |
Implements IG.Num.IVectorFunctionResults.
References IG.Num.IMatrix.GetCopy().
|
inlinevirtual |
Sets the specified function's Hessian. Only the reference is copied.
which | Specifies which function it applies to (counting from 0). |
value | Hessian matrix reference to be assigned. |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Sets the specified component of the specified function's Hessian.
which | Specifies which function it applies to (counting from 0). |
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
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.
|
inlinevirtual |
Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for parameters.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for all requested result objects.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for list of function values.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for list of function gradients.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for function gradients (including for the list, if necessarty).
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for the specified function gradient.
which | Specifies which function it applies to (countinf form 0). |
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for the list of functions' Hessians.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Allocates space for functions' Hessians (including space for the list, if necessary).
Implements IG.Num.IVectorFunctionResults.
References IG.Num.m.
|
inlinevirtual |
Allocates space for the specified fucnction's Hessian.
which | Specifies which function it applies to (conting form 0). |
Implements IG.Num.IVectorFunctionResults.
References IG.Num.m.
|
inlinevirtual |
Sets all calculated flags to false, error code to 0 (no error) and error string to null.
Implements IG.Num.IVectorFunctionResults.
|
inlinevirtual |
Copies data from another vector function results.
res | Vector function results which data is copied from. |
Implements IG.Num.IVectorFunctionResults.
References IG.Num.IVectorFunctionResults.CalculatedGradients, IG.Num.IVectorFunctionResults.CalculatedHessians, IG.Num.IVectorFunctionResults.CalculatedValues, IG.Num.IVectorFunctionResults.ErrorCode, IG.Num.IVectorFunctionResults.ErrorString, IG.Num.IVectorFunctionResults.Gradients, IG.Num.IVectorFunctionResults.Hessians, IG.Num.IVectorFunctionResults.NumFunctions, IG.Num.IVectorFunctionResults.NumParameters, IG.Num.IVectorFunctionResults.Parameters, IG.Num.IVectorFunctionResults.ReqGradients, IG.Num.IVectorFunctionResults.ReqHessians, IG.Num.IVectorFunctionResults.ReqValues, and IG.Num.IVectorFunctionResults.Values.
|
inlinevirtual |
Returns an exact deep copy of the current object.
Implements IG.Num.IVectorFunctionResults.
References IG.Num.IVectorFunctionResults.Copy().
|
inline |
Referenced by IG.Num.LinearBasis.Example().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
getset |
Number of parameters.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain().
|
getset |
Number of functions.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain().
|
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.
|
getset |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain().
|
getset |
Function values. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
getset |
Function gradients. If CopyReferences=true (false by default) then only the list reference is copied in assignments.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
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.VectorFunctionResultsDto.CopyFromPlain().
|
getset |
Indicates whether calculation of functions is/was requested.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain(), and IG.Num.LinearBasis.Example().
|
getset |
Indicates whether calculation of function gradients is/was requested.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain(), and IG.Num.LinearBasis.Example().
|
getset |
Indicates whether calculation of functions' Hessians is/was requested.
Referenced by IG.Num.VectorFunctionRequestDTO.CopyFromPlain(), and IG.Num.LinearBasis.Example().
|
getset |
Error code. 0 - everything is OK. negative value - something went wrong.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
getset |
Error string indicating what went wrong.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
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.
|
getset |
Indicates whether calculation of functions is/was requested.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
getset |
Indicates whether calculation of functions' gradients is/was requested.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().
|
getset |
Indicates whether calculation of functions' Hessian is/was requested.
Referenced by IG.Num.VectorFunctionResultsDto.CopyFromPlain().