20 #include "Teuchos_GlobalMPISession.hpp"
25 ROL::Ptr<const std::vector<Real> > xp =
28 outStream <<
"Standard Vector" << std::endl;
29 for(
size_t i=0; i<xp->size(); ++i ) {
30 outStream << (*xp)[i] << std::endl;
38 int main(
int argc,
char *argv[]) {
45 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
48 int iprint = argc - 1;
49 ROL::Ptr<std::ostream> outStream;
52 outStream = ROL::makePtrFromRef(std::cout);
54 outStream = ROL::makePtrFromRef(bhs);
62 RealT tol = std::sqrt(ROL::ROL_EPSILON<RealT>());
64 ROL::Ptr<V> v = ROL::makePtr<SV>( ROL::makePtr<std::vector<RealT>>(
dim) );
65 ROL::Ptr<V> Hv = v->clone();
66 ROL::Ptr<V> HHv = v->clone();
68 ROL::Ptr<V> e0 = v->basis(0);
79 H.
apply(*Hv, *v, tol);
83 H.
apply(*HHv, *Hv, tol);
89 catch (std::logic_error& err) {
90 *outStream << err.what() <<
"\n";
95 std::cout <<
"End Result: TEST FAILED\n";
97 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[])