58 #include "Teuchos_oblackholestream.hpp" 59 #include "Teuchos_GlobalMPISession.hpp" 60 #include "Teuchos_XMLParameterListHelpers.hpp" 68 int main(
int argc,
char **argv)
70 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
73 int iprint = argc - 1;
74 Teuchos::RCP<std::ostream> outStream;
75 Teuchos::oblackholestream bhs;
77 outStream = Teuchos::rcp(&std::cout,
false);
79 outStream = Teuchos::rcp(&bhs,
false);
92 Teuchos::RCP<Teuchos::ParameterList> parlist = Teuchos::rcp(
new Teuchos::ParameterList());
93 std::string paramfile =
"parameters.xml";
94 Teuchos::updateParametersFromXmlFile(paramfile,parlist.ptr());
100 Teuchos::RCP<std::vector<RealT> > x_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
102 for (
int i=0; i<dim; i++) {
109 algo.run(x, obj,
true, *outStream);
112 Teuchos::RCP<std::vector<RealT> > xtrue_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
119 *outStream << std::scientific <<
"\n Absolute Error: " << abserr;
124 catch (std::logic_error err) {
125 *outStream << err.what() <<
"\n";
130 std::cout <<
"End Result: TEST FAILED\n";
132 std::cout <<
"End Result: TEST PASSED\n";
void axpy(const Real alpha, const Vector< Real > &x)
Compute where .
Real norm() const
Returns where .
Provides the std::vector implementation of the ROL::Vector interface.
Provides an interface to run optimization algorithms.
int main(int argc, char **argv)
static const double ROL_EPSILON
Platform-dependent machine epsilon.