49 #include "Teuchos_GlobalMPISession.hpp"
55 int main(
int argc,
char *argv[]) {
65 typedef ROL::InequalityConstraint<RealT> INEQ;
69 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
71 int iprint = argc - 1;
72 ROL::Ptr<std::ostream> outStream;
75 outStream = ROL::makePtrFromRef(std::cout);
77 outStream = ROL::makePtrFromRef(bhs);
95 std::string stepname =
"Interior Point";
101 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Initial Barrier Penalty",mu);
102 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Minimium Barrier Penalty",1e-8);
103 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Barrier Penalty Reduction Factor",factor);
104 parlist->sublist(
"Step").sublist(
"Interior Point").set(
"Subproblem Iteration Limit",30);
106 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Optimality System Solver").set(
"Nominal Relative Tolerance",1.e-4);
107 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Optimality System Solver").set(
"Fix Tolerance",
true);
108 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Tangential Subproblem Solver").set(
"Iteration Limit",20);
109 parlist->sublist(
"Step").sublist(
"Composite Step").sublist(
"Tangential Subproblem Solver").set(
"Relative Tolerance",1e-2);
110 parlist->sublist(
"Step").sublist(
"Composite Step").set(
"Output Level",0);
112 parlist->sublist(
"Status Test").set(
"Gradient Tolerance",1.e-12);
113 parlist->sublist(
"Status Test").set(
"Constraint Tolerance",1.e-8);
114 parlist->sublist(
"Status Test").set(
"Step Tolerance",1.e-8);
115 parlist->sublist(
"Status Test").set(
"Iteration Limit",100);
120 ROL::Ptr<V> d = x->clone();
127 ROL::Ptr<ROL::Algorithm<RealT> > algo;
128 algo = ROL::makePtr<ROL::Algorithm<RealT>>(stepname,*parlist);
130 algo->run(problem,
true,*outStream);
134 if( x->norm()>= 1e-4 )
140 catch (std::logic_error& err) {
141 *outStream << err.what() <<
"\n";
146 std::cout <<
"End Result: TEST FAILED\n";
148 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.
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.
basic_nullstream< char, char_traits< char >> nullstream
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