54 #include "Teuchos_GlobalMPISession.hpp"
59 ROL::Ptr<const std::vector<Real> > xp =
62 outStream <<
"Standard Vector" << std::endl;
63 for(
size_t i=0; i<xp->size(); ++i ) {
64 outStream << (*xp)[i] << std::endl;
72 int main(
int argc,
char *argv[]) {
79 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
82 int iprint = argc - 1;
83 ROL::Ptr<std::ostream> outStream;
86 outStream = ROL::makePtrFromRef(std::cout);
88 outStream = ROL::makePtrFromRef(bhs);
96 RealT tol = std::sqrt(ROL::ROL_EPSILON<RealT>());
98 ROL::Ptr<V> v = ROL::makePtr<SV>( ROL::makePtr<std::vector<RealT>>(dim) );
99 ROL::Ptr<V> Hv = v->clone();
100 ROL::Ptr<V> HHv = v->clone();
102 ROL::Ptr<V> e0 = v->basis(0);
113 H.
apply(*Hv, *v, tol);
117 H.
apply(*HHv, *Hv, tol);
123 catch (std::logic_error err) {
124 *outStream << err.what() <<
"\n";
129 std::cout <<
"End Result: TEST FAILED\n";
131 std::cout <<
"End Result: TEST PASSED\n";
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...
Provides the interface to create a Householder reflector operator, that when applied to a vector x...
void printVector(const ROL::Vector< Real > &x, std::ostream &outStream)
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
basic_nullstream< char, char_traits< char >> nullstream
int main(int argc, char *argv[])