54 #include "ROL_ParameterList.hpp"
83 state_ = ROL::makePtr<StepState<Real>>();
100 Real tol = std::sqrt(ROL_EPSILON<Real>()), one(1),
zero(0);
116 ROL::Ptr<Vector<Real> > xnew = x.
clone();
121 algo_state.
gnorm = xnew->norm();
206 if( con == ROL::nullPtr ) {
207 if( bnd == ROL::nullPtr ) {
208 bnd = ROL::makePtr<BoundConstraint<Real>>();
211 initialize(*x, x->dual(), *obj, *bnd, algo_state);
215 if( bnd == ROL::nullPtr ) {
216 initialize(*x,x->dual(),*l,l->dual(),*obj,*con,algo_state );
218 initialize(*x,x->dual(),*l,l->dual(),*obj,*con,*bnd,algo_state);
231 if( con == ROL::nullPtr ) {
232 if( bnd == ROL::nullPtr ) {
233 bnd = ROL::makePtr<BoundConstraint<Real>>();
236 compute(s,*x, *obj, *bnd, algo_state);
239 if( bnd == ROL::nullPtr ) {
240 compute(s,*x,*l,*obj,*con,algo_state);
242 compute(s,*x,*l,*obj,*con,*bnd,algo_state);
256 if( con == ROL::nullPtr ) {
257 if( bnd == ROL::nullPtr ) {
258 bnd = ROL::makePtr<BoundConstraint<Real>>();
261 update(*x, s, *obj, *bnd, algo_state);
264 if( bnd == ROL::nullPtr ) {
265 update(*x,*l,s,*obj,*con,algo_state);
267 update(*x,*l,s,*obj,*con,*bnd,algo_state);
299 void reset(
const Real searchSize = 1.0) {
300 state_->reset(searchSize);
Provides the interface to evaluate objective functions.
virtual void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update step, if successful.
virtual void initialize(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
Initialize step with equality constraint.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual std::string printHeader(void) const
Print iterate header.
virtual void compute(Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
Compute step (equality constraints).
void compute(Vector< Real > &s, OptimizationProblem< Real > &opt, AlgorithmState< Real > &algo_state)
bool isActivated(void) const
Check if bounds are on.
void initialize(OptimizationProblem< Real > &opt, AlgorithmState< Real > &algo_state)
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
Provides the interface to compute optimization steps.
Contains definitions of custom data types in ROL.
virtual Ptr< Objective< Real > > getObjective(void)
virtual Ptr< BoundConstraint< Real > > getBoundConstraint(void)
virtual void initialize(Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Initialize step with bound constraint.
Defines the linear algebra or vector space interface.
virtual void compute(Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step (equality constraints).
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
virtual std::string print(AlgorithmState< Real > &algo_state, bool printHeader=false) const
Print iterate status.
void update(OptimizationProblem< Real > &opt, const Vector< Real > &s, AlgorithmState< Real > &algo_state)
State for algorithm class. Will be used for restarts.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void update(Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, Constraint< Real > &con, AlgorithmState< Real > &algo_state)
Update step, if successful (equality constraints).
void reset(const Real searchSize=1.0)
Get state for step object.
ROL::Ptr< StepState< Real > > getState(void)
ROL::Ptr< StepState< Real > > state_
virtual Ptr< Vector< Real > > getSolutionVector(void)
virtual Ptr< Vector< Real > > getMultiplierVector(void)
Provides the interface to apply upper and lower bound constraints.
virtual void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step.
virtual void initialize(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Initialize step with equality constraint.
virtual void update(Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, Constraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update step, if successful (equality constraints).
virtual void initialize(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Initialize step with bound constraint.
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
Defines the general constraint operator interface.
virtual void project(Vector< Real > &x)
Project optimization variables onto the bounds.
virtual std::string printName(void) const
Print step name.
virtual Ptr< Constraint< Real > > getConstraint(void)
const ROL::Ptr< const StepState< Real > > getStepState(void) const
Get state for step object.