50 #include "Teuchos_GlobalMPISession.hpp"
51 #include "Teuchos_XMLParameterListHelpers.hpp"
57 int main(
int argc,
char *argv[]) {
59 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
62 int iprint = argc - 1;
63 ROL::Ptr<std::ostream> outStream;
66 outStream = ROL::makePtrFromRef(std::cout);
68 outStream = ROL::makePtrFromRef(bhs);
75 std::string filename =
"input.xml";
76 auto parlist = ROL::getParametersFromXmlFile( filename );
79 ROL::Ptr<ROL::Vector<RealT>> x0;
80 std::vector<ROL::Ptr<ROL::Vector<RealT>>> z;
81 ROL::Ptr<ROL::OptimizationProblem<RealT>> optProblem;
88 int dim = x0->dimension();
89 parlist->sublist(
"General").sublist(
"Krylov").set(
"Iteration Limit", 2*dim);
92 optProblem->check(*outStream);
99 parlist->sublist(
"Status Test").set(
"Gradient Tolerance",static_cast<RealT>(1e-6));
100 parlist->sublist(
"Step").set(
"Type",
"Augmented Lagrangian");
102 optSolver.
solve(*outStream);
121 catch (std::logic_error& err) {
122 *outStream << err.what() << std::endl;
127 std::cout <<
"End Result: TEST FAILED" << std::endl;
129 std::cout <<
"End Result: TEST PASSED" << std::endl;
Contains definitions of test objective functions.
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
Provides a simplified interface for solving a wide range of optimization problems.
basic_nullstream< char, char_traits< char >> nullstream
int main(int argc, char *argv[])
int solve(const ROL::Ptr< StatusTest< Real > > &status=ROL::nullPtr, const bool combineStatus=true)
Solve optimization problem with no iteration output.