| 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 Member Functions | Protected Attributes | Properties | List of all members
IG.Num.PenaltyEvaluator Class Reference

Evaluation of penalty functions. More...

Inheritance diagram for IG.Num.PenaltyEvaluator:
[legend]
Collaboration diagram for IG.Num.PenaltyEvaluator:
[legend]

## Public Member Functions
| PenaltyEvaluator ()
| Constructs non-initialized penalty evaluator (wihout any penlaty functions). WARNING: Crated penalty evaluator is not initialized and can not be used for evaluation of penalty terms right away. More...
| PenaltyEvaluator (double barrierLength, double barrierHeight)
| Constructs penalty evaluator with penalty function (common for all constraints) initialized to the default penalty function with specified characteristic barrier length and height. More...
| PenaltyEvaluator (double barrierLength, double barrierHeight, double maxZero)
| Construct penalty evaluator with penalty function (common for all constraints) initialized to the default penalty function with specified characteristic barrier length and height and transition point where penalty function becomes non-zero. More...
void | SetPenaltyFunction (int which, IRealFunctionPenalty function)
| Sets the penalty function used for evaluation of the specified penalty term. More...
void | SetPenaltyFunction (int which, double barrierLength, double barrierHeight)
| Sets the penalty function used for evaluation of the specified penalty term. More...
void | SetPenaltyFunction (int which, double barrierLength, double barrierHeight, double zeroEnd)
| Sets the penalty function used for evaluation of the specified penalty term. More...
virtual bool | CanSetBarrierLength (int which)
| Returns a flag that tells whether characteristic barrier length can be set for the penalty function of the specified constraint. More...
virtual bool | CansetBarrierHeight (int which)
| Returns a flag that tells whether characteristic barrier height can be set for the penalty function of the specified constraint. More...
virtual bool | CanSetMaxZero (int which)
| Returns a flag that tells whether maxmal argument where function is zero can be set for the penalty function of the specified constraint. More...
int | AddPenaltyFunction (IRealFunctionPenalty func)
| Adds a new penalty function for evaluation of penalty terms to the list. More...
IRealFunctionPenalty | GetPenaltyFunction (int which)
| Returns penalty function corresonding to the specified constraint. More...
bool | IsPenaltyValueDefined (int which)
| Returns true if the penalty function value can be calculated for the specified constraint, or false otherwise. More...
bool | IsPenaltyDerivativeDefined (int which)
| Returns true if the penalty function derivative can be calculated for the specified constraint, or false otherwise. More...
bool | IsPenaltySecodDerivativeDefined (int which)
| Returns true if the penalty function's second can be calculated for the specified constraint, or false otherwise. More...
double | PenaltyValue (int which, double constraintFunctionValue)
| Returns value of the penalty function for the specified constraint at the specified value of the corresponding constraint function. More...
double | PenaltyDerivative (int which, double constraintFunctionValue)
| Returns derivative of the penalty function for the specified constraint at the specified value of the corresponding constraint function, with respect to constraint value. More...
double | PenaltySecondDerivative (int which, double constraintFunctionValue)
| Returns second derivative of the penalty function for the specified constraint at the specified value of the corresponding constraint function, with respect to constraint value. More...

## Protected Member Functions
virtual IRealFunctionPenalty | CreatePenaltyFunction (double barrierLength, double barrierHeight)
| Creates a new penalty function with the specified characteristic length and height. Created function is power penalty function of power 3. This is used in order to create default penalty functions for this class, such that one does not need to create penalty functions explicitly. Subclasses can (should) override this method in orde to change the type of default penalty function. More...
virtual IRealFunctionPenalty | CreatePenaltyFunction (double barrierLength, double barrierHeight, double zeroEnd, int power)
| Creates a new penalty function with the specified characteristic length and height. Created function is power penalty function of power 3. This is used in order to create default penalty functions for this class, such that one does not need to create penalty functions explicitly. Subclasses can (should) override this method in orde to change the type of default penalty function. More...

## Protected Attributes
object | _lock = new object()
bool | _allowSingleFunction = true
List< IRealFunctionPenalty > | _penaltyFunctions = null

## Properties
object | Lock`[get]`
| Object used for thread locking the current object. More...
bool | AllowSingleFunction`[get, set]`
| Whether a single function can be used for evaluating penalty terms corresponding to different constraints. More...
List< IRealFunctionPenalty > | PenaltyFunctions`[get]`
| Returns a list of penalty functions used to evaluate penalty terms. More...
Properties inherited from IG.Num.IPenaltyEvaluator
bool | AllowSingleFunction`[get, set]`
| Whether a single function can be used for evaluating penalty terms corresponding to different constraints. More...
List< IRealFunctionPenalty > | PenaltyFunctions`[get]`
| Returns a list of penalty functions used to evaluate penalty terms. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Detailed Description

Evaluation of penalty functions.

$A Igor Jul10;

## Constructor & Destructor Documentation

IG.Num.PenaltyEvaluator.PenaltyEvaluator | ( |  | ) |
| inline

Constructs non-initialized penalty evaluator (wihout any penlaty functions). WARNING: Crated penalty evaluator is not initialized and can not be used for evaluation of penalty terms right away.

IG.Num.PenaltyEvaluator.PenaltyEvaluator | ( | double | barrierLength,
|  | double | barrierHeight
| ) |  |
| inline

Constructs penalty evaluator with penalty function (common for all constraints) initialized to the default penalty function with specified characteristic barrier length and height.

Parameters

  barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height.
  barrierHeight | Characteristic barrier height.

IG.Num.PenaltyEvaluator.PenaltyEvaluator | ( | double | barrierLength,
|  | double | barrierHeight,
|  | double | maxZero
| ) |  |
| inline

Construct penalty evaluator with penalty function (common for all constraints) initialized to the default penalty function with specified characteristic barrier length and height and transition point where penalty function becomes non-zero.

Parameters

  barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height.
  barrierHeight | Characteristic barrier height.
  maxZero | Maximal argument for which the created function is 0.

## Member Function Documentation

virtual IRealFunctionPenalty IG.Num.PenaltyEvaluator.CreatePenaltyFunction | ( | double | barrierLength,
|  | double | barrierHeight
| ) |  |
| inline protected virtual

Creates a new penalty function with the specified characteristic length and height. Created function is power penalty function of power 3. This is used in order to create default penalty functions for this class, such that one does not need to create penalty functions explicitly. Subclasses can (should) override this method in orde to change the type of default penalty function.

Parameters

  barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height.
  barrierHeight | Characteristic height.

Returns
  Created penalty function.

References IG.Num.Func.GetPenaltyPower().

virtual IRealFunctionPenalty IG.Num.PenaltyEvaluator.CreatePenaltyFunction | ( | double | barrierLength,
|  | double | barrierHeight,
|  | double | zeroEnd,
|  | int | power
| ) |  |
| inline protected virtual

Creates a new penalty function with the specified characteristic length and height. Created function is power penalty function of power 3. This is used in order to create default penalty functions for this class, such that one does not need to create penalty functions explicitly. Subclasses can (should) override this method in orde to change the type of default penalty function.

Parameters

  barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height.
  barrierHeight | Characteristic height.
  zeroEnd | Maximal argument for which the created function is 0.
  power | Power. Must be greater than 0. For 2 first derivative is continuous in transition points, for 3 second derivative is also continuous, etc.

Returns
  Created penalty function.

References IG.Num.Func.GetPenaltyPower().

void IG.Num.PenaltyEvaluator.SetPenaltyFunction | ( | int | which,
|  | IRealFunctionPenalty | function
| ) |  |
| inline

Sets the penalty function used for evaluation of the specified penalty term.

Parameters

  which | Specifies which conatraint the penalty function applies to (zero based). In order to use one penalty function for all constraints, just set the penalty function with index 0.
  function | Function to be used for evaluation of the specified penalty term.

Implements IG.Num.IPenaltyEvaluator.

void IG.Num.PenaltyEvaluator.SetPenaltyFunction | ( | int | which,
|  | double | barrierLength,
|  | double | barrierHeight
| ) |  |
| inline

Sets the penalty function used for evaluation of the specified penalty term.

Parameters

  which | Specifies which conatraint the penalty function applies to (zero based). In order to use one penalty function for all constraints, just set the penalty function with index 0.
  barrierLength | Characteristic barrier length of the created function. This is the length at which function grows from approximately 0 to characteristic height.
  barrierHeight | Characteristic barrier height of the created function.

Implements IG.Num.IPenaltyEvaluator.

References IG.Num.IRealFunctionPenalty.BarrierHeight, IG.Num.IRealFunctionPenalty.BarrierLength, IG.Num.IRealFunctionPenalty.CanSetBarrierHeight, and IG.Num.IRealFunctionPenalty.CanSetBarrierLength.

void IG.Num.PenaltyEvaluator.SetPenaltyFunction | ( | int | which,
|  | double | barrierLength,
|  | double | barrierHeight,
|  | double | zeroEnd
| ) |  |
| inline

Sets the penalty function used for evaluation of the specified penalty term.

Parameters

  which | Specifies which conatraint the penalty function applies to (zero based). In order to use one penalty function for all constraints, just set the penalty function with index 0.
  barrierLength | Characteristic barrier length of the created function. This is the length at which function grows from approximately 0 to characteristic height.
  barrierHeight | Characteristic barrier height of the created function.
  zeroEnd | Maximal argumet for which penalty function is still 0.

Implements IG.Num.IPenaltyEvaluator.

References IG.Num.IRealFunctionPenalty.BarrierHeight, IG.Num.IRealFunctionPenalty.BarrierLength, IG.Num.IRealFunctionPenalty.CanSetBarrierHeight, IG.Num.IRealFunctionPenalty.CanSetBarrierLength, IG.Num.IRealFunctionPenalty.CanSetMaxZero, and IG.Num.IRealFunctionPenalty.MaxZero.

virtual bool IG.Num.PenaltyEvaluator.CanSetBarrierLength | ( | int | which | ) |
| inline virtual

Returns a flag that tells whether characteristic barrier length can be set for the penalty function of the specified constraint.

Parameters

  which | Specified the constraiint in question.

Implements IG.Num.IPenaltyEvaluator.

References IG.Num.IRealFunctionPenalty.CanSetBarrierLength.

virtual bool IG.Num.PenaltyEvaluator.CansetBarrierHeight | ( | int | which | ) |
| inline virtual

Returns a flag that tells whether characteristic barrier height can be set for the penalty function of the specified constraint.

Parameters

  which | Specified the constraiint in question.

Implements IG.Num.IPenaltyEvaluator.

References IG.Num.IRealFunctionPenalty.CanSetBarrierHeight.

virtual bool IG.Num.PenaltyEvaluator.CanSetMaxZero | ( | int | which | ) |
| inline virtual

Returns a flag that tells whether maxmal argument where function is zero can be set for the penalty function of the specified constraint.

Parameters

  which | Specified the constraiint in question.

Implements IG.Num.IPenaltyEvaluator.

References IG.Num.IRealFunctionPenalty.CanSetMaxZero.

int IG.Num.PenaltyEvaluator.AddPenaltyFunction | ( | IRealFunctionPenalty | func | ) |
| inline

Adds a new penalty function for evaluation of penalty terms to the list.

Parameters

  func | Function to be added.

Returns
  Index of the added penalty function (0 if this is the first function on the list).

Implements IG.Num.IPenaltyEvaluator.

IRealFunctionPenalty IG.Num.PenaltyEvaluator.GetPenaltyFunction | ( | int | which | ) |
| inline

Returns penalty function corresonding to the specified constraint.

Parameters

  which | Index of penalty function (or the corresponding constraint).

Implements IG.Num.IPenaltyEvaluator.

bool IG.Num.PenaltyEvaluator.IsPenaltyValueDefined | ( | int | which | ) |
| inline

Returns true if the penalty function value can be calculated for the specified constraint, or false otherwise.

Parameters

  which | Specifies the constraint in question.

Implements IG.Num.IPenaltyEvaluator.

bool IG.Num.PenaltyEvaluator.IsPenaltyDerivativeDefined | ( | int | which | ) |
| inline

Returns true if the penalty function derivative can be calculated for the specified constraint, or false otherwise.

Parameters

  which | Specifies the constraint in question.

Implements IG.Num.IPenaltyEvaluator.

bool IG.Num.PenaltyEvaluator.IsPenaltySecodDerivativeDefined | ( | int | which | ) |
| inline

Returns true if the penalty function's second can be calculated for the specified constraint, or false otherwise.

Parameters

  which | Specifies the constraint in question.

Implements IG.Num.IPenaltyEvaluator.

double IG.Num.PenaltyEvaluator.PenaltyValue | ( | int | which,
|  | double | constraintFunctionValue
| ) |  |
| inline

Returns value of the penalty function for the specified constraint at the specified value of the corresponding constraint function.

Parameters

  which | Specifies the constraint in question.
  constraintFunctionValue | Value of constraint function.

Implements IG.Num.IPenaltyEvaluator.

double IG.Num.PenaltyEvaluator.PenaltyDerivative | ( | int | which,
|  | double | constraintFunctionValue
| ) |  |
| inline

Returns derivative of the penalty function for the specified constraint at the specified value of the corresponding constraint function, with respect to constraint value.

Parameters

  which | Specifies the constraint in question.
  constraintFunctionValue | Value of constraint function.

Implements IG.Num.IPenaltyEvaluator.

double IG.Num.PenaltyEvaluator.PenaltySecondDerivative | ( | int | which,
|  | double | constraintFunctionValue
| ) |  |
| inline

Returns second derivative of the penalty function for the specified constraint at the specified value of the corresponding constraint function, with respect to constraint value.

Parameters

  which | Specifies the constraint in question.
  constraintFunctionValue | Value of constraint function.

Implements IG.Num.IPenaltyEvaluator.

## Member Data Documentation

object IG.Num.PenaltyEvaluator._lock = new object()
| protected

bool IG.Num.PenaltyEvaluator._allowSingleFunction = true
| protected

List<IRealFunctionPenalty> IG.Num.PenaltyEvaluator._penaltyFunctions = null
| protected

## Property Documentation

object IG.Num.PenaltyEvaluator.Lock
| get

Object used for thread locking the current object.

bool IG.Num.PenaltyEvaluator.AllowSingleFunction
| get set

Whether a single function can be used for evaluating penalty terms corresponding to different constraints.

List<IRealFunctionPenalty> IG.Num.PenaltyEvaluator.PenaltyFunctions
| get

Returns a list of penalty functions used to evaluate penalty terms.

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

- igbase/optimization/AnalysisResults.cs