10#include "Teuchos_GlobalMPISession.hpp"
23using size_type =
typename std::vector<RealT>::size_type;
30template<
typename Real>
44 auto result = 0.25*( w->dot(*w) - z->dot(*z) );
59int main(
int argc,
char* argv[] ) {
63 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
77 auto xp = makePtr<std::vector<RealT>>(N);
78 auto x = makePtr<StdVector<RealT>>(xp);
87 auto result = 0.5*polar.
dot(*x,*y);
88 result += 0.5*polar.
dot(*y,*x);
90 auto x_dot_y = x->dot(*y);
91 errorFlag += ( std::abs( x_dot_y - result ) > errtol );
93 *outStream << std::setprecision(16) << x_dot_y << std::endl;
94 *outStream << std::setprecision(16) << result << std::endl;
102 catch (std::logic_error& err) {
103 *outStream << err.what() <<
"\n";
108 std::cout <<
"End Result: TEST FAILED\n";
110 std::cout <<
"End Result: TEST PASSED\n";
typename PV< Real >::size_type size_type
Defines a no-output stream class ROL::NullStream and a function makeStreamPtr which either wraps a re...
static Ptr< PartitionedVector > create(std::initializer_list< Vp > vs)
Defines the linear algebra or vector space interface.
VectorWorkspace< Real > workspace_
void status(std::ostream &os) const
Real dot(const Vector< Real > &x, const Vector< Real > &y)
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,...
Ptr< std::ostream > makeStreamPtr(std::ostream &os, bool noSuppressOutput=true)
Real ROL_EPSILON(void)
Platform-dependent machine epsilon.
int main(int argc, char *argv[])