44 #ifndef ROL_INTERIORPOINTSTEP_H 45 #define ROL_INTERIORPOINTSTEP_H 61 Teuchos::RCP<Vector<Real> >
xvec_;
62 Teuchos::RCP<Vector<Real> >
gvec_;
63 Teuchos::RCP<Vector<Real> >
lvec_;
64 Teuchos::RCP<Vector<Real> >
cvec_;
67 Teuchos::RCP<Step<Real> >
step_;
68 Teuchos::RCP<DefaultAlgorithm<Real> >
algo_;
87 Step<Real>(), step_(Teuchos::null), status_(Teuchos::null) {
89 using Teuchos::ParameterList;
91 ParameterList& iplist = parlist.sublist(
"Step").sublist(
"Interior Point");
92 ParameterList& stlist = parlist.sublist(
"Status Test");
93 ParameterList& cslist = parlist.sublist(
"Step").sublist(
"Composite Step");
97 mu_ = iplist.get(
"Initial Barrier Penalty",1.0);
98 eps_ = iplist.get(
"Minimum Barrier Penalty",1.e-4);
99 rho_ = iplist.get(
"Barrier Penalty Reduction Factor",0.5);
100 subproblemIter_ = iplist.get(
"Subproblem Iteration Limit",10);
104 gtol_ = stlist.get(
"Gradient Tolerance", 1.e-8);
105 ctol_ = stlist.get(
"Constraint Tolerance", 1.e-8);
106 stol_ = stlist.get(
"Step Tolerance", 1.e-8);
107 maxit_ = stlist.get(
"Iteration Limit", 100);
111 parlist_ = Teuchos::rcp(&parlist,
false);
123 state->descentVec = x.
clone();
124 state->gradientVec = g.
clone();
125 state->constraintVec = c.
clone();
128 IPOBJ &ipobj = Teuchos::dyn_cast<IPOBJ>(obj);
129 IPCON &ipcon = Teuchos::dyn_cast<IPCON>(con);
139 algo_state.
nfval = 0;
140 algo_state.
ncval = 0;
141 algo_state.
ngrad = 0;
150 con.
value(c,x,zerotol);
155 algo_state.
ncval += ipcon.getNumberConstraintEvaluations();
167 algo_ = Teuchos::rcp(
new DefaultAlgorithm<Real>(step_,status_,
false) );
172 algo_->run(*xvec_,*gvec_,*lvec_,*cvec_,obj,con,
false);
177 subproblemIter_ = (algo_->getState())->iter;
191 IPOBJ &ipobj = Teuchos::dyn_cast<IPOBJ>(obj);
192 IPCON &ipcon = Teuchos::dyn_cast<IPCON>(con);
196 algo_state_->ncval += ipcon.getNumberConstraintEvaluations();
230 std::stringstream hist;
232 hist << std::setw(6) << std::left <<
"iter";
233 hist << std::setw(15) << std::left <<
"fval";
234 hist << std::setw(15) << std::left <<
"cnorm";
235 hist << std::setw(15) << std::left <<
"gnorm";
236 hist << std::setw(15) << std::left <<
"snorm";
237 hist << std::setw(15) << std::left <<
"penalty";
238 hist << std::setw(8) << std::left <<
"#fval";
239 hist << std::setw(8) << std::left <<
"#grad";
240 hist << std::setw(8) << std::left <<
"#cval";
241 hist << std::setw(8) << std::left <<
"subIter";
249 std::stringstream hist;
250 hist <<
"\n" <<
" Interior Point solver\n";
257 std::stringstream hist;
258 hist << std::scientific << std::setprecision(6);
259 if ( algo_state.
iter == 0 ) {
261 hist << std::setw(6) << std::left << algo_state.
iter;
262 hist << std::setw(15) << std::left << algo_state.
value;
263 hist << std::setw(15) << std::left << algo_state.
cnorm;
264 hist << std::setw(15) << std::left << algo_state.
gnorm;
265 hist << std::setw(15) << std::left << algo_state.
snorm;
266 hist << std::setw(15) << std::left <<
mu_;
267 hist << std::setw(8) << std::left << algo_state.
nfval;
268 hist << std::setw(8) << std::left << algo_state.
ngrad;
269 hist << std::setw(8) << std::left << algo_state.
ncval;
273 if ( print_header ) {
287 #endif // ROL_INTERIORPOINTSTEP_H
Provides the interface to evaluate objective functions.
Teuchos::RCP< Vector< Real > > lvec_
Teuchos::RCP< Teuchos::ParameterList > parlist_
int getNumberFunctionEvaluations(void)
virtual void plus(const Vector &x)=0
Compute , where .
void initialize(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, EqualityConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Initialize step with equality constraint.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Has both inequality and equality constraints. Treat inequality constraint as equality with slack vari...
Teuchos::RCP< Vector< Real > > cvec_
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
Provides the interface to compute optimization steps.
int getNumberGradientEvaluations(void)
Teuchos::RCP< Vector< Real > > gvec_
Teuchos::RCP< StepState< Real > > getState(void)
Contains definitions of custom data types in ROL.
Teuchos::RCP< Step< Real > > step_
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, EqualityConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Defines the linear algebra or vector space interface.
void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, EqualityConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Provides an interface to check status of optimization algorithms for problems with equality constrain...
State for algorithm class. Will be used for restarts.
void updatePenalty(Real mu)
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Teuchos::RCP< DefaultAlgorithm< Real > > algo_
Defines the equality constraint operator interface.
InteriorPointEqualityConstraint< Real > IPCON
Teuchos::RCP< Vector< Real > > xvec_
void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Compute step for bound constraints; here only to satisfy the interface requirements, does nothing, needs refactoring.
Implements the computation of optimization steps with composite-step trust-region methods...
Adds barrier term to generic objective.
Provides the interface to apply upper and lower bound constraints.
std::string printName(void) const
Print step name.
InteriorPointObjective< Real > IPOBJ
std::string printHeader(void) const
Print iterate header.
std::string print(AlgorithmState< Real > &algo_state, bool printHeader=false) const
Print iterate status.
void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Update step, for bound constraints; here only to satisfy the interface requirements, does nothing, needs refactoring.
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
virtual void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)=0
Evaluate the constraint operator at .
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
Teuchos::RCP< StatusTest< Real > > status_
InteriorPointStep(Teuchos::ParameterList &parlist)