64 #include "Teuchos_oblackholestream.hpp"
65 #include "Teuchos_GlobalMPISession.hpp"
66 #include "Teuchos_XMLParameterListHelpers.hpp"
73 int main(
int argc,
char **argv)
75 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
78 int iprint = argc - 1;
79 Teuchos::RCP<std::ostream> outStream;
80 Teuchos::oblackholestream bhs;
82 outStream = Teuchos::rcp(&std::cout,
false);
84 outStream = Teuchos::rcp(&bhs,
false);
92 typedef Sacado::Fad::SFad<RealT,1> FadType;
93 typedef Sacado::Fad::DFad<FadType> FadFadType;
101 auto parlist = Teuchos::rcp(
new Teuchos::ParameterList());
103 std::string paramfile =
"parameters.xml";
105 Teuchos::updateParametersFromXmlFile(paramfile,Teuchos::Ptr<Teuchos::ParameterList>(&*parlist));
120 auto x_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
122 for (
int i=0; i<dim; i++) {
129 std::vector<std::string> output = algo.
run(x, *obj,
false);
130 for (
unsigned i = 0; i < output.size(); i++ ) {
131 std::cout << output[i];
135 auto xtrue_rcp = Teuchos::rcp(
new std::vector<RealT> (dim, 0.0) );
142 *outStream << std::scientific <<
"\n Absolute Error: " << abserr;
147 catch (std::logic_error err) {
148 *outStream << err.what() <<
"\n";
153 std::cout <<
"End Result: TEST FAILED\n";
155 std::cout <<
"End Result: TEST PASSED\n";
int main(int argc, char **argv)
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.
static const double ROL_EPSILON
Platform-dependent machine epsilon.