87 std::ostream &outStream ) {
88 Real tol = std::sqrt(ROL_EPSILON<Real>());
97 fobj.
reset(sigma_,delta_);
99 merit_ = fobj.
value(x,tol);
101 fobj.
gradient(*state_->gradientVec,x,tol);
102 gpnorm_ = state_->gradientVec->norm();
104 state_->gnorm = state_->gradientVec->norm();
108 state_->cnorm = state_->constraintVec->norm();
123 std::ostream &outStream ) {
126 Real tol(std::sqrt(ROL_EPSILON<Real>()));
127 Ptr<Vector<Real>> dwa_ = g.
clone();
129 initialize(x,g,emul,eres,fobj,econ,outStream);
130 Ptr<TypeU::Algorithm<Real>> algo;
132 if (verbosity_ > 0) writeOutput(outStream,
true);
134 while (status_->check(*state_)) {
136 algo = TypeU::AlgorithmFactory<Real>(list_);
137 algo->run(x,g,fobj,outStream);
138 subproblemIter_ = algo->getState()->iter;
141 state_->stepVec->set(x);
142 state_->stepVec->axpy(-one,*state_->iterateVec);
143 state_->snorm = state_->stepVec->norm();
147 state_->iterateVec->set(x);
150 state_->cnorm = state_->constraintVec->norm();
152 state_->gnorm = state_->gradientVec->norm();
154 emul.
set(*state_->lagmultVec);
155 merit_ = algo->getState()->value;
156 gpnorm_ = algo->getState()->gnorm;
164 bool too_infeasible = state_->cnorm >
static_cast<Real
>(100.)*gpnorm_;
165 bool too_feasible = state_->cnorm <
static_cast<Real
>(1e-2)*gpnorm_;
166 bool modified =
false;
167 if( too_infeasible && !modified && modifySigma_
169 sigma_ = std::min(sigma_*sigmaUpdate_, maxSigma_);
172 if( too_feasible && !modified && modifySigma_
174 sigma_ = std::max(sigma_/sigmaUpdate_, minSigma_);
177 if( delta_ > minDelta_ && !modified ) {
178 Real deltaNext = delta_ * deltaUpdate_;
179 if( gpnorm_ < deltaNext ) {
185 fobj.
reset(sigma_,delta_);
186 merit_ = fobj.
value(x,tol);
188 gpnorm_ = dwa_->norm();
196 if (verbosity_ > 0) writeOutput(outStream,printHeader_);
204 std::stringstream hist;
206 hist << std::string(114,
'-') << std::endl;
207 hist <<
"Fletcher exact penalty status output definitions" << std::endl << std::endl;
208 hist <<
" iter - Number of iterates (steps taken)" << std::endl;
209 hist <<
" fval - Objective function value" << std::endl;
210 hist <<
" cnorm - Norm of the constraint violation" << std::endl;
211 hist <<
" gLnorm - Norm of the gradient of the Lagrangian" << std::endl;
212 hist <<
" snorm - Norm of the step" << std::endl;
213 hist <<
" merit - Penalty function value" << std::endl;
214 hist <<
" gpnorm - Norm of the gradient of the penalty" << std::endl;
215 hist <<
" penalty - Penalty parameter" << std::endl;
216 hist <<
" delta - Feasibility tolerance" << std::endl;
217 hist <<
" #fval - Number of times the objective was computed" << std::endl;
218 hist <<
" #grad - Number of times the gradient was computed" << std::endl;
219 hist <<
" #cval - Number of times the constraint was computed" << std::endl;
220 hist <<
" subIter - Number of iterations to solve subproblem" << std::endl;
221 hist << std::string(114,
'-') << std::endl;
224 hist << std::setw(6) << std::left <<
"iter";
225 hist << std::setw(15) << std::left <<
"fval";
226 hist << std::setw(15) << std::left <<
"cnorm";
227 hist << std::setw(15) << std::left <<
"gLnorm";
228 hist << std::setw(15) << std::left <<
"snorm";
229 hist << std::setw(15) << std::left <<
"merit";
230 hist << std::setw(15) << std::left <<
"gpnorm";
231 hist << std::setw(10) << std::left <<
"penalty";
232 hist << std::setw(10) << std::left <<
"delta";
233 hist << std::setw(8) << std::left <<
"#fval";
234 hist << std::setw(8) << std::left <<
"#grad";
235 hist << std::setw(8) << std::left <<
"#cval";
236 hist << std::setw(8) << std::left <<
"subIter";
252 std::stringstream hist;
253 hist << std::scientific << std::setprecision(6);
254 if ( state_->iter == 0 ) writeName(os);
255 if ( print_header ) writeHeader(os);
256 if ( state_->iter == 0 ) {
258 hist << std::setw(6) << std::left << state_->iter;
259 hist << std::setw(15) << std::left << state_->value;
260 hist << std::setw(15) << std::left << state_->cnorm;
261 hist << std::setw(15) << std::left << state_->gnorm;
262 hist << std::setw(15) << std::left <<
"---";
263 hist << std::setw(15) << std::left << merit_;
264 hist << std::setw(15) << std::left << gpnorm_;
265 hist << std::scientific << std::setprecision(2);
266 hist << std::setw(10) << std::left << sigma_;
267 hist << std::setw(10) << std::left << delta_;
268 hist << std::scientific << std::setprecision(6);
269 hist << std::setw(8) << std::left << state_->nfval;
270 hist << std::setw(8) << std::left << state_->ngrad;
271 hist << std::setw(8) << std::left << state_->ncval;
272 hist << std::setw(8) << std::left <<
"---";
277 hist << std::setw(6) << std::left << state_->iter;
278 hist << std::setw(15) << std::left << state_->value;
279 hist << std::setw(15) << std::left << state_->cnorm;
280 hist << std::setw(15) << std::left << state_->gnorm;
281 hist << std::setw(15) << std::left << state_->snorm;
282 hist << std::setw(15) << std::left << merit_;
283 hist << std::setw(15) << std::left << gpnorm_;
284 hist << std::scientific << std::setprecision(2);
285 hist << std::setw(10) << std::left << sigma_;
286 hist << std::setw(10) << std::left << delta_;
287 hist << std::scientific << std::setprecision(6);
288 hist << std::setw(8) << std::left << state_->nfval;
289 hist << std::setw(8) << std::left << state_->ngrad;
290 hist << std::setw(8) << std::left << state_->ncval;
291 hist << 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)