53 std::ostream &outStream ) {
54 Real tol = std::sqrt(ROL_EPSILON<Real>());
63 fobj.
reset(sigma_,delta_);
65 merit_ = fobj.
value(x,tol);
67 fobj.
gradient(*state_->gradientVec,x,tol);
68 gpnorm_ = state_->gradientVec->norm();
70 state_->gnorm = state_->gradientVec->norm();
74 state_->cnorm = state_->constraintVec->norm();
89 std::ostream &outStream ) {
92 Real tol(std::sqrt(ROL_EPSILON<Real>()));
93 Ptr<Vector<Real>> dwa_ = g.
clone();
95 initialize(x,g,emul,eres,fobj,econ,outStream);
96 Ptr<TypeU::Algorithm<Real>> algo;
98 if (verbosity_ > 0) writeOutput(outStream,
true);
100 while (status_->check(*state_)) {
102 algo = TypeU::AlgorithmFactory<Real>(list_,secant_);
103 algo->run(x,g,fobj,outStream);
104 subproblemIter_ = algo->getState()->iter;
107 state_->stepVec->set(x);
108 state_->stepVec->axpy(-one,*state_->iterateVec);
109 state_->snorm = state_->stepVec->norm();
113 state_->iterateVec->set(x);
116 state_->cnorm = state_->constraintVec->norm();
118 state_->gnorm = state_->gradientVec->norm();
120 emul.
set(*state_->lagmultVec);
121 merit_ = algo->getState()->value;
122 gpnorm_ = algo->getState()->gnorm;
130 bool too_infeasible = state_->cnorm >
static_cast<Real
>(100.)*gpnorm_;
131 bool too_feasible = state_->cnorm <
static_cast<Real
>(1e-2)*gpnorm_;
132 bool modified =
false;
133 if( too_infeasible && !modified && modifySigma_
135 sigma_ = std::min(sigma_*sigmaUpdate_, maxSigma_);
138 if( too_feasible && !modified && modifySigma_
140 sigma_ = std::max(sigma_/sigmaUpdate_, minSigma_);
143 if( delta_ > minDelta_ && !modified ) {
144 Real deltaNext = delta_ * deltaUpdate_;
145 if( gpnorm_ < deltaNext ) {
151 fobj.
reset(sigma_,delta_);
152 merit_ = fobj.
value(x,tol);
154 gpnorm_ = dwa_->norm();
162 if (verbosity_ > 0) writeOutput(outStream,printHeader_);
170 std::ios_base::fmtflags osFlags(os.flags());
172 os << std::string(114,
'-') << std::endl;
173 os <<
"Fletcher exact penalty status output definitions" << std::endl << std::endl;
174 os <<
" iter - Number of iterates (steps taken)" << std::endl;
175 os <<
" fval - Objective function value" << std::endl;
176 os <<
" cnorm - Norm of the constraint violation" << std::endl;
177 os <<
" gLnorm - Norm of the gradient of the Lagrangian" << std::endl;
178 os <<
" snorm - Norm of the step" << std::endl;
179 os <<
" merit - Penalty function value" << std::endl;
180 os <<
" gpnorm - Norm of the gradient of the penalty" << std::endl;
181 os <<
" penalty - Penalty parameter" << std::endl;
182 os <<
" delta - Feasibility tolerance" << std::endl;
183 os <<
" #fval - Number of times the objective was computed" << std::endl;
184 os <<
" #grad - Number of times the gradient was computed" << std::endl;
185 os <<
" #cval - Number of times the constraint was computed" << std::endl;
186 os <<
" subIter - Number of iterations to solve subproblem" << std::endl;
187 os << std::string(114,
'-') << std::endl;
190 os << std::setw(6) << std::left <<
"iter";
191 os << std::setw(15) << std::left <<
"fval";
192 os << std::setw(15) << std::left <<
"cnorm";
193 os << std::setw(15) << std::left <<
"gLnorm";
194 os << std::setw(15) << std::left <<
"snorm";
195 os << std::setw(15) << std::left <<
"merit";
196 os << std::setw(15) << std::left <<
"gpnorm";
197 os << std::setw(10) << std::left <<
"penalty";
198 os << std::setw(10) << std::left <<
"delta";
199 os << std::setw(8) << std::left <<
"#fval";
200 os << std::setw(8) << std::left <<
"#grad";
201 os << std::setw(8) << std::left <<
"#cval";
202 os << std::setw(8) << std::left <<
"subIter";
218 std::ios_base::fmtflags osFlags(os.flags());
219 os << std::scientific << std::setprecision(6);
220 if ( state_->iter == 0 ) writeName(os);
221 if ( print_header ) writeHeader(os);
222 if ( state_->iter == 0 ) {
224 os << std::setw(6) << std::left << state_->iter;
225 os << std::setw(15) << std::left << state_->value;
226 os << std::setw(15) << std::left << state_->cnorm;
227 os << std::setw(15) << std::left << state_->gnorm;
228 os << std::setw(15) << std::left <<
"---";
229 os << std::setw(15) << std::left << merit_;
230 os << std::setw(15) << std::left << gpnorm_;
231 os << std::scientific << std::setprecision(2);
232 os << std::setw(10) << std::left << sigma_;
233 os << std::setw(10) << std::left << delta_;
234 os << std::scientific << std::setprecision(6);
235 os << std::setw(8) << std::left << state_->nfval;
236 os << std::setw(8) << std::left << state_->ngrad;
237 os << std::setw(8) << std::left << state_->ncval;
238 os << std::setw(8) << std::left <<
"---";
243 os << std::setw(6) << std::left << state_->iter;
244 os << std::setw(15) << std::left << state_->value;
245 os << std::setw(15) << std::left << state_->cnorm;
246 os << std::setw(15) << std::left << state_->gnorm;
247 os << std::setw(15) << std::left << state_->snorm;
248 os << std::setw(15) << std::left << merit_;
249 os << std::setw(15) << std::left << gpnorm_;
250 os << std::scientific << std::setprecision(2);
251 os << std::setw(10) << std::left << sigma_;
252 os << std::setw(10) << std::left << delta_;
253 os << std::scientific << std::setprecision(6);
254 os << std::setw(8) << std::left << state_->nfval;
255 os << std::setw(8) << std::left << state_->ngrad;
256 os << std::setw(8) << std::left << state_->ncval;
257 os << std::setw(8) << std::left << subproblemIter_;
virtual void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, Constraint< Real > &econ, Vector< Real > &emul, const Vector< Real > &eres, std::ostream &outStream=std::cout) override
Run algorithm on equality constrained problems (Type-E). This general interface supports the use of d...
void initialize(Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &l, const Vector< Real > &c, FletcherObjectiveE< Real > &fobj, Constraint< Real > &con, std::ostream &outStream)