51 namespace ConstrainedOptPack {
54 : deriv_(0.0), mu_(0.0)
63 if(
this == &merit_func_l1)
66 this->
mu_ = merit_func_l1.
mu_;
84 if(max_viol_i) phi_val_h +=
mu_ * fabs(h_i - hlu_i);
86 return f + ( c ?
mu_ * c->norm_1() : 0.0) + phi_val_h;
95 ,
const std::string& L )
const
98 << L <<
"*** Define L1 merit funciton (assumes Gc_k'*d_k + c_k = 0):\n"
99 << L <<
"phi(f,c) = f + mu_k*( norm(c,1) + max_viol( hl <= h <= hu ) )\n"
100 << L <<
"Dphi(x_k,d_k) = Gf_k' * d_k - mu*( norm(c_k,1) + max_viol( hl <= h_k <= hu ) )\n";
116 h_k || hl || hu, std::logic_error
117 ,
"MeritFuncNLPL1::value(...) : Error! general inequalities are not supported yet" );
118 return deriv_ =
dot( Gf_k, d_k ) - ( c_k ?
mu_ * c_k->norm_1() : 0.0 );
AbstractLinAlgPack::size_type size_type
Base class for all merit functions for NonLinear Programs (NLP) {abstract}.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
value_type value(value_type f, const Vector *c, const Vector *h, const Vector *hl, const Vector *hu) const
void print_merit_func(std::ostream &out, const std::string &leading_str) const
T_To & dyn_cast(T_From &from)
MeritFuncNLPL1()
Initializes deriv() = 0 and mu() = 0.
value_type calc_deriv(const Vector &Gf_k, const Vector *c_k, const Vector *h_k, const Vector *hl, const Vector *hu, const Vector &d_k)
bool max_inequ_viol(const AbstractLinAlgPack::Vector &v, const AbstractLinAlgPack::Vector &vL, const AbstractLinAlgPack::Vector &vU, AbstractLinAlgPack::size_type *max_viol_i, AbstractLinAlgPack::value_type *max_viol, AbstractLinAlgPack::value_type *v_i, int *bnd_type, AbstractLinAlgPack::value_type *vLU_i)
Compute the maximum violation from a set of inequality constraints vL <= v <= vU. ...
MeritFuncNLP & operator=(const MeritFuncNLP &)
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2
AbstractLinAlgPack::value_type value_type