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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Attributes | Properties | List of all members
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:
[legend]
Collaboration diagram for IG.Num.ScalarFunctionResults:
[legend]

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

  reqGradients | Whether 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

  numParameters | Number of parameters.

IG.Num.ScalarFunctionResults.ScalarFunctionResults | ( | int | numParameters,
|  | bool | reqGradients
| ) |  |
| inline

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

Parameters

  numParameters | Number of parameters.
  reqGradients | Whether gradients are requested.

## Member Function Documentation

virtual IVector IG.Num.ScalarFunctionResults.GetParameters | ( |  | ) |
| inline virtual

Returns vector of optimization parameters.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetParameters | ( | IVector | value | ) |
| inline virtual

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

Parameters

  value | Value to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetParametersReference | ( | IVector | reference | ) |
| inline virtual

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

Parameters

  reference | Vector reference to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetParameter | ( | int | index | ) |
| inline virtual

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

Parameters

  index | Index of parameter to be returned (counting from 0).

Implements IG.Num.IScalarFunctionResults.

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

Sets the specified optimization parameter.

Parameters

  index | Index of parameter to be set (counting from 0).
  value | Parameter value.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetValue | ( |  | ) |
| inline virtual

Returns the value of the function.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetValue | ( | double | value | ) |
| inline virtual

Sets the value of the function.

Parameters

  value | Value to be assigned to the objective function.

Implements IG.Num.IScalarFunctionResults.

virtual IVector IG.Num.ScalarFunctionResults.GetGradient | ( |  | ) |
| inline virtual

Returns the function gradient.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetGradient | ( | IVector | value | ) |
| inline virtual

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

Parameters

  value | Value to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetGradientReference | ( | IVector | reference | ) |
| inline virtual

Sets the function gradient. Only the reference is copied.

Parameters

  reference | Reference to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual double IG.Num.ScalarFunctionResults.GetGradient | ( | int | index | ) |
| inline virtual

Returns the specified component of the function gradient.

Parameters

  index | Index of the component.

Implements IG.Num.IScalarFunctionResults.

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

Sets the specified component of the function gradient.

Parameters

  index | Index of gradient component to be set.
  value | Value of the gradient component.

Implements IG.Num.IScalarFunctionResults.

virtual IMatrix IG.Num.ScalarFunctionResults.GetHessian | ( |  | ) |
| inline virtual

Returns the function's Hessian.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetHessian | ( | IMatrix | value | ) |
| inline virtual

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

Parameters

  value | Value to be assigned.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.SetHessianReference | ( | IMatrix | reference | ) |
| inline virtual

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

Parameters

  reference | Reference to be assigned.

Implements IG.Num.IScalarFunctionResults.

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

Returns the specified component of the function's Hessian.

Parameters

  rowIndex | Row index of the component (counting from 0).
  columnIndex | Column index of the component (counting from 0).

Implements IG.Num.IScalarFunctionResults.

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

Sets the specified component of the function's Hessian.

Parameters

  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.

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

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

virtual void IG.Num.ScalarFunctionResults.AllocateParameters | ( |  | ) |
| inline virtual

Allocates space for parameters.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateRequested | ( |  | ) |
| inline virtual

Allocates space for all requested result objects.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateGradient | ( |  | ) |
| inline virtual

Allocate space for function gradient.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.AllocateHessian | ( |  | ) |
| inline virtual

Allocates space for function Hessian.

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.ResetResults | ( |  | ) |
| inline virtual

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

Implements IG.Num.IScalarFunctionResults.

virtual void IG.Num.ScalarFunctionResults.Copy | ( | IScalarFunctionResults | results | ) |
| inline virtual

Copies data from another analysis results.

Parameters

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

virtual IScalarFunctionResults IG.Num.ScalarFunctionResults.GetCopy | ( |  | ) |
| inline virtual

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
| get set

Number of parameters.

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

virtual IVector IG.Num.ScalarFunctionResults.Parameters
| get set

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

virtual double IG.Num.ScalarFunctionResults.Value
| get set

Value of the function.

virtual IVector IG.Num.ScalarFunctionResults.Gradient
| get set

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

virtual IMatrix IG.Num.ScalarFunctionResults.Hessian
| get set

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
| get set

Indicates whether calculation of function value is/was requested.

virtual bool IG.Num.ScalarFunctionResults.ReqGradient
| get set

Indicates whether calculation of function gradient is/was requested.

virtual bool IG.Num.ScalarFunctionResults.ReqHessian
| get set

Indicates whether calculation of function Hessian is/was requested.

virtual int IG.Num.ScalarFunctionResults.ErrorCode
| get set

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

virtual String IG.Num.ScalarFunctionResults.ErrorString
| get set

Error string indicating what went wrong.

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

Indicates whether calculation of function value is/was requested.

virtual bool IG.Num.ScalarFunctionResults.CalculatedGradient
| get set

Indicates whether calculation of function gradient is/was requested.

virtual bool IG.Num.ScalarFunctionResults.CalculatedHessian
| get set

Indicates whether calculation of function Hessian is/was requested.

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

- igbase/numeric/FunctionScalarResults.cs