10 #ifndef ROL_TYPEB_LINMOREALGORITHM_DEF_HPP
11 #define ROL_TYPEB_LINMOREALGORITHM_DEF_HPP
16 template<
typename Real>
23 ParameterList &trlist = list.sublist(
"Step").sublist(
"Trust Region");
25 state_->searchSize = trlist.get(
"Initial Radius", -1.0);
26 delMax_ = trlist.get(
"Maximum Radius", ROL_INF<Real>());
27 eta0_ = trlist.get(
"Step Acceptance Threshold", 0.05);
28 eta1_ = trlist.get(
"Radius Shrinking Threshold", 0.05);
29 eta2_ = trlist.get(
"Radius Growing Threshold", 0.9);
30 gamma0_ = trlist.get(
"Radius Shrinking Rate (Negative rho)", 0.0625);
31 gamma1_ = trlist.get(
"Radius Shrinking Rate (Positive rho)", 0.25);
32 gamma2_ = trlist.get(
"Radius Growing Rate", 2.5);
33 TRsafe_ = trlist.get(
"Safeguard Size", 100.0);
34 eps_ = TRsafe_*ROL_EPSILON<Real>();
35 interpRad_ = trlist.get(
"Use Radius Interpolation",
false);
37 storageNM_ = trlist.get(
"Nonmonotone Storage Size", 0);
38 useNM_ = (storageNM_ <= 0 ?
false :
true);
40 maxit_ = list.sublist(
"General").sublist(
"Krylov").get(
"Iteration Limit", 20);
41 tol1_ = list.sublist(
"General").sublist(
"Krylov").get(
"Absolute Tolerance", 1e-4);
42 tol2_ = list.sublist(
"General").sublist(
"Krylov").get(
"Relative Tolerance", 1e-2);
44 ROL::ParameterList &lmlist = trlist.sublist(
"Lin-More");
45 minit_ = lmlist.get(
"Maximum Number of Minor Iterations", 10);
46 mu0_ = lmlist.get(
"Sufficient Decrease Parameter", 1e-2);
47 spexp_ = lmlist.get(
"Relative Tolerance Exponent", 1.0);
48 spexp_ = std::max(static_cast<Real>(1),std::min(spexp_,static_cast<Real>(2)));
49 redlim_ = lmlist.sublist(
"Cauchy Point").get(
"Maximum Number of Reduction Steps", 10);
50 explim_ = lmlist.sublist(
"Cauchy Point").get(
"Maximum Number of Expansion Steps", 10);
51 alpha_ = lmlist.sublist(
"Cauchy Point").get(
"Initial Step Size", 1.0);
52 normAlpha_ = lmlist.sublist(
"Cauchy Point").get(
"Normalize Initial Step Size",
false);
53 interpf_ = lmlist.sublist(
"Cauchy Point").get(
"Reduction Rate", 0.1);
54 extrapf_ = lmlist.sublist(
"Cauchy Point").get(
"Expansion Rate", 10.0);
55 qtol_ = lmlist.sublist(
"Cauchy Point").get(
"Decrease Tolerance", 1e-8);
56 interpfPS_ = lmlist.sublist(
"Projected Search").get(
"Backtracking Rate", 0.5);
57 pslim_ = lmlist.sublist(
"Projected Search").get(
"Maximum Number of Steps", 20);
59 ParameterList &glist = list.sublist(
"General");
61 useInexact_.push_back(glist.get(
"Inexact Objective Function",
false));
62 useInexact_.push_back(glist.get(
"Inexact Gradient",
false));
63 useInexact_.push_back(glist.get(
"Inexact Hessian-Times-A-Vector",
false));
65 ParameterList &ilist = trlist.sublist(
"Inexact").sublist(
"Gradient");
66 scale0_ = ilist.get(
"Tolerance Scaling", static_cast<Real>(0.1));
67 scale1_ = ilist.get(
"Relative Tolerance", static_cast<Real>(2));
69 ParameterList &vlist = trlist.sublist(
"Inexact").sublist(
"Value");
70 scale_ = vlist.get(
"Tolerance Scaling", static_cast<Real>(1.e-1));
71 omega_ = vlist.get(
"Exponent", static_cast<Real>(0.9));
72 force_ = vlist.get(
"Forcing Sequence Initial Value", static_cast<Real>(1.0));
73 updateIter_ = vlist.get(
"Forcing Sequence Update Frequency", static_cast<int>(10));
74 forceFactor_ = vlist.get(
"Forcing Sequence Reduction Factor", static_cast<Real>(0.1));
76 verbosity_ = list.sublist(
"General").get(
"Output Level",0);
77 writeHeader_ = verbosity_ > 2;
79 useSecantPrecond_ = list.sublist(
"General").sublist(
"Secant").get(
"Use as Preconditioner",
false);
80 useSecantHessVec_ = list.sublist(
"General").sublist(
"Secant").get(
"Use as Hessian",
false);
85 model_ = makePtr<TrustRegionModel_U<Real>>(list,secant,mode);
86 if (secant == nullPtr) {
87 std::string secantType = list.sublist(
"General").sublist(
"Secant").get(
"Type",
"Limited-Memory BFGS");
92 template<
typename Real>
97 std::ostream &outStream) {
100 if (proj_ == nullPtr) {
101 proj_ = makePtr<PolyhedralProjection<Real>>(makePtrFromRef(bnd));
108 Real ftol =
static_cast<Real
>(0.1)*ROL_OVERFLOW<Real>();
109 proj_->project(x,outStream); state_->nproj++;
110 state_->iterateVec->set(x);
112 state_->value = obj.
value(x,ftol);
115 computeGradient(x,*state_->gradientVec,*state_->stepVec,state_->searchSize,obj,
true,gtol_,state_->gnorm,outStream);
122 state_->snorm = ROL_INF<Real>();
124 if (normAlpha_) alpha_ /= state_->gradientVec->norm();
126 if ( state_->searchSize <= static_cast<Real>(0) )
127 state_->searchSize = state_->gradientVec->norm();
130 rcon_ = makePtr<ReducedLinearConstraint<Real>>(proj_->getLinearConstraint(),
133 ns_ = makePtr<NullSpaceOperator<Real>>(rcon_,x,
134 *proj_->getResidual());
138 template<
typename Real>
147 outTol = std::sqrt(ROL_EPSILON<Real>());
148 if ( useInexact_[0] ) {
149 if (!(iter%updateIter_) && (iter!=0)) force_ *= forceFactor_;
151 Real eta =
static_cast<Real
>(0.999)*std::min(eta1_,one-eta2_);
152 outTol = scale_*std::pow(eta*std::min(pRed,force_),one/omega_);
153 if (inTol > outTol) fold = obj.
value(xold,outTol);
157 Real fval = obj.
value(x,outTol);
161 template<
typename Real>
170 std::ostream &outStream)
const {
171 if ( useInexact_[1] ) {
173 Real gtol0 = scale0_*del;
174 if (accept) gtol = gtol0 + one;
175 else gtol0 = scale0_*std::min(gnorm,del);
176 while ( gtol > gtol0 ) {
180 gtol0 = scale0_*std::min(gnorm,del);
185 gtol = std::sqrt(ROL_EPSILON<Real>());
246 template<
typename Real>
251 std::ostream &outStream ) {
253 Real tol0 = std::sqrt(ROL_EPSILON<Real>());
254 Real inTol =
static_cast<Real
>(0.1)*ROL_OVERFLOW<Real>(), outTol(inTol);
255 Real gfnorm(0), gfnormf(0), tol(0), stol(0), snorm(0);
256 Real ftrial(0), pRed(0), rho(1), q(0), delta(0);
257 int flagCG(0), iterCG(0), maxit(0);
259 initialize(x,g,obj,bnd,outStream);
260 Ptr<Vector<Real>> s = x.
clone();
261 Ptr<Vector<Real>> gmod = g.
clone(), gfree = g.
clone();
262 Ptr<Vector<Real>> pwa1 = x.
clone(), pwa2 = x.
clone(), pwa3 = x.
clone();
263 Ptr<Vector<Real>> dwa1 = g.
clone(), dwa2 = g.
clone(), dwa3 = g.
clone();
265 Real rhoNM(0), sigmac(0), sigmar(0);
266 Real fr(state_->value), fc(state_->value), fmin(state_->value);
271 if (verbosity_ > 0) writeOutput(outStream,
true);
273 while (status_->check(*state_)) {
275 model_->setData(obj,*state_->iterateVec,*state_->gradientVec,gtol_);
279 snorm = dcauchy(*state_->stepVec,alpha_,q,*state_->iterateVec,
280 state_->gradientVec->dual(),state_->searchSize,
281 *model_,*dwa1,*dwa2,outStream);
282 x.
plus(*state_->stepVec);
283 state_->snorm = snorm;
284 delta = state_->searchSize - snorm;
289 gmod->plus(*state_->gradientVec);
292 pwa1->set(gfree->dual());
294 gfree->set(pwa1->dual());
296 applyFreePrecond(*pwa1,*gfree,x,*model_,bnd,tol0,*dwa1,*pwa2);
297 gfnorm = pwa1->norm();
300 gfnorm = gfree->norm();
302 SPiter_ = 0; SPflag_ = 0;
303 if (verbosity_ > 1) {
304 outStream <<
" Norm of free gradient components: " << gfnorm << std::endl;
305 outStream << std::endl;
310 for (
int i = 0; i < minit_; ++i) {
312 flagCG = 0; iterCG = 0;
314 tol = std::min(tol1_,tol2_*std::pow(gfnorm,spexp_));
316 if (gfnorm > zero && delta > zero) {
317 snorm = dtrpcg(*s,flagCG,iterCG,*gfree,x,
318 delta,*model_,bnd,tol,stol,maxit,
319 *pwa1,*dwa1,*pwa2,*dwa2,*pwa3,*dwa3,outStream);
322 if (verbosity_ > 1) {
323 outStream <<
" Computation of CG step" << std::endl;
324 outStream <<
" Current face (i): " << i << std::endl;
325 outStream <<
" CG step length: " << snorm << std::endl;
326 outStream <<
" Number of CG iterations: " << iterCG << std::endl;
327 outStream <<
" CG flag: " << flagCG << std::endl;
328 outStream <<
" Total number of iterations: " << SPiter_ << std::endl;
329 outStream << std::endl;
333 snorm = dprsrch(x,*s,q,gmod->
dual(),*model_,bnd,*pwa1,*dwa1,outStream);
337 state_->stepVec->plus(*s);
338 state_->snorm = state_->stepVec->norm();
339 delta = state_->searchSize - state_->snorm;
343 pwa1->set(gfree->dual());
344 bnd.pruneActive(*pwa1,x,zero);
345 gfree->set(pwa1->dual());
347 applyFreePrecond(*pwa1,*gfree,x,*model_,bnd,tol0,*dwa1,*pwa2);
348 gfnormf = pwa1->norm();
351 gfnormf = gfree->norm();
353 if (verbosity_ > 1) {
354 outStream <<
" Norm of free gradient components: " << gfnormf << std::endl;
355 outStream << std::endl;
360 if (gfnormf <= tol) {
364 else if (SPiter_ >= maxit_) {
368 else if (flagCG == 2) {
372 else if (delta <= zero) {
385 ftrial = computeValue(inTol,outTol,pRed,state_->value,state_->iter,x,*state_->iterateVec,obj);
390 TRUtils::analyzeRatio<Real>(rho,TRflag_,state_->value,ftrial,pRed,eps_,outStream,verbosity_>1);
392 TRUtils::analyzeRatio<Real>(rhoNM,TRflagNM,fr,ftrial,pRed+sigmar,eps_,outStream,verbosity_>1);
393 TRflag_ = (rho < rhoNM ? TRflagNM : TRflag_);
394 rho = (rho < rhoNM ? rhoNM : rho );
401 x.
set(*state_->iterateVec);
405 state_->searchSize = TRUtils::interpolateRadius<Real>(*state_->gradientVec,*state_->stepVec,
406 state_->snorm,pRed,state_->value,ftrial,state_->searchSize,gamma0_,gamma1_,eta2_,
407 outStream,verbosity_>1);
410 state_->searchSize = gamma1_*std::min(state_->snorm,state_->searchSize);
412 computeGradient(x,*state_->gradientVec,*pwa1,state_->searchSize,obj,
false,gtol_,state_->gnorm,outStream);
416 state_->value = ftrial;
419 sigmac += pRed; sigmar += pRed;
420 if (ftrial < fmin) { fmin = ftrial; fc = fmin; sigmac =
zero; L = 0; }
423 if (ftrial > fc) { fc = ftrial; sigmac =
zero; }
424 if (L == storageNM_) { fr = fc; sigmar = sigmac; }
428 if (rho >= eta2_) state_->searchSize = std::min(gamma2_*state_->searchSize, delMax_);
430 dwa1->set(*state_->gradientVec);
432 computeGradient(x,*state_->gradientVec,*pwa1,state_->searchSize,obj,
true,gtol_,state_->gnorm,outStream);
435 state_->iterateVec->set(x);
437 model_->update(x,*state_->stepVec,*dwa1,*state_->gradientVec,
438 state_->snorm,state_->iter);
442 if (verbosity_ > 0) writeOutput(outStream,writeHeader_);
447 template<
typename Real>
450 std::ostream &outStream)
const {
452 proj_->project(s,outStream); state_->nproj++;
453 s.
axpy(static_cast<Real>(-1),x);
457 template<
typename Real>
466 std::ostream &outStream) {
467 const Real half(0.5);
468 Real tol = std::sqrt(ROL_EPSILON<Real>());
470 Real gs(0), snorm(0);
472 snorm = dgpstep(s,g,x,-alpha,outStream);
477 model.
hessVec(dwa,s,x,tol); nhess_++;
479 q = half * s.
apply(dwa) + gs;
480 interp = (q > mu0_*gs);
486 while (search && cnt < redlim_) {
488 snorm = dgpstep(s,g,x,-alpha,outStream);
490 model.
hessVec(dwa,s,x,tol); nhess_++;
492 q = half * s.
apply(dwa) + gs;
493 search = (q > mu0_*gs);
497 if (cnt >= redlim_ && q > mu0_*gs) {
498 outStream <<
"Cauchy point: The interpolation limit was met without producing sufficient decrease." << std::endl;
499 outStream <<
" Lin-More trust-region algorithm may not converge!" << std::endl;
509 snorm = dgpstep(s,g,x,-alpha,outStream);
510 if (snorm <= del && cnt < explim_) {
511 model.
hessVec(dwa,s,x,tol); nhess_++;
513 q = half * s.
apply(dwa) + gs;
514 if (q <= mu0_*gs && std::abs(q-qs) > qtol_*std::abs(qs)) {
532 snorm = dgpstep(s,g,x,-alpha,outStream);
534 if (verbosity_ > 1) {
535 outStream <<
" Cauchy point" << std::endl;
536 outStream <<
" Step length (alpha): " << alpha << std::endl;
537 outStream <<
" Step length (alpha*g): " << snorm << std::endl;
538 outStream <<
" Model decrease (pRed): " << -q << std::endl;
540 outStream <<
" Number of extrapolation steps: " << cnt << std::endl;
546 template<
typename Real>
552 std::ostream &outStream) {
553 const Real
zero(0.0), half(0.5);
554 Real tol = std::sqrt(ROL_EPSILON<Real>());
555 Real beta(1), snorm(0), gs(0);
561 snorm = dgpstep(pwa,s,x,beta,outStream);
562 model.
hessVec(dwa,pwa,x,tol); nhess_++;
565 q = half * pwa.
apply(dwa) + gs;
566 if (q <= mu0_*std::min(gs,
zero) || nsteps > pslim_) {
575 if (verbosity_ > 1) {
576 outStream << std::endl;
577 outStream <<
" Projected search" << std::endl;
578 outStream <<
" Step length (beta): " << beta << std::endl;
579 outStream <<
" Step length (beta*s): " << snorm << std::endl;
580 outStream <<
" Model decrease (pRed): " << -q << std::endl;
581 outStream <<
" Number of steps: " << nsteps << std::endl;
586 template<
typename Real>
590 const Real del)
const {
593 Real rad = ptx*ptx + ptp*(dsq-xtx);
594 rad = std::sqrt(std::max(rad,zero));
597 sigma = (dsq-xtx)/(ptx+rad);
599 else if (rad > zero) {
600 sigma = (rad-ptx)/ptp;
608 template<
typename Real>
613 const Real tol,
const Real stol,
const int itermax,
616 std::ostream &outStream)
const {
621 Real tol0 = std::sqrt(ROL_EPSILON<Real>());
622 const Real
zero(0), one(1), two(2);
623 Real rho(0), kappa(0), beta(0), sigma(0), alpha(0);
624 Real rtr(0), tnorm(0), sMs(0), pMp(0), sMp(0);
631 applyFreePrecond(r,t,x,model,bnd,tol0,dwa,pwa);
636 pMp = (!hasEcon_ ? rho : p.
dot(p));
638 for (iter = 0; iter < itermax; ++iter) {
640 applyFreeHessian(q,p,x,model,bnd,tol0,pwa);
644 alpha = (kappa>
zero) ? rho/kappa :
zero;
645 sigma = dtrqsol(sMs,pMp,sMp,del);
647 if (kappa <= zero || alpha >= sigma) {
650 iflag = (kappa<=
zero) ? 2 : 3;
656 applyFreePrecond(r,t,x,model,bnd,tol0,dwa,pwa);
661 if (rtr <= stol*stol || tnorm <= tol) {
662 sMs = sMs + two*alpha*sMp + alpha*alpha*pMp;
674 sMs = sMs + two*alpha*sMp + alpha*alpha*pMp;
675 sMp = beta*(sMp + alpha*pMp);
676 pMp = (!hasEcon_ ? rho : p.
dot(p)) + beta*beta*pMp;
679 if (iter == itermax) {
685 return std::sqrt(sMs);
688 template<
typename Real>
699 model.
hessVec(hv,pwa,x,tol); nhess_++;
709 template<
typename Real>
732 rcon_->setX(makePtrFromRef(x));
735 ns_->apply(hv,pwa,tol);
739 template<
typename Real>
741 std::ios_base::fmtflags osFlags(os.flags());
742 if (verbosity_ > 1) {
743 os << std::string(114,
'-') << std::endl;
744 os <<
" Lin-More trust-region method status output definitions" << std::endl << std::endl;
745 os <<
" iter - Number of iterates (steps taken)" << std::endl;
746 os <<
" value - Objective function value" << std::endl;
747 os <<
" gnorm - Norm of the gradient" << std::endl;
748 os <<
" snorm - Norm of the step (update to optimization vector)" << std::endl;
749 os <<
" delta - Trust-Region radius" << std::endl;
750 os <<
" #fval - Number of times the objective function was evaluated" << std::endl;
751 os <<
" #grad - Number of times the gradient was computed" << std::endl;
752 os <<
" #hess - Number of times the Hessian was applied" << std::endl;
753 os <<
" #proj - Number of times the projection was applied" << std::endl;
755 os <<
" tr_flag - Trust-Region flag" << std::endl;
762 os <<
" iterCG - Number of Truncated CG iterations" << std::endl << std::endl;
763 os <<
" flagGC - Trust-Region Truncated CG flag" << std::endl;
769 os << std::string(114,
'-') << std::endl;
772 os << std::setw(6) << std::left <<
"iter";
773 os << std::setw(15) << std::left <<
"value";
774 os << std::setw(15) << std::left <<
"gnorm";
775 os << std::setw(15) << std::left <<
"snorm";
776 os << std::setw(15) << std::left <<
"delta";
777 os << std::setw(10) << std::left <<
"#fval";
778 os << std::setw(10) << std::left <<
"#grad";
779 os << std::setw(10) << std::left <<
"#hess";
780 os << std::setw(10) << std::left <<
"#proj";
781 os << std::setw(10) << std::left <<
"tr_flag";
783 os << std::setw(10) << std::left <<
"iterCG";
784 os << std::setw(10) << std::left <<
"flagCG";
790 template<
typename Real>
792 std::ios_base::fmtflags osFlags(os.flags());
793 os << std::endl <<
"Lin-More Trust-Region Method (Type B, Bound Constraints)" << std::endl;
797 template<
typename Real>
799 std::ios_base::fmtflags osFlags(os.flags());
800 os << std::scientific << std::setprecision(6);
801 if ( state_->iter == 0 ) writeName(os);
802 if ( write_header ) writeHeader(os);
803 if ( state_->iter == 0 ) {
805 os << std::setw(6) << std::left << state_->iter;
806 os << std::setw(15) << std::left << state_->value;
807 os << std::setw(15) << std::left << state_->gnorm;
808 os << std::setw(15) << std::left <<
"---";
809 os << std::setw(15) << std::left << state_->searchSize;
810 os << std::setw(10) << std::left << state_->nfval;
811 os << std::setw(10) << std::left << state_->ngrad;
812 os << std::setw(10) << std::left << nhess_;
813 os << std::setw(10) << std::left << state_->nproj;
814 os << std::setw(10) << std::left <<
"---";
816 os << std::setw(10) << std::left <<
"---";
817 os << std::setw(10) << std::left <<
"---";
823 os << std::setw(6) << std::left << state_->iter;
824 os << std::setw(15) << std::left << state_->value;
825 os << std::setw(15) << std::left << state_->gnorm;
826 os << std::setw(15) << std::left << state_->snorm;
827 os << std::setw(15) << std::left << state_->searchSize;
828 os << std::setw(10) << std::left << state_->nfval;
829 os << std::setw(10) << std::left << state_->ngrad;
830 os << std::setw(10) << std::left << nhess_;
831 os << std::setw(10) << std::left << state_->nproj;
832 os << std::setw(10) << std::left << TRflag_;
834 os << std::setw(10) << std::left << SPiter_;
835 os << std::setw(10) << std::left << SPflag_;
std::string ECGFlagToString(ECGFlag cgf)
Provides the interface to evaluate objective functions.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Real computeValue(Real inTol, Real &outTol, Real pRed, Real &fold, int iter, const Vector< Real > &x, const Vector< Real > &xold, Objective< Real > &obj)
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 .
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)
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.
LinMoreAlgorithm(ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr)
virtual void writeExitStatus(std::ostream &os) const
void applyFreePrecond(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, TrustRegionModel_U< Real > &model, BoundConstraint< Real > &bnd, Real &tol, Vector< Real > &dwa, Vector< Real > &pwa) const
ESecant StringToESecant(std::string s)
Real dtrpcg(Vector< Real > &w, int &iflag, int &iter, const Vector< Real > &g, const Vector< Real > &x, const Real del, TrustRegionModel_U< Real > &model, BoundConstraint< Real > &bnd, const Real tol, const Real stol, const int itermax, Vector< Real > &p, Vector< Real > &q, Vector< Real > &r, Vector< Real > &t, Vector< Real > &pwa, Vector< Real > &dwa, std::ostream &outStream=std::cout) const
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
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()
Real dgpstep(Vector< Real > &s, const Vector< Real > &w, const Vector< Real > &x, const Real alpha, std::ostream &outStream=std::cout) const
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Apply Hessian approximation to vector.
ETRFlag
Enumation of flags used by trust-region solvers.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Real dprsrch(Vector< Real > &x, Vector< Real > &s, Real &q, const Vector< Real > &g, TrustRegionModel_U< Real > &model, BoundConstraint< Real > &bnd, Vector< Real > &pwa, Vector< Real > &dwa, std::ostream &outStream=std::cout)
std::string NumberToString(T Number)
Provides the interface to evaluate trust-region model functions.
void writeHeader(std::ostream &os) const override
Print iterate header.
Real dtrqsol(const Real xtx, const Real ptp, const Real ptx, const Real del) const
void applyFreeHessian(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, TrustRegionModel_U< Real > &model, BoundConstraint< Real > &bnd, Real &tol, Vector< Real > &pwa) const
Provides interface for and implements limited-memory secant operators.
void initialize(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, std::ostream &outStream=std::cout)
Provides an interface to check status of optimization algorithms.
std::string ETRFlagToString(ETRFlag trf)
void writeName(std::ostream &os) const override
Print step name.
void pruneActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -active set.
Provides the interface to apply upper and lower bound constraints.
Real optimalityCriterion(const Vector< Real > &x, const Vector< Real > &g, Vector< Real > &primal, std::ostream &outStream=std::cout) const
void initialize(const Vector< Real > &x, const Vector< Real > &g)
void writeOutput(std::ostream &os, const bool write_header=false) const override
Print iterate status.
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
void computeGradient(const Vector< Real > &x, Vector< Real > &g, Vector< Real > &pwa, Real del, Objective< Real > &obj, bool accept, Real >ol, Real &gnorm, std::ostream &outStream=std::cout) const
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 void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Apply preconditioner to vector.