IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.ScalarFunctionResults Class Reference

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

+ Inheritance diagram for IG.Num.ScalarFunctionResults:
+ Collaboration diagram for IG.Num.ScalarFunctionResults:

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

Detailed Description

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;

Constructor & Destructor Documentation

IG.Num.ScalarFunctionResults.ScalarFunctionResults ( )
inline

1 parameter, no constraints, 1 objective function. No gradients required

IG.Num.ScalarFunctionResults.ScalarFunctionResults ( bool  reqGradients)
inline

1 parameter, no constraints, 1 objective function.

Parameters
reqGradientsWhether gradient of the objective function is required.
IG.Num.ScalarFunctionResults.ScalarFunctionResults ( int  numParameters)
inline

Specified number of parameters, 1 objective, no constraints. No gradients required.

Parameters
numParametersNumber of parameters.
IG.Num.ScalarFunctionResults.ScalarFunctionResults ( int  numParameters,
bool  reqGradients 
)
inline

Specified number of parameters, 1 objective, no constraints. No gradients required.

Parameters
numParametersNumber of parameters.
reqGradientsWhether gradients are requested.

Member Function Documentation

virtual IVector IG.Num.ScalarFunctionResults.GetParameters ( )
inlinevirtual

Returns vector of optimization parameters.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetParameters ( IVector  value)
inlinevirtual

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

virtual void IG.Num.ScalarFunctionResults.SetParametersReference ( IVector  reference)
inlinevirtual

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

Parameters
referenceVector reference to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetParameter ( int  index)
inlinevirtual

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

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

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetParameter ( int  index,
double  value 
)
inlinevirtual

Sets the specified optimization parameter.

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

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetValue ( )
inlinevirtual

Returns the value of the function.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetValue ( double  value)
inlinevirtual

Sets the value of the function.

Parameters
valueValue to be assigned to the objective function.

Implements IG.Num.IScalarFunctionResults.

virtual IVector IG.Num.ScalarFunctionResults.GetGradient ( )
inlinevirtual

Returns the function gradient.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetGradient ( IVector  value)
inlinevirtual

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

Parameters
valueValue to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetGradientReference ( IVector  reference)
inlinevirtual

Sets the function gradient. Only the reference is copied.

Parameters
referenceReference to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetGradient ( int  index)
inlinevirtual

Returns the specified component of the function gradient.

Parameters
indexIndex of the component.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetGradient ( int  index,
double  value 
)
inlinevirtual

Sets the specified component of the function gradient.

Parameters
indexIndex of gradient component to be set.
valueValue of the gradient component.

Implements IG.Num.IScalarFunctionResults.

virtual IMatrix IG.Num.ScalarFunctionResults.GetHessian ( )
inlinevirtual

Returns the function's Hessian.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetHessian ( IMatrix  value)
inlinevirtual

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

Parameters
valueValue to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetHessianReference ( IMatrix  reference)
inlinevirtual

Sets the functions' Hessian. Only the reference is copied.

Parameters
referenceReference to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetHessian ( int  rowIndex,
int  columnIndex 
)
inlinevirtual

Returns the specified component of the function's Hessian.

Parameters
rowIndexRow index of the component (counting from 0).
columnIndexColumn index of the component (counting from 0).

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetHessian ( int  rowIndex,
int  columnIndex,
double  value 
)
inlinevirtual

Sets the specified component of the function's Hessian.

Parameters
rowIndexRow index of the component (counting from 0).
columnIndexColumn index of the component (counting from 0).
valueValue to be assigned to Hessian.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.NullifyAll ( )
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.

virtual void IG.Num.ScalarFunctionResults.NullifyResults ( )
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.

virtual void IG.Num.ScalarFunctionResults.AllocateParameters ( )
inlinevirtual

Allocates space for parameters.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateRequested ( )
inlinevirtual

Allocates space for all requested result objects.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateGradient ( )
inlinevirtual

Allocate space for function gradient.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateHessian ( )
inlinevirtual

Allocates space for function Hessian.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.ResetResults ( )
inlinevirtual

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

Implements IG.Num.IScalarFunctionResults.

virtual IScalarFunctionResults IG.Num.ScalarFunctionResults.GetCopy ( )
inlinevirtual

Returns an exact deep copy of the current object.

Implements IG.Num.IScalarFunctionResults.

References IG.Num.ScalarFunctionResults.Copy().

Member Data Documentation

int IG.Num.ScalarFunctionResults._numParameters = 1
protected
IVector IG.Num.ScalarFunctionResults._parameters
protected
double IG.Num.ScalarFunctionResults._value
protected
IVector IG.Num.ScalarFunctionResults._Gradient
protected
IMatrix IG.Num.ScalarFunctionResults._Hessian
protected
bool IG.Num.ScalarFunctionResults._copyReferences = false
protected
bool IG.Num.ScalarFunctionResults._reqValue = true
protected
bool IG.Num.ScalarFunctionResults._reqGradient = false
protected
bool IG.Num.ScalarFunctionResults._reqHessian = false
protected
int IG.Num.ScalarFunctionResults._errorCode = 0
protected
string IG.Num.ScalarFunctionResults._errorString = null
protected
bool IG.Num.ScalarFunctionResults._calcValue = false
protected
bool IG.Num.ScalarFunctionResults._calcGradient = false
protected
bool IG.Num.ScalarFunctionResults._calcHessian = false
protected
int IG.Num.ScalarFunctionResults._numObjectives = 1
protected
int IG.Num.ScalarFunctionResults._numConstraints = 0
protected
int IG.Num.ScalarFunctionResults._numEqualityConstraints = 0
protected
List<double> IG.Num.ScalarFunctionResults._constraints
protected
List<IVector> IG.Num.ScalarFunctionResults._constraintGradients
protected
List<IMatrix> IG.Num.ScalarFunctionResults._constraintHessians
protected
bool IG.Num.ScalarFunctionResults._reqConstraints = true
protected
bool IG.Num.ScalarFunctionResults._reqConstraintGradients = false
protected
bool IG.Num.ScalarFunctionResults._reqConstraintHessians = false
protected
bool IG.Num.ScalarFunctionResults._calcConstraints = false
protected
bool IG.Num.ScalarFunctionResults._calcConstraintGradients = false
protected
bool IG.Num.ScalarFunctionResults._calcConstraintHessians = false
protected

Property Documentation

virtual int IG.Num.ScalarFunctionResults.NumParameters
getset

Number of parameters.

virtual bool IG.Num.ScalarFunctionResults.CopyReferences
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.

virtual IVector IG.Num.ScalarFunctionResults.Parameters
getset

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

virtual double IG.Num.ScalarFunctionResults.Value
getset

Value of the function.

virtual IVector IG.Num.ScalarFunctionResults.Gradient
getset

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

virtual IMatrix IG.Num.ScalarFunctionResults.Hessian
getset

Function Hessian (matrix of second derivatives). If CopyReferences=true (false by default) then only the reference is copied in assignments.

virtual bool IG.Num.ScalarFunctionResults.ReqValue
getset

Indicates whether calculation of function value is/was requested.

virtual bool IG.Num.ScalarFunctionResults.ReqGradient
getset

Indicates whether calculation of function gradient is/was requested.

virtual bool IG.Num.ScalarFunctionResults.ReqHessian
getset

Indicates whether calculation of function Hessian is/was requested.

virtual int IG.Num.ScalarFunctionResults.ErrorCode
getset

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

virtual String IG.Num.ScalarFunctionResults.ErrorString
getset

Error string indicating what went wrong.

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

virtual bool IG.Num.ScalarFunctionResults.CalculatedValue
getset

Indicates whether calculation of function value is/was requested.

virtual bool IG.Num.ScalarFunctionResults.CalculatedGradient
getset

Indicates whether calculation of function gradient is/was requested.

virtual bool IG.Num.ScalarFunctionResults.CalculatedHessian
getset

Indicates whether calculation of function Hessian is/was requested.


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