44 #ifndef ROL_TYPEB_TRUSTREGIONSPGALGORITHM_DEF_HPP 45 #define ROL_TYPEB_TRUSTREGIONSPGALGORITHM_DEF_HPP 52 template<
typename Real>
59 ParameterList &trlist = list.sublist(
"Step").sublist(
"Trust Region");
61 state_->searchSize = trlist.get(
"Initial Radius", -1.0);
62 delMax_ = trlist.get(
"Maximum Radius", ROL_INF<Real>());
63 eta0_ = trlist.get(
"Step Acceptance Threshold", 0.05);
64 eta1_ = trlist.get(
"Radius Shrinking Threshold", 0.05);
65 eta2_ = trlist.get(
"Radius Growing Threshold", 0.9);
66 gamma0_ = trlist.get(
"Radius Shrinking Rate (Negative rho)", 0.0625);
67 gamma1_ = trlist.get(
"Radius Shrinking Rate (Positive rho)", 0.25);
68 gamma2_ = trlist.get(
"Radius Growing Rate", 2.5);
69 TRsafe_ = trlist.get(
"Safeguard Size", 100.0);
70 eps_ = TRsafe_*ROL_EPSILON<Real>();
71 interpRad_ = trlist.get(
"Use Radius Interpolation",
false);
72 verbosity_ = trlist.sublist(
"General").get(
"Output Level", 0);
74 ROL::ParameterList &lmlist = trlist.sublist(
"SPG");
75 useNM_ = lmlist.get(
"Use Nonmonotone Trust Region",
false);
76 maxNM_ = lmlist.get(
"Maximum Storage Size", 10);
77 mu0_ = lmlist.get(
"Sufficient Decrease Parameter", 1e-2);
78 spexp_ = lmlist.get(
"Relative Tolerance Exponent", 1.0);
79 spexp_ = std::max(static_cast<Real>(1),std::min(spexp_,static_cast<Real>(2)));
80 redlim_ = lmlist.sublist(
"Cauchy Point").get(
"Maximum Number of Reduction Steps", 10);
81 explim_ = lmlist.sublist(
"Cauchy Point").get(
"Maximum Number of Expansion Steps", 10);
82 alpha_ = lmlist.sublist(
"Cauchy Point").get(
"Initial Step Size", 1.0);
83 normAlpha_ = lmlist.sublist(
"Cauchy Point").get(
"Normalize Initial Step Size",
false);
84 interpf_ = lmlist.sublist(
"Cauchy Point").get(
"Reduction Rate", 0.1);
85 extrapf_ = lmlist.sublist(
"Cauchy Point").get(
"Expansion Rate", 10.0);
86 qtol_ = lmlist.sublist(
"Cauchy Point").get(
"Decrease Tolerance", 1e-8);
88 lambdaMin_ = lmlist.sublist(
"Solver").get(
"Minimum Spectral Step Size", 1e-8);
89 lambdaMax_ = lmlist.sublist(
"Solver").get(
"Maximum Spectral Step Size", 1e8);
90 gamma_ = lmlist.sublist(
"Solver").get(
"Sufficient Decrease Tolerance", 1e-4);
91 maxSize_ = lmlist.sublist(
"Solver").get(
"Maximum Storage Size", 10);
92 maxit_ = lmlist.sublist(
"Solver").get(
"Iteration Limit", 25);
93 tol1_ = lmlist.sublist(
"Solver").get(
"Absolute Tolerance", 1e-4);
94 tol2_ = lmlist.sublist(
"Solver").get(
"Relative Tolerance", 1e-2);
95 useMin_ = lmlist.sublist(
"Solver").get(
"Use Smallest Model Iterate",
true);
96 useNMSP_ = lmlist.sublist(
"Solver").get(
"Use Nonmonotone Search",
false);
98 ParameterList &glist = list.sublist(
"General");
100 useInexact_.push_back(glist.get(
"Inexact Objective Function",
false));
101 useInexact_.push_back(glist.get(
"Inexact Gradient",
false));
102 useInexact_.push_back(glist.get(
"Inexact Hessian-Times-A-Vector",
false));
104 ParameterList &ilist = trlist.sublist(
"Inexact").sublist(
"Gradient");
105 scale0_ = ilist.get(
"Tolerance Scaling", static_cast<Real>(0.1));
106 scale1_ = ilist.get(
"Relative Tolerance", static_cast<Real>(2));
108 ParameterList &vlist = trlist.sublist(
"Inexact").sublist(
"Value");
109 scale_ = vlist.get(
"Tolerance Scaling", static_cast<Real>(1.e-1));
110 omega_ = vlist.get(
"Exponent", static_cast<Real>(0.9));
111 force_ = vlist.get(
"Forcing Sequence Initial Value", static_cast<Real>(1.0));
112 updateIter_ = vlist.get(
"Forcing Sequence Update Frequency", static_cast<int>(10));
113 forceFactor_ = vlist.get(
"Forcing Sequence Reduction Factor", static_cast<Real>(0.1));
115 verbosity_ = list.sublist(
"General").get(
"Output Level",0);
116 writeHeader_ = verbosity_ > 2;
118 useSecantPrecond_ = list.sublist(
"General").sublist(
"Secant").get(
"Use as Preconditioner",
false);
119 useSecantHessVec_ = list.sublist(
"General").sublist(
"Secant").get(
"Use as Hessian",
false);
124 model_ = makePtr<TrustRegionModel_U<Real>>(list,secant,mode);
125 if (secant == nullPtr) {
126 esec_ =
StringToESecant(list.sublist(
"General").sublist(
"Secant").get(
"Type",
"Limited-Memory BFGS"));
130 template<
typename Real>
136 std::ostream &outStream) {
138 if (proj_ == nullPtr)
139 proj_ = makePtr<PolyhedralProjection<Real>>(makePtrFromRef(bnd));
144 proj_->project(x,outStream); state_->nproj++;
145 state_->iterateVec->set(x);
147 state_->value = obj.
value(x,ftol);
150 state_->gnorm = computeGradient(x,*state_->gradientVec,*state_->stepVec,state_->searchSize,obj,outStream);
157 state_->snorm = ROL_INF<Real>();
159 if (normAlpha_) alpha_ /= state_->gradientVec->norm();
161 if ( state_->searchSize <= static_cast<Real>(0) )
162 state_->searchSize = state_->gradientVec->norm();
165 template<
typename Real>
174 outTol = std::sqrt(ROL_EPSILON<Real>());
175 if ( useInexact_[0] ) {
176 if (!(iter%updateIter_) && (iter!=0)) force_ *= forceFactor_;
178 Real eta =
static_cast<Real
>(0.999)*std::min(eta1_,one-eta2_);
179 outTol = scale_*std::pow(eta*std::min(pRed,force_),one/omega_);
180 if (inTol > outTol) fold = obj.
value(xold,outTol);
184 Real fval = obj.
value(x,outTol);
188 template<
typename Real>
194 std::ostream &outStream)
const {
196 if ( useInexact_[1] ) {
198 Real gtol1 = scale0_*del;
199 Real gtol0 = gtol1 + one;
200 while ( gtol0 > gtol1 ) {
204 gtol1 = scale0_*std::min(gnorm,del);
208 Real gtol = std::sqrt(ROL_EPSILON<Real>());
215 template<
typename Real>
220 std::ostream &outStream ) {
221 const Real
zero(0), one(1);
223 Real inTol =
static_cast<Real
>(0.1)*ROL_OVERFLOW<Real>(), outTol(inTol);
224 Real ftrial(0), fcheck(0), pRed(0), rho(1), q(0);
226 std::vector<std::string> output;
227 initialize(x,g,inTol,obj,bnd,outStream);
228 Ptr<Vector<Real>> gmod = g.
clone();
229 Ptr<Vector<Real>> pwa1 = x.
clone(), pwa2 = x.
clone();
230 Ptr<Vector<Real>> pwa3 = x.
clone(), pwa4 = x.
clone();
231 Ptr<Vector<Real>> pwa5 = x.
clone(), pwa6 = x.
clone();
232 Ptr<Vector<Real>> pwa7 = x.
clone();
233 Ptr<Vector<Real>> dwa1 = g.
clone(), dwa2 = g.
clone();
236 if (verbosity_ > 0) writeOutput(outStream,
true);
238 std::deque<Real> fqueue;
239 if (useNM_) fqueue.push_back(state_->value);
240 while (status_->check(*state_)) {
242 model_->setData(obj,*state_->iterateVec,*state_->gradientVec);
246 dcauchy(*state_->stepVec,alpha_,q,*state_->iterateVec,
247 state_->gradientVec->dual(),state_->searchSize,
248 *model_,*dwa1,*dwa2,outStream);
249 x.
plus(*state_->stepVec);
253 gmod->plus(*state_->gradientVec);
256 dpsg(x,q,*gmod,*state_->iterateVec,state_->searchSize,*model_,
257 *pwa1,*pwa2,*pwa3,*pwa4,*pwa5,*pwa6,*pwa7,*dwa1,outStream);
259 state_->stepVec->set(x); state_->stepVec->axpy(-one,*state_->iterateVec);
260 state_->snorm = state_->stepVec->norm();
263 ftrial = computeValue(inTol,outTol,pRed,state_->value,state_->iter,x,*state_->iterateVec,obj);
269 fcheck = useNM_ ? *std::max_element(fqueue.begin(),fqueue.end()) : state_->value;
271 TRUtils::analyzeRatio<Real>(rho,TRflag_,fcheck,ftrial,pRed,eps_,outStream,verbosity_>1);
278 x.
set(*state_->iterateVec);
282 state_->searchSize = TRUtils::interpolateRadius<Real>(*state_->gradientVec,*state_->stepVec,
283 state_->snorm,pRed,state_->value,ftrial,state_->searchSize,gamma0_,gamma1_,eta2_,
284 outStream,verbosity_>1);
287 state_->searchSize = gamma1_*std::min(state_->snorm,state_->searchSize);
292 state_->value = ftrial;
296 if (rho >= eta2_) state_->searchSize = std::min(gamma2_*state_->searchSize, delMax_);
298 dwa1->set(*state_->gradientVec);
301 state_->gnorm = computeGradient(x,*state_->gradientVec,*pwa1,state_->searchSize,obj,outStream);
303 state_->iterateVec->set(x);
305 model_->update(x,*state_->stepVec,*dwa1,*state_->gradientVec,
306 state_->snorm,state_->iter);
308 if (static_cast<int>(fqueue.size())==maxNM_) fqueue.pop_front();
309 fqueue.push_back(state_->value);
314 if (verbosity_ > 0) writeOutput(outStream,writeHeader_);
319 template<
typename Real>
322 std::ostream &outStream)
const {
324 proj_->project(s,outStream); state_->nproj++;
325 s.
axpy(static_cast<Real>(-1),x);
329 template<
typename Real>
338 std::ostream &outStream) {
339 const Real half(0.5);
341 Real tol = std::sqrt(ROL_EPSILON<Real>());
343 Real gs(0), snorm(0);
345 snorm = dgpstep(s,g,x,-alpha,outStream);
350 model.
hessVec(dwa,s,x,tol); nhess_++;
353 q = half * s.
apply(dwa) + gs;
354 interp = (q > mu0_*gs);
362 snorm = dgpstep(s,g,x,-alpha,outStream);
364 model.
hessVec(dwa,s,x,tol); nhess_++;
367 q = half * s.
apply(dwa) + gs;
368 search = (q > mu0_*gs) && (cnt < redlim_);
380 snorm = dgpstep(s,g,x,-alpha,outStream);
381 if (snorm <= del && cnt < explim_) {
382 model.
hessVec(dwa,s,x,tol); nhess_++;
385 q = half * s.
apply(dwa) + gs;
386 if (q <= mu0_*gs && std::abs(q-qs) > qtol_*std::abs(qs)) {
404 snorm = dgpstep(s,g,x,-alpha,outStream);
406 if (verbosity_ > 1) {
407 outStream <<
" Cauchy point" << std::endl;
408 outStream <<
" Step length (alpha): " << alpha << std::endl;
409 outStream <<
" Step length (alpha*g): " << snorm << std::endl;
410 outStream <<
" Model decrease (pRed): " << -q << std::endl;
412 outStream <<
" Number of extrapolation steps: " << cnt << std::endl;
418 template<
typename Real>
433 std::ostream &outStream) {
441 const Real
zero(0), half(0.5), one(1), two(2), eps(std::sqrt(ROL_EPSILON<Real>()));
442 Real tol(std::sqrt(ROL_EPSILON<Real>()));
443 Real alpha(1), sHs(0), alphaTmp(1), mmax(0), qmin(0);
444 std::deque<Real> mqueue; mqueue.push_back(q);
446 if (useNMSP_ && useMin_) { qmin = q; ymin.
set(y); }
450 pwa.
set(y); pwa.
axpy(-one,pwa1);
451 dproj(pwa,x,del,pwa2,pwa3,pwa4,pwa5,outStream);
453 Real gnorm = pwa.
norm();
454 const Real gtol = std::min(tol1_,tol2_*gnorm);
457 Real lambda = std::max(lambdaMin_,std::min(one/gmod.
norm(),lambdaMax_));
458 pwa.
set(y); pwa.
axpy(-lambda,pwa1);
459 dproj(pwa,x,del,pwa2,pwa3,pwa4,pwa5,outStream);
461 Real gs = gmod.
apply(pwa);
462 Real ss = pwa.
dot(pwa);
465 outStream <<
" Spectral Projected Gradient" << std::endl;
468 while (SPiter_ < maxit_) {
472 model.
hessVec(dwa,pwa,x,tol); nhess_++;
473 sHs = dwa.
apply(pwa);
477 mmax = *std::max_element(mqueue.begin(),mqueue.end());
478 alphaTmp = (-(one-gamma_)*gs + std::sqrt(std::pow((one-gamma_)*gs,two)-two*sHs*(q-mmax)))/sHs;
483 alpha = (sHs >
zero ? std::min(one,std::max(
zero,alphaTmp)) : one);
486 q += alpha * (gs + half * alpha * sHs);
487 gmod.
axpy(alpha,dwa);
492 if (static_cast<int>(mqueue.size())==maxSize_) mqueue.pop_front();
494 if (useMin_ && q <= qmin) { qmin = q; ymin.
set(y); }
499 pwa.
set(y); pwa.
axpy(-one,pwa1);
500 dproj(pwa,x,del,pwa2,pwa3,pwa4,pwa5,outStream);
504 if (verbosity_ > 1) {
505 outStream << std::endl;
506 outStream <<
" Iterate: " << SPiter_ << std::endl;
507 outStream <<
" Spectral step length (lambda): " << lambda << std::endl;
508 outStream <<
" Step length (alpha): " << alpha << std::endl;
509 outStream <<
" Model decrease (pRed): " << -q << std::endl;
510 outStream <<
" Optimality criterion: " << gnorm << std::endl;
511 outStream << std::endl;
513 if (gnorm < gtol)
break;
516 lambda = (sHs<=eps ? lambdaMax_ : std::max(lambdaMin_,std::min(ss/sHs,lambdaMax_)));
517 pwa.
set(y); pwa.
axpy(-lambda,pwa1);
518 dproj(pwa,x,del,pwa2,pwa3,pwa4,pwa5,outStream);
520 gs = gmod.
apply(pwa);
523 if (useNMSP_ && useMin_) { q = qmin; y.
set(ymin); }
524 SPflag_ = (SPiter_==maxit_) ? 1 : 0;
527 template<
typename Real>
535 std::ostream &outStream)
const {
537 const Real
zero(0), half(0.5), one(1), two(2), three(3);
538 const Real eps(ROL_EPSILON<Real>()), tol0(1e1*eps), fudge(1.0-1e-2*sqrt(eps));
539 Real f0(0), f1(0), fc(0), t0(0), t1(1), tc(0), d1(1), d2(1), tol(1);
540 Real p(0), q(0), r(0), s(0), m(0);
541 int cnt(state_->nproj);
543 proj_->project(y1,outStream); state_->nproj++;
544 pwa.
set(y1); pwa.
axpy(-one,x0);
551 tc = t0; fc = f0; yc.
set(y0);
555 if (std::abs(fc-del) < std::abs(f1-del)) {
556 t0 = t1; t1 = tc; tc = t0;
557 f0 = f1; f1 = fc; fc = f0;
560 tol = two*eps*std::abs(t1) + half*tol0;
562 if (std::abs(m) <= tol) { code = 1;
break; }
563 if ((f1 >= fudge*del && f1 <= del))
break;
564 if (std::abs(d1) < tol || std::abs(f0-del) <= std::abs(f1-del)) {
568 s = (f1-del)/(f0-del);
574 q = (f0-del)/(fc-del);
575 r = (f1-del)/(fc-del);
576 p = s*(two*m*q*(q-r)-(t1-t0)*(r-one));
577 q = (q-one)*(r-one)*(s-one);
579 if (p >
zero) q = -q;
583 if (two*p < three*m*q-std::abs(tol*q) && p < std::abs(half*s*q)) {
590 t0 = t1; f0 = f1; y0.
set(y1);
591 if (std::abs(d2) > tol) t1 += d2;
592 else if (m >
zero) t1 += tol;
595 proj_->project(y1,outStream); state_->nproj++;
596 pwa.
set(y1); pwa.
axpy(-one,x0);
598 if ((f1 > del && fc > del) || (f1 <= del && fc <= del)) {
599 tc = t0; fc = f0; yc.
set(y0);
603 if (code==1 && f1>del) x.
set(yc);
605 if (verbosity_ > 1) {
606 outStream << std::endl;
607 outStream <<
" Trust-Region Subproblem Projection" << std::endl;
608 outStream <<
" Number of polyhedral projections: " << state_->nproj-cnt << std::endl;
609 if (code == 1 && f1 > del) {
610 outStream <<
" Transformed Multiplier: " << tc << std::endl;
611 outStream <<
" Dual Residual: " << fc-del << std::endl;
614 outStream <<
" Transformed Multiplier: " << t1 << std::endl;
615 outStream <<
" Dual Residual: " << f1-del << std::endl;
617 outStream <<
" Exit Code: " << code << std::endl;
618 outStream << std::endl;
796 template<
typename Real>
798 std::stringstream hist;
799 if (verbosity_ > 1) {
800 hist << std::string(114,
'-') << std::endl;
801 hist <<
" SPG trust-region method status output definitions" << std::endl << std::endl;
802 hist <<
" iter - Number of iterates (steps taken)" << std::endl;
803 hist <<
" value - Objective function value" << std::endl;
804 hist <<
" gnorm - Norm of the gradient" << std::endl;
805 hist <<
" snorm - Norm of the step (update to optimization vector)" << std::endl;
806 hist <<
" delta - Trust-Region radius" << std::endl;
807 hist <<
" #fval - Number of times the objective function was evaluated" << std::endl;
808 hist <<
" #grad - Number of times the gradient was computed" << std::endl;
809 hist <<
" #hess - Number of times the Hessian was applied" << std::endl;
810 hist <<
" #proj - Number of times the projection was computed" << std::endl;
812 hist <<
" tr_flag - Trust-Region flag" << std::endl;
818 hist <<
" iterSPG - Number of Spectral Projected Gradient iterations" << std::endl << std::endl;
819 hist <<
" flagSPG - Trust-Region Truncated CG flag" << std::endl;
820 hist <<
" 0 - Converged" << std::endl;
821 hist <<
" 1 - Iteration Limit Exceeded" << std::endl;
822 hist << std::string(114,
'-') << std::endl;
825 hist << std::setw(6) << std::left <<
"iter";
826 hist << std::setw(15) << std::left <<
"value";
827 hist << std::setw(15) << std::left <<
"gnorm";
828 hist << std::setw(15) << std::left <<
"snorm";
829 hist << std::setw(15) << std::left <<
"delta";
830 hist << std::setw(10) << std::left <<
"#fval";
831 hist << std::setw(10) << std::left <<
"#grad";
832 hist << std::setw(10) << std::left <<
"#hess";
833 hist << std::setw(10) << std::left <<
"#proj";
834 hist << std::setw(10) << std::left <<
"tr_flag";
835 hist << std::setw(10) << std::left <<
"iterSPG";
836 hist << std::setw(10) << std::left <<
"flagSPG";
841 template<
typename Real>
843 std::stringstream hist;
844 hist << std::endl <<
"SPG Trust-Region Method (Type B, Bound Constraints)" << std::endl;
848 template<
typename Real>
850 std::stringstream hist;
851 hist << std::scientific << std::setprecision(6);
852 if ( state_->iter == 0 ) writeName(os);
853 if ( write_header ) writeHeader(os);
854 if ( state_->iter == 0 ) {
856 hist << std::setw(6) << std::left << state_->iter;
857 hist << std::setw(15) << std::left << state_->value;
858 hist << std::setw(15) << std::left << state_->gnorm;
859 hist << std::setw(15) << std::left <<
"---";
860 hist << std::setw(15) << std::left << state_->searchSize;
861 hist << std::setw(10) << std::left << state_->nfval;
862 hist << std::setw(10) << std::left << state_->ngrad;
863 hist << std::setw(10) << std::left << nhess_;
864 hist << std::setw(10) << std::left << state_->nproj;
865 hist << std::setw(10) << std::left <<
"---";
866 hist << std::setw(10) << std::left <<
"---";
867 hist << std::setw(10) << std::left <<
"---";
872 hist << std::setw(6) << std::left << state_->iter;
873 hist << std::setw(15) << std::left << state_->value;
874 hist << std::setw(15) << std::left << state_->gnorm;
875 hist << std::setw(15) << std::left << state_->snorm;
876 hist << std::setw(15) << std::left << state_->searchSize;
877 hist << std::setw(10) << std::left << state_->nfval;
878 hist << std::setw(10) << std::left << state_->ngrad;
879 hist << std::setw(10) << std::left << nhess_;
880 hist << std::setw(10) << std::left << state_->nproj;
881 hist << std::setw(10) << std::left << TRflag_;
882 hist << std::setw(10) << std::left << SPiter_;
883 hist << std::setw(10) << std::left << SPflag_;
Provides the interface to evaluate objective functions.
virtual void scale(const Real alpha)=0
Compute where .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
TrustRegionSPGAlgorithm(ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr)
void dproj(Vector< Real > &x, const Vector< Real > &x0, Real del, Vector< Real > &y0, Vector< Real > &y1, Vector< Real > &yc, Vector< Real > &pwa, std::ostream &outStream=std::cout) const
ESecant StringToESecant(std::string s)
Real dcauchy(Vector< Real > &s, Real &alpha, Real &q, const Vector< Real > &x, const Vector< Real > &g, const Real del, TrustRegionModel_U< Real > &model, Vector< Real > &dwa, Vector< Real > &dwa1, std::ostream &outStream=std::cout)
Defines the linear algebra or vector space interface.
void dpsg(Vector< Real > &y, Real &q, Vector< Real > &gmod, const Vector< Real > &x, Real del, TrustRegionModel_U< Real > &model, Vector< Real > &ymin, Vector< Real > &pwa, Vector< Real > &pwa1, Vector< Real > &pwa2, Vector< Real > &pwa3, Vector< Real > &pwa4, Vector< Real > &pwa5, Vector< Real > &dwa, std::ostream &outStream=std::cout)
void writeName(std::ostream &os) const override
Print step name.
virtual void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
virtual Real dot(const Vector &x) const =0
Compute where .
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Apply Hessian approximation to vector.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Real optimalityCriterion(const Vector< Real > &x, const Vector< Real > &g, Vector< Real > &primal, std::ostream &outStream=std::cout) const
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
std::string NumberToString(T Number)
Provides the interface to evaluate trust-region model functions.
void initialize(Vector< Real > &x, const Vector< Real > &g, Real ftol, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
void writeHeader(std::ostream &os) const override
Print iterate header.
Provides interface for and implements limited-memory secant operators.
Provides an interface to check status of optimization algorithms.
std::string ETRFlagToString(ETRFlag trf)
virtual void writeExitStatus(std::ostream &os) const
Provides the interface to apply upper and lower bound constraints.
Real computeGradient(const Vector< Real > &x, Vector< Real > &g, Vector< Real > &pwa, Real del, Objective< Real > &obj, std::ostream &outStream=std::cout) const
void writeOutput(std::ostream &os, bool write_header=false) const override
Print iterate status.
void initialize(const Vector< Real > &x, const Vector< Real > &g)
Real dgpstep(Vector< Real > &s, const Vector< Real > &w, const Vector< Real > &x, const Real alpha, std::ostream &outStream=std::cout) const
virtual void set(const Vector &x)
Set where .
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...
virtual Real norm() const =0
Returns where .
Real computeValue(Real inTol, Real &outTol, Real pRed, Real &fold, int iter, const Vector< Real > &x, const Vector< Real > &xold, Objective< Real > &obj)