44 #include "ConstrainedOptPack_MeritFuncNLPL1.hpp"
45 #include "AbstractLinAlgPack_Vector.hpp"
46 #include "AbstractLinAlgPack_VectorStdOps.hpp"
47 #include "AbstractLinAlgPack_VectorAuxiliaryOps.hpp"
48 #include "Teuchos_Assert.hpp"
49 #include "Teuchos_dyn_cast.hpp"
51 namespace ConstrainedOptPack {
54 : deriv_(0.0), mu_(0.0)
63 if(
this == &merit_func_l1)
65 this->deriv_ = merit_func_l1.deriv_;
66 this->mu_ = merit_func_l1.mu_;
78 value_type phi_val_h = 0.0;
81 value_type max_viol, h_i, hlu_i;
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 );
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
T_To & dyn_cast(T_From &from)
void print_merit_func(std::ostream &out, const std::string &leading_str) const
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)
MeritFuncNLP & operator=(const MeritFuncNLP &)
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)