59 #include "ROL_Sacado_Objective.hpp"
64 #include "ROL_ParameterList.hpp"
67 #include "Teuchos_GlobalMPISession.hpp"
75 int main(
int argc,
char **argv)
77 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
80 int iprint = argc - 1;
81 ROL::Ptr<std::ostream> outStream;
84 outStream = ROL::makePtrFromRef(std::cout);
86 outStream = ROL::makePtrFromRef(bhs);
94 Sacado_Objective<RealT,Zakharov> obj;
99 std::string paramfile =
"parameters.xml";
100 auto parlist = ROL::getParametersFromXmlFile(paramfile);
106 ROL::Ptr<std::vector<RealT> > x_ptr = ROL::makePtr<std::vector<RealT>>(dim, 0.0);
108 for (
int i=0; i<dim; i++) {
115 algo.
run(x, obj,
true, *outStream);
118 ROL::Ptr<std::vector<RealT> > xtrue_ptr = ROL::makePtr<std::vector<RealT>>(dim, 0.0);
124 *outStream << std::scientific <<
"\n Absolute Error: " << abserr << std::endl;
125 if ( abserr > sqrt(ROL_EPSILON<RealT>()) ) {
129 catch (std::logic_error err) {
130 *outStream << err.what() <<
"\n";
135 std::cout <<
"End Result: TEST FAILED\n";
137 std::cout <<
"End Result: TEST PASSED\n";