53#include "ROL_ParameterList.hpp"
82 state_ = ROL::makePtr<StepState<Real>>();
88 virtual void initialize( Vector<Real> &x,
const Vector<Real> &g,
89 Objective<Real> &obj, BoundConstraint<Real> &con,
90 AlgorithmState<Real> &algo_state ) {
96 virtual void initialize( Vector<Real> &x,
const Vector<Real> &s,
const Vector<Real> &g,
97 Objective<Real> &obj, BoundConstraint<Real> &con,
98 AlgorithmState<Real> &algo_state ) {
99 Real tol = std::sqrt(ROL_EPSILON<Real>()), one(1),
zero(0);
101 state_->descentVec = s.clone();
102 state_->gradientVec = g.clone();
103 state_->searchSize =
zero;
105 if ( con.isActivated() ) {
109 obj.update(x,
true,algo_state.iter);
110 algo_state.value = obj.value(x,tol);
112 obj.gradient(*(state_->gradientVec),x,tol);
114 if ( con.isActivated() ) {
115 ROL::Ptr<Vector<Real> > xnew = x.clone();
120 algo_state.gnorm = xnew->norm();
123 algo_state.gnorm = (state_->gradientVec)->norm();
129 virtual void initialize( Vector<Real> &x,
const Vector<Real> &g, Vector<Real> &l,
const Vector<Real> &c,
130 Objective<Real> &obj, Constraint<Real> &con,
131 AlgorithmState<Real> &algo_state ) {
136 virtual void initialize( Vector<Real> &x,
const Vector<Real> &g, Vector<Real> &l,
const Vector<Real> &c,
137 Objective<Real> &obj, Constraint<Real> &con, BoundConstraint<Real> &bnd,
138 AlgorithmState<Real> &algo_state ) {
143 virtual void compute( Vector<Real> &s,
const Vector<Real> &x,
144 Objective<Real> &obj, BoundConstraint<Real> &bnd,
145 AlgorithmState<Real> &algo_state ) {
146 throw Exception::NotImplemented(
">>> ROL::Step::compute(s,x,obj,bnd,algo_state) is not implemented!");
151 virtual void update( Vector<Real> &x,
const Vector<Real> &s,
152 Objective<Real> &obj, BoundConstraint<Real> &bnd,
153 AlgorithmState<Real> &algo_state ) {
154 throw Exception::NotImplemented(
">>> ROL::Step::update(x,s,obj,bnd,algo_state) is not implemented!");
159 virtual void compute( Vector<Real> &s,
const Vector<Real> &x,
const Vector<Real> &l,
160 Objective<Real> &obj, Constraint<Real> &con,
161 AlgorithmState<Real> &algo_state ) {
162 throw Exception::NotImplemented(
">>> ROL::Step::compute(s,x,l,obj,con,algo_state) is not implemented!");
167 virtual void update( Vector<Real> &x, Vector<Real> &l,
const Vector<Real> &s,
168 Objective<Real> &obj, Constraint<Real> &con,
169 AlgorithmState<Real> &algo_state ) {
170 throw Exception::NotImplemented(
">>> ROL::Step::update(x,s,l,obj,bnd,con,algo_state) is not implemented!");
175 virtual void compute( Vector<Real> &s,
const Vector<Real> &x,
const Vector<Real> &l,
176 Objective<Real> &obj, Constraint<Real> &con,
177 BoundConstraint<Real> &bnd,
178 AlgorithmState<Real> &algo_state ) {
179 throw Exception::NotImplemented(
">>> ROL::Step::compute(s,x,l,obj,bnd,con,algo_state) is not implemented!");
184 virtual void update( Vector<Real> &x, Vector<Real> &l,
const Vector<Real> &s,
185 Objective<Real> &obj, Constraint<Real> &con,
186 BoundConstraint<Real> &bnd,
187 AlgorithmState<Real> &algo_state ) {
188 throw Exception::NotImplemented(
">>> ROL::Step::update(x,s,l,obj,bnd,con,algo_state) is not implemented!");
194 throw Exception::NotImplemented(
">>> ROL::Step::printHeader() is not implemented!");
200 throw Exception::NotImplemented(
">>> ROL::Step::printName() is not implemented!");
205 virtual std::string
print( AlgorithmState<Real> &algo_state,
bool printHeader =
false )
const {
206 throw Exception::NotImplemented(
">>> ROL::Step::print(algo_state,printHeader) is not implemented!");
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0 zero)()
Contains definitions of custom data types in ROL.
ROL::Ptr< Vector< Real > > gradientVec
Provides an interface to run optimization algorithms.
Provides the interface to compute optimization steps.
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.
void reset(const Real searchSize=1.0)
Get state for step object.
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 std::string printHeader(void) const
Print iterate header.
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 std::string print(AlgorithmState< Real > &algo_state, bool printHeader=false) const
Print iterate status.
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 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).
ROL::Ptr< StepState< Real > > getState(void)
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).
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).
virtual std::string printName(void) const
Print step name.
ROL::Ptr< StepState< Real > > state_
const ROL::Ptr< const StepState< Real > > getStepState(void) const
Get state for step object.
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.
virtual void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step.