17 #include "Teuchos_GlobalMPISession.hpp"
18 #include "Teuchos_XMLParameterListHelpers.hpp"
24 int main(
int argc,
char *argv[]) {
26 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
29 int iprint = argc - 1;
30 ROL::Ptr<std::ostream> outStream;
33 outStream = ROL::makePtrFromRef(std::cout);
35 outStream = ROL::makePtrFromRef(bhs);
42 std::string filename =
"input.xml";
43 auto parlist = ROL::getParametersFromXmlFile( filename );
46 ROL::Ptr<ROL::Vector<RealT>> x0;
47 std::vector<ROL::Ptr<ROL::Vector<RealT>>> z;
48 ROL::Ptr<ROL::OptimizationProblem<RealT>> optProblem;
56 optProblem->check(*outStream);
63 parlist->sublist(
"Status Test").set(
"Gradient Tolerance",static_cast<RealT>(1e-6));
64 parlist->sublist(
"Step").set(
"Type",
"Fletcher");
66 optSolver.
solve(*outStream);
85 catch (std::logic_error& err) {
86 *outStream << err.what() << std::endl;
91 std::cout <<
"End Result: TEST FAILED" << std::endl;
93 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.