53 #include "Teuchos_GlobalMPISession.hpp"
59 int main(
int argc,
char *argv[]) {
61 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
68 int iprint = argc - 1;
69 ROL::Ptr<std::ostream> outStream;
72 outStream = ROL::makePtrFromRef(std::cout);
74 outStream = ROL::makePtrFromRef(bhs);
78 oldFormatState.copyfmt(std::cout);
89 ROL::Ptr<V> a = ROL::makePtr<ROL::StdVector<RealT>>( ROL::makePtr<std::vector<RealT>>(xdim) );
90 ROL::Ptr<V> c = ROL::makePtr<ROL::SingletonVector<RealT>>( 0.0 );
92 ROL::Ptr<V> x = a->clone();
93 ROL::Ptr<V> d = x->clone();
94 ROL::Ptr<V> v = c->clone();
103 std::cout <<
"a = "; a->print(*outStream); std::cout << std::endl;
104 std::cout <<
"x = "; x->print(*outStream); std::cout << std::endl;
105 std::cout <<
"d = "; d->print(*outStream); std::cout << std::endl;
106 std::cout <<
"v = "; v->print(*outStream); std::cout << std::endl;
117 catch (std::logic_error err) {
118 *outStream << err.what() <<
"\n";
123 std::cout <<
"End Result: TEST FAILED\n";
125 std::cout <<
"End Result: TEST PASSED\n";
128 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.
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.
basic_nullstream< char, char_traits< char >> nullstream
int main(int argc, char *argv[])