54 #include "Teuchos_XMLParameterListHelpers.hpp" 55 #include "Teuchos_oblackholestream.hpp" 56 #include "Teuchos_GlobalMPISession.hpp" 65 int main(
int argc,
char *argv[]) {
67 using Teuchos::RCP;
using Teuchos::rcp;
68 using Teuchos::ParameterList;
70 typedef std::vector<RealT> vector;
75 Teuchos::GlobalMPISession mpiSession(&argc, &argv,0);
77 int iprint = argc - 1;
78 Teuchos::RCP<std::ostream> outStream;
79 Teuchos::oblackholestream bhs;
81 outStream = Teuchos::rcp(&std::cout,
false);
83 outStream = Teuchos::rcp(&bhs,
false);
91 RCP<ParameterList> parlist = rcp(
new ParameterList());
92 std::string paramfile =
"parameters.xml";
93 updateParametersFromXmlFile(paramfile,parlist.ptr());
98 RCP<vector> x_rcp = rcp(
new vector(dim,1.0) );
99 RCP<vector> k_rcp = rcp(
new vector(dim) );
101 for(
int i=0;i<dim;++i) {
102 (*k_rcp)[i] = 1.0 + i;
105 RCP<V> xs = rcp(
new SV(x_rcp) );
106 RCP<V> ks = rcp(
new SV(k_rcp) );
115 algo.run(xpf, obj,
true, *outStream);
121 catch (std::logic_error err) {
122 *outStream << err.what() <<
"\n";
127 std::cout <<
"End Result: TEST FAILED\n";
129 std::cout <<
"End Result: TEST PASSED\n";
Defines the linear algebra or vector space interface.
Provides the std::vector implementation of the ROL::Vector interface.
Provides an interface to run optimization algorithms.
void printVectorFunctionCalls(const ProfiledVector< Ordinal, Real > &x, std::ostream &outStream=std::cout)
Contains definitions for the Zakharov function as evaluated using only the ROL::Vector interface...
By keeping a pointer to this in a derived Vector class, a tally of all methods is kept for profiling ...
int main(int argc, char *argv[])