A Penalty Function for a MinlpProblem. More...
#include <problem.h>
Public Member Functions | |
MinlpPenaltyFunc (Pointer< MinlpProblem > minlp_, Pointer< Param > penalty_param=NULL) | |
Constructor for a MinlpProblem. | |
double | eval (const UserVector< double > &x) const |
Evaluates the penalty function for a UserVector<double>. | |
int | valgrad (double &val, UserVector< double > &y, const UserVector< double > &x) const |
Computes the value and the gradient of this penalty function. | |
void | grad (UserVector< double > &y, const UserVector< double > &x) const |
Computes the gradient of this penalty function. | |
void | HessMult (UserVector< double > &y, const UserVector< double > &z, const UserVector< double > &x) const |
Computes the product of the hessian of this matrix and a UserVector<double>. | |
virtual void | set_curvature (CurvatureType ct) |
virtual CurvatureType | get_curvature () const |
void | print (ostream &out) const |
Prints some information about this function. | |
Public Attributes | |
dvector | delta |
The vector of delta-values. | |
Private Attributes | |
Pointer< MinlpProblem > | minlp |
The MinlpProblem. |
A Penalty Function for a MinlpProblem.
The function has the form
Definition at line 327 of file problem.h.
MinlpPenaltyFunc::MinlpPenaltyFunc | ( | Pointer< MinlpProblem > | minlp_, | |
Pointer< Param > | penalty_param = NULL | |||
) | [inline] |
Constructor for a MinlpProblem.
Sets the delta-values to 1000.
minlp_ | The MinlpProblem, which PenaltyFunc should be represented. | |
penalty_param | The delta-values for penalty of each constraints as parameters, default is "penaltyfunc.res". |
double MinlpPenaltyFunc::eval | ( | const UserVector< double > & | x | ) | const [virtual] |
Evaluates the penalty function for a UserVector<double>.
x | The UserVector<double> to compute the value for. |
Implements Func.
int MinlpPenaltyFunc::valgrad | ( | double & | val, | |
UserVector< double > & | y, | |||
const UserVector< double > & | x | |||
) | const [virtual] |
Computes the value and the gradient of this penalty function.
The gradient of the absolut of an equality constraint is handled as zero, if the gradient of the equality constraint is zero.
val | A double to store the value in. | |
y | A UserVector<double> to store the gradient in. | |
x | The UserVector<double> to compute. |
Reimplemented from Func.
void MinlpPenaltyFunc::grad | ( | UserVector< double > & | y, | |
const UserVector< double > & | x | |||
) | const [virtual] |
Computes the gradient of this penalty function.
Calls valgrad(double&, UserVector<double>&, const UserVector<double>&).
y | The UserVector<double> to store the gradient in. | |
x | The UserVector<double> to compute. |
Implements Func.
void MinlpPenaltyFunc::HessMult | ( | UserVector< double > & | y, | |
const UserVector< double > & | z, | |||
const UserVector< double > & | x | |||
) | const [virtual] |
Computes the product of the hessian of this matrix and a UserVector<double>.
y | The UserVector<double> to store the result in. | |
z | The UserVector<double> to compute the hessian for. | |
x | The UserVector<double> to multiply with the hessian. |
Implements Func.
virtual void MinlpPenaltyFunc::set_curvature | ( | CurvatureType | ct | ) | [inline, virtual] |
virtual CurvatureType MinlpPenaltyFunc::get_curvature | ( | ) | const [inline, virtual] |
void MinlpPenaltyFunc::print | ( | ostream & | out | ) | const [inline, virtual] |
Pointer<MinlpProblem> MinlpPenaltyFunc::minlp [private] |
The MinlpProblem.