111 std::ostream &outStream ) {
113 Ptr<Vector<Real>> pwa = x.
clone();
116 x,g,useLinearDamping_,kappaD_,
118 initialize(x,g,ipobj,bnd,*pwa,outStream);
119 Ptr<TypeU::Algorithm<Real>> algo;
122 if (verbosity_ > 0) writeOutput(outStream,
true);
124 while (status_->check(*state_)) {
126 list_.sublist(
"Status Test").set(
"Gradient Tolerance", gtol_);
127 list_.sublist(
"Status Test").set(
"Step Tolerance", stol_);
128 algo = TypeU::AlgorithmFactory<Real>(list_,secant_);
129 if (hasPolyProj_) algo->run(x,g,ipobj,
130 *proj_->getLinearConstraint(),
131 *proj_->getMultiplier(),
132 *proj_->getResidual(),outStream);
133 else algo->run(x,g,ipobj,outStream);
134 subproblemIter_ = algo->getState()->iter;
135 state_->nfval += algo->getState()->nfval;
136 state_->ngrad += algo->getState()->ngrad;
139 state_->stepVec->set(x);
140 state_->stepVec->axpy(-one,*state_->iterateVec);
141 state_->snorm = state_->stepVec->norm();
144 state_->iterateVec->set(x);
151 if( (rho_< one && state_->searchSize > mumin_) || (rho_ > one && state_->searchSize < mumax_) ) {
152 state_->searchSize *= rho_;
155 gtol_ *= gtolrate_; gtol_ = std::max(gtol_,mingtol_);
156 stol_ =
static_cast<Real
>(1e-6)*gtol_;
160 updateState(x,ipobj,bnd,*pwa,outStream);
163 if (verbosity_ > 0) writeOutput(outStream,writeHeader_);
170 std::ios_base::fmtflags osFlags(os.flags());
171 if (verbosity_ > 1) {
172 os << std::string(109,
'-') << std::endl;
173 os <<
"Interior Point Solver";
174 os <<
" status output definitions" << std::endl << std::endl;
175 os <<
" iter - Number of iterates (steps taken)" << std::endl;
176 os <<
" fval - Objective function value" << std::endl;
177 os <<
" gnorm - Norm of the gradient" << std::endl;
178 os <<
" snorm - Norm of the step (update to optimization vector)" << std::endl;
179 os <<
" penalty - Penalty parameter for bound constraints" << std::endl;
180 os <<
" #fval - Cumulative number of times the objective function was evaluated" << std::endl;
181 os <<
" #grad - Cumulative number of times the gradient was computed" << std::endl;
182 os <<
" optTol - Subproblem optimality tolerance" << std::endl;
183 os <<
" subiter - Number of subproblem iterations" << std::endl;
184 os << std::string(109,
'-') << std::endl;
188 os << std::setw(6) << std::left <<
"iter";
189 os << std::setw(15) << std::left <<
"fval";
190 os << std::setw(15) << std::left <<
"gnorm";
191 os << std::setw(15) << std::left <<
"snorm";
192 os << std::setw(10) << std::left <<
"penalty";
193 os << std::setw(8) << std::left <<
"#fval";
194 os << std::setw(8) << std::left <<
"#grad";
195 os << std::setw(10) << std::left <<
"optTol";
196 os << std::setw(8) << std::left <<
"subIter";
212 std::ios_base::fmtflags osFlags(os.flags());
213 os << std::scientific << std::setprecision(6);
214 if ( state_->iter == 0 ) writeName(os);
215 if ( write_header ) writeHeader(os);
216 if ( state_->iter == 0 ) {
218 os << std::setw(6) << std::left << state_->iter;
219 os << std::setw(15) << std::left << state_->value;
220 os << std::setw(15) << std::left << state_->gnorm;
221 os << std::setw(15) << std::left <<
"---";
222 os << std::scientific << std::setprecision(2);
223 os << std::setw(10) << std::left << state_->searchSize;
224 os << std::setw(8) << std::left << state_->nfval;
225 os << std::setw(8) << std::left << state_->ngrad;
226 os << std::setw(10) << std::left <<
"---";
227 os << std::setw(8) << std::left <<
"---";
232 os << std::setw(6) << std::left << state_->iter;
233 os << std::setw(15) << std::left << state_->value;
234 os << std::setw(15) << std::left << state_->gnorm;
235 os << std::setw(15) << std::left << state_->snorm;
236 os << std::scientific << std::setprecision(2);
237 os << std::setw(10) << std::left << state_->searchSize;
238 os << std::scientific << std::setprecision(6);
239 os << std::setw(8) << std::left << state_->nfval;
240 os << std::setw(8) << std::left << state_->ngrad;
241 os << std::scientific << std::setprecision(2);
242 os << std::setw(10) << std::left << gtol_;
243 os << std::scientific << std::setprecision(6);
244 os << std::setw(8) << std::left << subproblemIter_;
void run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout) override
Run algorithm on bound constrained problems (Type-B). This general interface supports the use of dual...