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

- Main Page
- Namespaces
- Classes
- Files
- Directories

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

Public Member Functions | Protected Member Functions | Protected Attributes | Properties

# IG::Num::PenaltyEvaluator Class Reference

Evaluation of penalty functions. More...

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

List of all members.

## 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.
| 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.
| 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.
void | SetPenaltyFunction (int which, IRealFunctionPenalty function)
| Sets the penalty function used for evaluation of the specified penalty term.
void | SetPenaltyFunction (int which, double barrierLength, double barrierHeight)
| Sets the penalty function used for evaluation of the specified penalty term.
void | SetPenaltyFunction (int which, double barrierLength, double barrierHeight, double zeroEnd)
| Sets the penalty function used for evaluation of the specified penalty term.
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.
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.
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.
int | AddPenaltyFunction (IRealFunctionPenalty func)
| Adds a new penalty function for evaluation of penalty terms to the list.
IRealFunctionPenalty | GetPenaltyFunction (int which)
| Returns penalty function corresonding to the specified constraint.
bool | IsPenaltyValueDefined (int which)
| Returns true if the penalty function value can be calculated for the specified constraint, or false otherwise.
bool | IsPenaltyDerivativeDefined (int which)
| Returns true if the penalty function derivative can be calculated for the specified constraint, or false otherwise.
bool | IsPenaltySecodDerivativeDefined (int which)
| Returns true if the penalty function's second can be calculated for the specified constraint, or false otherwise.
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.
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.
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.
## 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.
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.
## 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.
bool | AllowSingleFunction`[get, set]`
| Whether a single function can be used for evaluating penalty terms corresponding to different constraints.
List< IRealFunctionPenalty > | PenaltyFunctions`[get]`
| Returns a list of penalty functions used to evaluate penalty terms.

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

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.

Returns:
  Created penalty function.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Implements IG::Lib::ILockable.

bool IG::Num::PenaltyEvaluator::AllowSingleFunction`[get, set]`

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

Implements IG::Num::IPenaltyEvaluator.

List<IRealFunctionPenalty> IG::Num::PenaltyEvaluator::PenaltyFunctions`[get]`

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

Implements IG::Num::IPenaltyEvaluator.

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

- AnalysisResults.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events