59 #include "ROL_Sacado_Objective.hpp"
64 #include "Teuchos_oblackholestream.hpp"
65 #include "Teuchos_GlobalMPISession.hpp"
66 #include "Teuchos_XMLParameterListHelpers.hpp"
74 int main(
int argc,
char **argv)
76 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
79 int iprint = argc - 1;
80 Teuchos::RCP<std::ostream> outStream;
81 Teuchos::oblackholestream bhs;
83 outStream = Teuchos::rcp(&std::cout,
false);
85 outStream = Teuchos::rcp(&bhs,
false);
93 Sacado_Objective<RealT,Zakharov> obj;
98 Teuchos::RCP<Teuchos::ParameterList> parlist = Teuchos::rcp(
new Teuchos::ParameterList());
99 std::string paramfile =
"parameters.xml";
100 Teuchos::updateParametersFromXmlFile(paramfile,Teuchos::Ptr<Teuchos::ParameterList>(&*parlist));
115 Teuchos::RCP<std::vector<RealT> > x_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
117 for (
int i=0; i<dim; i++) {
124 std::vector<std::string> output = algo.
run(x, obj,
false);
125 for (
unsigned i = 0; i < output.size(); i++ ) {
126 std::cout << output[i];
130 Teuchos::RCP<std::vector<RealT> > xtrue_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
137 *outStream << std::scientific <<
"\n Absolute Error: " << abserr;
142 catch (std::logic_error err) {
143 *outStream << err.what() <<
"\n";
148 std::cout <<
"End Result: TEST FAILED\n";
150 std::cout <<
"End Result: TEST PASSED\n";
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
int main(int argc, char **argv)
Provides the interface to compute optimization steps with line search.
Real norm() const
Returns where .
Provides the std::vector implementation of the ROL::Vector interface.
virtual std::vector< std::string > run(Vector< Real > &x, Objective< Real > &obj, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface.
Provides an interface to check status of optimization algorithms.
static const double ROL_EPSILON
Platform-dependent machine epsilon.