57 int main(
int argc,
char *argv[]) {
59 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
62 int iprint = argc - 1;
63 Teuchos::RCP<std::ostream> outStream;
64 Teuchos::oblackholestream bhs;
66 outStream = Teuchos::rcp(&std::cout,
false);
68 outStream = Teuchos::rcp(&bhs,
false);
71 Teuchos::RCP<ROL::Vector<RealT> > x0, x;
72 Teuchos::RCP<ROL::Objective<RealT> > obj;
73 Teuchos::RCP<ROL::BoundConstraint<RealT> > bnd;
82 step.
compute(*x0,*x,*obj,*bnd,algo_state);
85 *outStream << exc.what() << std::endl;
89 step.
update(*x0,*x,*obj,*bnd,algo_state);
92 *outStream << exc.what() << std::endl;
99 *outStream << exc.what() << std::endl;
106 *outStream << exc.what() << std::endl;
110 step.
print(algo_state,
true);
113 *outStream << exc.what() << std::endl;
116 errorFlag = (thrown==5) ? 0 : 1;
118 catch (std::logic_error err) {
119 *outStream << err.what() << std::endl;
124 std::cout <<
"End Result: TEST FAILED" << std::endl;
126 std::cout <<
"End Result: TEST PASSED" << std::endl;
virtual std::string printHeader(void) const
Print iterate header.
virtual void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update step, if successful.
Provides the interface to compute optimization steps.
Contains definitions of test objective functions.
State for algorithm class. Will be used for restarts.
int main(int argc, char *argv[])
virtual void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step.
virtual std::string print(AlgorithmState< Real > &algo_state, bool printHeader=false) const
Print iterate status.
virtual std::string printName(void) const
Print step name.