57 #include "Teuchos_oblackholestream.hpp"
58 #include "Teuchos_GlobalMPISession.hpp"
59 #include "Teuchos_XMLParameterListHelpers.hpp"
67 int main(
int argc,
char **argv)
69 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
72 int iprint = argc - 1;
73 Teuchos::RCP<std::ostream> outStream;
74 Teuchos::oblackholestream bhs;
76 outStream = Teuchos::rcp(&std::cout,
false);
78 outStream = Teuchos::rcp(&bhs,
false);
91 Teuchos::RCP<Teuchos::ParameterList> parlist = Teuchos::rcp(
new Teuchos::ParameterList());
92 std::string paramfile =
"parameters.xml";
93 Teuchos::updateParametersFromXmlFile(paramfile,Teuchos::Ptr<Teuchos::ParameterList>(&*parlist));
108 Teuchos::RCP<std::vector<RealT> > x_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
110 for (
int i=0; i<dim; i++) {
117 std::vector<std::string> output = algo.
run(x, obj,
false);
118 for (
unsigned i = 0; i < output.size(); i++ ) {
119 std::cout << output[i];
123 Teuchos::RCP<std::vector<RealT> > xtrue_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
130 *outStream << std::scientific <<
"\n Absolute Error: " << abserr;
135 catch (std::logic_error err) {
136 *outStream << err.what() <<
"\n";
141 std::cout <<
"End Result: TEST FAILED\n";
143 std::cout <<
"End Result: TEST PASSED\n";
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
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.
int main(int argc, char **argv)
static const double ROL_EPSILON
Platform-dependent machine epsilon.