IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Storage for results of a scalar function. Includes parameters at which function was (or should be) evaluated, flags specifying what has been and what should be evaluated, calculated value, gradient and Hessian of the function in the specified point. More...
Public Member Functions | |
ScalarFunctionResults () | |
1 parameter, no constraints, 1 objective function. No gradients required More... | |
ScalarFunctionResults (bool reqGradients) | |
1 parameter, no constraints, 1 objective function. More... | |
ScalarFunctionResults (int numParameters) | |
Specified number of parameters, 1 objective, no constraints. No gradients required. More... | |
ScalarFunctionResults (int numParameters, bool reqGradients) | |
Specified number of parameters, 1 objective, no constraints. 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 double | GetValue () |
Returns the value of the function. More... | |
virtual void | SetValue (double value) |
Sets the value of the function. More... | |
virtual IVector | GetGradient () |
Returns the function gradient. More... | |
virtual void | SetGradient (IVector value) |
Sets the function gradient. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetGradientReference (IVector reference) |
Sets the function gradient. Only the reference is copied. More... | |
virtual double | GetGradient (int index) |
Returns the specified component of the function gradient. More... | |
virtual void | SetGradient (int index, double value) |
Sets the specified component of the function gradient. More... | |
virtual IMatrix | GetHessian () |
Returns the function's Hessian. More... | |
virtual void | SetHessian (IMatrix value) |
Sets the functions' Hessian. If CopyReferences=true (false by default) then only the reference is copied. More... | |
virtual void | SetHessianReference (IMatrix reference) |
Sets the functions' Hessian. Only the reference is copied. More... | |
virtual double | GetHessian (int rowIndex, int columnIndex) |
Returns the specified component of the function's Hessian. More... | |
virtual void | SetHessian (int rowIndex, int columnIndex, double value) |
Sets the specified component of the 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 | AllocateGradient () |
Allocate space for function gradient. More... | |
virtual void | AllocateHessian () |
Allocates space for function 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 (IScalarFunctionResults results) |
Copies data from another analysis results. More... | |
virtual IScalarFunctionResults | GetCopy () |
Returns an exact deep copy of the current object. More... | |
Protected Attributes | |
int | _numParameters = 1 |
IVector | _parameters |
double | _value |
IVector | _Gradient |
IMatrix | _Hessian |
bool | _copyReferences = false |
bool | _reqValue = true |
bool | _reqGradient = false |
bool | _reqHessian = false |
int | _errorCode = 0 |
string | _errorString = null |
bool | _calcValue = false |
bool | _calcGradient = false |
bool | _calcHessian = false |
int | _numObjectives = 1 |
int | _numConstraints = 0 |
int | _numEqualityConstraints = 0 |
List< double > | _constraints |
List< IVector > | _constraintGradients |
List< IMatrix > | _constraintHessians |
bool | _reqConstraints = true |
bool | _reqConstraintGradients = false |
bool | _reqConstraintHessians = false |
bool | _calcConstraints = false |
bool | _calcConstraintGradients = false |
bool | _calcConstraintHessians = false |
Properties | |
virtual int | NumParameters [get, set] |
Number of parameters. More... | |
virtual bool | CopyReferences [get, set] |
Indicates whether just references can be copied when setting function parameters or results. If false then deep copy is always 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 double | Value [get, set] |
Value of the function. More... | |
virtual IVector | Gradient [get, set] |
Function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
virtual IMatrix | Hessian [get, set] |
Function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
virtual bool | ReqValue [get, set] |
Indicates whether calculation of function value is/was requested. More... | |
virtual bool | ReqGradient [get, set] |
Indicates whether calculation of function gradient is/was requested. More... | |
virtual bool | ReqHessian [get, set] |
Indicates whether calculation of function Hessian 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 | CalculatedValue [get, set] |
Indicates whether calculation of function value is/was requested. More... | |
virtual bool | CalculatedGradient [get, set] |
Indicates whether calculation of function gradient is/was requested. More... | |
virtual bool | CalculatedHessian [get, set] |
Indicates whether calculation of function Hessian is/was requested. More... | |
Properties inherited from IG.Num.IScalarFunctionResults | |
int | NumParameters [get, set] |
Number of parameters. More... | |
bool | CopyReferences [get, set] |
Indicates whether just references can be copied when setting function 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... | |
double | Value [get, set] |
Value of the function. More... | |
IVector | Gradient [get, set] |
Function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
IMatrix | Hessian [get, set] |
Function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments. More... | |
bool | ReqValue [get, set] |
Indicates whether calculation of function value is/was requested. More... | |
bool | ReqGradient [get, set] |
Indicates whether calculation of function gradient is/was requested. More... | |
bool | ReqHessian [get, set] |
Indicates whether calculation of function 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 | CalculatedValue [get, set] |
Indicates whether calculation of function value is/was requested. More... | |
bool | CalculatedGradient [get, set] |
Indicates whether calculation of function gradient is/was requested. More... | |
bool | CalculatedHessian [get, set] |
Indicates whether calculation of function Hessian is/was requested. More... | |
Storage for results of a scalar function. Includes parameters at which function was (or should be) evaluated, flags specifying what has been and what should be evaluated, calculated value, gradient and Hessian of the function in the specified point.
$A Igor xx Dec09 Nov10;
|
inline |
1 parameter, no constraints, 1 objective function. No gradients required
|
inline |
1 parameter, no constraints, 1 objective function.
reqGradients | Whether gradient of the objective function is required. |
|
inline |
Specified number of parameters, 1 objective, no constraints. No gradients required.
numParameters | Number of parameters. |
|
inline |
Specified number of parameters, 1 objective, no constraints. No gradients required.
numParameters | Number of parameters. |
reqGradients | Whether gradients are requested. |
|
inlinevirtual |
Returns vector of optimization parameters.
Implements IG.Num.IScalarFunctionResults.
|
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.IScalarFunctionResults.
|
inlinevirtual |
Sets the vector of optimization parameters. Only the reference is copied.
reference | Vector reference to be assigned. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns specific optimization parameter. Throws exception if not defined or index out of bounds.
index | Index of parameter to be returned (counting from 0). |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the specified optimization parameter.
index | Index of parameter to be set (counting from 0). |
value | Parameter value. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns the value of the function.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the value of the function.
value | Value to be assigned to the objective function. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns the function gradient.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the function gradient. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the function gradient. Only the reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns the specified component of the function gradient.
index | Index of the component. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the specified component of the function gradient.
index | Index of gradient component to be set. |
value | Value of the gradient component. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns the function's Hessian.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the functions' Hessian. If CopyReferences=true (false by default) then only the reference is copied.
value | Value to be assigned. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the functions' Hessian. Only the reference is copied.
reference | Reference to be assigned. |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Returns the specified component of the function's Hessian.
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets the specified component of the function's Hessian.
rowIndex | Row index of the component (counting from 0). |
columnIndex | Column index of the component (counting from 0). |
value | Value to be assigned to Hessian. |
Implements IG.Num.IScalarFunctionResults.
|
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.IScalarFunctionResults.
|
inlinevirtual |
Sets all result objects to null. If the references are not assigned elsewhere, these objects become eligible for garbage collection.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Allocates space for parameters.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Allocates space for all requested result objects.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Allocate space for function gradient.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Allocates space for function Hessian.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Sets all calculated flags to false, error code to 0 (no error) and error string to null.
Implements IG.Num.IScalarFunctionResults.
|
inlinevirtual |
Copies data from another analysis results.
results | Analysis results which data is copied from. |
Implements IG.Num.IScalarFunctionResults.
References IG.Num.IScalarFunctionResults.CalculatedGradient, IG.Num.IScalarFunctionResults.CalculatedHessian, IG.Num.IScalarFunctionResults.CalculatedValue, IG.Num.IScalarFunctionResults.ErrorCode, IG.Num.IScalarFunctionResults.ErrorString, IG.Num.IScalarFunctionResults.Gradient, IG.Num.IScalarFunctionResults.Hessian, IG.Num.IScalarFunctionResults.NumParameters, IG.Num.IScalarFunctionResults.Parameters, IG.Num.IScalarFunctionResults.ReqGradient, IG.Num.IScalarFunctionResults.ReqHessian, IG.Num.IScalarFunctionResults.ReqValue, and IG.Num.IScalarFunctionResults.Value.
Referenced by IG.Num.ScalarFunctionResults.GetCopy().
|
inlinevirtual |
Returns an exact deep copy of the current object.
Implements IG.Num.IScalarFunctionResults.
References IG.Num.ScalarFunctionResults.Copy().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
getset |
Number of parameters.
|
getset |
Indicates whether just references can be copied when setting function parameters or results. If false then deep copy is always performed. Default is false.
|
getset |
Optimization parameters. If CopyReferences=true (false by default) then only the reference is copied when assigning.
|
getset |
Value of the function.
|
getset |
Function gradient. If CopyReferences=true (false by default) then only the reference is copied in assignments.
|
getset |
Function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments.
|
getset |
Indicates whether calculation of function value is/was requested.
|
getset |
Indicates whether calculation of function gradient is/was requested.
|
getset |
Indicates whether calculation of function Hessian is/was requested.
|
getset |
Error code. 0 - everything is OK. negative value - something went wrong.
|
getset |
Error string indicating what went wrong.
|
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 function value is/was requested.
|
getset |
Indicates whether calculation of function gradient is/was requested.
|
getset |
Indicates whether calculation of function Hessian is/was requested.