44 #ifndef ROL_ALGORITHM_H
45 #define ROL_ALGORITHM_H
64 Teuchos::RCP<Step<Real> >
step_;
66 Teuchos::RCP<AlgorithmState<Real> >
state_;
75 step_ = Teuchos::rcp(&step,
false);
76 status_ = Teuchos::rcp(&status,
false);
82 bool printHeader =
false ) {
83 step_ = Teuchos::rcp(&step,
false);
84 status_ = Teuchos::rcp(&status,
false);
85 state_ = Teuchos::rcp(&state,
false);
95 std::ostream &outStream = std::cout ) {
98 return run(x,x.
dual(),obj,con,print,outStream);
109 std::ostream &outStream = std::cout ) {
112 return run(x,g,obj,con,print,outStream);
122 std::ostream &outStream = std::cout ) {
123 return run(x,x.
dual(),obj,con,print,outStream);
135 std::ostream &outStream = std::cout ) {
136 std::vector<std::string> output;
139 if (
state_->iterateVec == Teuchos::null ) {
141 state_->iterateVec->set(x);
145 Teuchos::RCP<Vector<Real> > s = x.
clone();
155 if (
state_->minIterVec == Teuchos::null ) {
157 state_->minIterVec->set(x);
190 std::ostream &outStream = std::cout ) {
192 return run(x, x.
dual(), l, l.
dual(), obj, con, print, outStream);
208 std::ostream &outStream = std::cout ) {
209 std::vector<std::string> output;
212 if (
state_->iterateVec == Teuchos::null ) {
214 state_->iterateVec->set(x);
218 if (
state_->lagmultVec == Teuchos::null ) {
220 state_->lagmultVec->set(l);
224 Teuchos::RCP<Vector<Real> > s = x.
clone();
257 std::ostream &outStream = std::cout ) {
258 std::vector<std::string> output;
261 if (
state_->iterateVec == Teuchos::null ) {
263 state_->iterateVec->set(x);
267 if (
state_->lagmultVec == Teuchos::null ) {
269 state_->lagmultVec->set(l);
273 Teuchos::RCP<Vector<Real> > s = x.
clone();
276 step_->initialize(x, g, l, c, obj, con, bnd, *
state_);
295 return step_->printHeader();
302 Teuchos::RCP<const AlgorithmState<Real> >
getState(
void)
const {
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...
DefaultAlgorithm(Step< Real > &step, StatusTest< Real > &status, bool printHeader=false)
Provides the interface to compute optimization steps.
Contains definitions of custom data types in ROL.
Teuchos::RCP< const AlgorithmState< Real > > getState(void) const
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual std::vector< std::string > run(Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on bound constrained problems (Type-B). This is the primary Type-B interface.
Defines the linear algebra or vector space interface.
DefaultAlgorithm(Step< Real > &step, StatusTest< Real > &status, AlgorithmState< Real > &state, bool printHeader=false)
virtual std::vector< std::string > run(Vector< Real > &x, Vector< Real > &l, Objective< Real > &obj, EqualityConstraint< Real > &con, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on equality constrained problems (Type-E). This is the primary Type-E interface...
State for algorithm class. Will be used for restarts.
Defines the equality constraint operator interface.
virtual std::vector< std::string > run(Vector< Real > &x, Objective< Real > &obj, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface.
virtual std::vector< std::string > run(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, EqualityConstraint< Real > &con, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on equality constrained problems (Type-E). This general interface supports the use of d...
virtual std::vector< std::string > run(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, EqualityConstraint< Real > &con, BoundConstraint< Real > &bnd, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on equality constrained problems (Type-E). This general interface supports the use of d...
virtual std::vector< std::string > run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &con, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on bound constrained problems (Type-B). This general interface supports the use of dual...
Provides an interface to check status of optimization algorithms.
virtual std::vector< std::string > run(Vector< Real > &x, const Vector< Real > &g, Objective< Real > &obj, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on unconstrained problems (Type-U). This general interface supports the use of dual opt...
virtual ~DefaultAlgorithm()
Provides the interface to apply upper and lower bound constraints.
std::string getIterHeader(void)
std::string getIterInfo(bool withHeader=false)
Teuchos::RCP< Step< Real > > step_
Teuchos::RCP< StatusTest< Real > > status_
void deactivate(void)
Turn off bounds.
Teuchos::RCP< AlgorithmState< Real > > state_