19 #include "Teuchos_GlobalMPISession.hpp"
25 int main(
int argc,
char *argv[]) {
27 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
34 int iprint = argc - 1;
35 ROL::Ptr<std::ostream> outStream;
38 outStream = ROL::makePtrFromRef(std::cout);
40 outStream = ROL::makePtrFromRef(bhs);
44 oldFormatState.copyfmt(std::cout);
55 ROL::Ptr<V> a = ROL::makePtr<ROL::StdVector<RealT>>( ROL::makePtr<std::vector<RealT>>(xdim) );
56 ROL::Ptr<V> c = ROL::makePtr<ROL::SingletonVector<RealT>>( 0.0 );
58 ROL::Ptr<V> x = a->clone();
59 ROL::Ptr<V> d = x->clone();
60 ROL::Ptr<V> v = c->clone();
69 std::cout <<
"a = "; a->print(*outStream); std::cout << std::endl;
70 std::cout <<
"x = "; x->print(*outStream); std::cout << std::endl;
71 std::cout <<
"d = "; d->print(*outStream); std::cout << std::endl;
72 std::cout <<
"v = "; v->print(*outStream); std::cout << std::endl;
83 catch (std::logic_error& err) {
84 *outStream << err.what() <<
"\n";
89 std::cout <<
"End Result: TEST FAILED\n";
91 std::cout <<
"End Result: TEST PASSED\n";
94 std::cout.copyfmt(oldFormatState);
virtual Real checkAdjointConsistencyJacobian(const Vector< Real > &w, const Vector< Real > &v, const Vector< Real > &x, const bool printToStream=true, std::ostream &outStream=std::cout)
void RandomizeVector(Vector< Real > &x, const Real &lower=0.0, const Real &upper=1.0)
Fill a ROL::Vector with uniformly-distributed random numbers in the interval [lower,upper].
Defines the linear algebra or vector space interface.
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
This equality constraint defines an affine hyperplane.
basic_nullstream< char, std::char_traits< char >> nullstream
virtual std::vector< std::vector< Real > > checkApplyAdjointHessian(const Vector< Real > &x, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &hv, const std::vector< Real > &step, const bool printToScreen=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference check for the application of the adjoint of constraint Hessian. ...
virtual std::vector< std::vector< Real > > checkApplyJacobian(const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &jv, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference check for the constraint Jacobian application.
int main(int argc, char *argv[])