IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Evaluation of penalty functions. More...
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... | |
![]() | |
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... | |
![]() | |
object | Lock [get] |
Evaluation of penalty functions.
$A Igor Jul10;
|
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.
|
inline |
Constructs penalty evaluator with penalty function (common for all constraints) initialized to the default penalty function with specified characteristic barrier length and height.
barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height. |
barrierHeight | Characteristic barrier height. |
|
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.
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. |
|
inlineprotectedvirtual |
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.
barrierLength | Characteristic barrrier length. Within this length the created penalty function grows approximately from 0 to characteristic height. |
barrierHeight | Characteristic height. |
References IG.Num.Func.GetPenaltyPower().
|
inlineprotectedvirtual |
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.
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. |
References IG.Num.Func.GetPenaltyPower().
|
inline |
Sets the penalty function used for evaluation of the specified penalty term.
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.
|
inline |
Sets the penalty function used for evaluation of the specified penalty term.
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.
|
inline |
Sets the penalty function used for evaluation of the specified penalty term.
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.
|
inlinevirtual |
Returns a flag that tells whether characteristic barrier length can be set for the penalty function of the specified constraint.
which | Specified the constraiint in question. |
Implements IG.Num.IPenaltyEvaluator.
References IG.Num.IRealFunctionPenalty.CanSetBarrierLength.
|
inlinevirtual |
Returns a flag that tells whether characteristic barrier height can be set for the penalty function of the specified constraint.
which | Specified the constraiint in question. |
Implements IG.Num.IPenaltyEvaluator.
References IG.Num.IRealFunctionPenalty.CanSetBarrierHeight.
|
inlinevirtual |
Returns a flag that tells whether maxmal argument where function is zero can be set for the penalty function of the specified constraint.
which | Specified the constraiint in question. |
Implements IG.Num.IPenaltyEvaluator.
References IG.Num.IRealFunctionPenalty.CanSetMaxZero.
|
inline |
Adds a new penalty function for evaluation of penalty terms to the list.
func | Function to be added. |
Implements IG.Num.IPenaltyEvaluator.
|
inline |
Returns penalty function corresonding to the specified constraint.
which | Index of penalty function (or the corresponding constraint). |
Implements IG.Num.IPenaltyEvaluator.
|
inline |
Returns true if the penalty function value can be calculated for the specified constraint, or false otherwise.
which | Specifies the constraint in question. |
Implements IG.Num.IPenaltyEvaluator.
|
inline |
Returns true if the penalty function derivative can be calculated for the specified constraint, or false otherwise.
which | Specifies the constraint in question. |
Implements IG.Num.IPenaltyEvaluator.
|
inline |
Returns true if the penalty function's second can be calculated for the specified constraint, or false otherwise.
which | Specifies the constraint in question. |
Implements IG.Num.IPenaltyEvaluator.
|
inline |
Returns value of the penalty function for the specified constraint at the specified value of the corresponding constraint function.
which | Specifies the constraint in question. |
constraintFunctionValue | Value of constraint function. |
Implements IG.Num.IPenaltyEvaluator.
|
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.
which | Specifies the constraint in question. |
constraintFunctionValue | Value of constraint function. |
Implements IG.Num.IPenaltyEvaluator.
|
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.
which | Specifies the constraint in question. |
constraintFunctionValue | Value of constraint function. |
Implements IG.Num.IPenaltyEvaluator.
|
protected |
|
protected |
|
protected |
|
get |
Object used for thread locking the current object.
|
getset |
Whether a single function can be used for evaluating penalty terms corresponding to different constraints.
|
get |
Returns a list of penalty functions used to evaluate penalty terms.