53 #include "Teuchos_oblackholestream.hpp" 54 #include "Teuchos_GlobalMPISession.hpp" 59 Teuchos::RCP<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[]) {
77 using Teuchos::RCP;
using Teuchos::rcp;
79 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
82 int iprint = argc - 1;
83 Teuchos::RCP<std::ostream> outStream;
84 Teuchos::oblackholestream bhs;
86 outStream = Teuchos::rcp(&std::cout,
false);
88 outStream = Teuchos::rcp(&bhs,
false);
96 RealT tol = std::sqrt(ROL::ROL_EPSILON<RealT>());
99 RCP<V> v = rcp(
new SV( rcp(
new std::vector<RealT>(dim) ) ) );
100 RCP<V> Hv = v->clone();
101 RCP<V> HHv = v->clone();
103 RCP<V> e0 = v->basis(0);
114 H.
apply(*Hv, *v, tol);
118 H.
apply(*HHv, *Hv, tol);
126 catch (std::logic_error err) {
127 *outStream << err.what() <<
"\n";
132 std::cout <<
"End Result: TEST FAILED\n";
134 std::cout <<
"End Result: TEST PASSED\n";
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
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.
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)
int main(int argc, char *argv[])