14 #include "Teuchos_GlobalMPISession.hpp"
20 int main(
int argc,
char *argv[]) {
30 typedef ROL::InequalityConstraint<RealT> INEQ;
34 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
36 int iprint = argc - 1;
37 ROL::Ptr<std::ostream> outStream;
40 outStream = ROL::makePtrFromRef(std::cout);
42 outStream = ROL::makePtrFromRef(bhs);
60 std::string stepname =
"Interior Point";
66 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Initial Barrier Penalty",mu);
67 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Minimium Barrier Penalty",1e-8);
68 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Barrier Penalty Reduction Factor",factor);
69 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Subproblem Iteration Limit",30);
71 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Optimality System Solver").set(
"Nominal Relative Tolerance",1.e-4);
72 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Optimality System Solver").set(
"Fix Tolerance",
true);
73 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Tangential Subproblem Solver").set(
"Iteration Limit",20);
74 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Tangential Subproblem Solver").set(
"Relative Tolerance",1e-2);
75 parlist->sublist(
"Step").sublist(
"Composite Step").set(
"Output Level",0);
77 parlist->sublist(
"Status Test").set(
"Gradient Tolerance",1.e-12);
78 parlist->sublist(
"Status Test").set(
"Constraint Tolerance",1.e-8);
79 parlist->sublist(
"Status Test").set(
"Step Tolerance",1.e-8);
80 parlist->sublist(
"Status Test").set(
"Iteration Limit",100);
85 ROL::Ptr<V> d = x->clone();
92 ROL::Ptr<ROL::Algorithm<RealT> > algo;
93 algo = ROL::makePtr<ROL::Algorithm<RealT>>(stepname,*parlist);
95 algo->run(problem,
true,*outStream);
99 if( x->norm()>= 1e-4 )
105 catch (std::logic_error& err) {
106 *outStream << err.what() <<
"\n";
111 std::cout <<
"End Result: TEST FAILED\n";
113 std::cout <<
"End Result: TEST PASSED\n";
Provides the interface to evaluate objective functions.
Ptr< Vector< Real > > getInitialGuess(void) const
Ptr< Constraint< Real > > getInequalityConstraint(void) const
void RandomizeVector(Vector< Real > &x, const Real &lower=0.0, const Real &upper=1.0)
Fill a ROL::Vector with uniformly-distributed random numbers in the interval [lower,upper].
Defines the linear algebra or vector space interface.
basic_nullstream< char, std::char_traits< char >> nullstream
Ptr< Vector< Real > > getInequalityMultiplier(void) const
Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Contains definitions for W. Hock and K. Schittkowski 24th test problem which contains bound and inequ...
Provides the interface to apply upper and lower bound constraints.
int main(int argc, char *argv[])
Ptr< Objective< Real > > getObjective(void) const
Ptr< Vector< Real > > getSolution(const int i=0) const
Ptr< BoundConstraint< Real > > getSlackBoundConstraint(void) const