10 #ifndef ROL_VECTORNORMS_H
11 #define ROL_VECTORNORMS_H
20 ROL::Ptr<Vector<Real> > xabs = x.
clone();
23 xabs->applyUnary(Elementwise::AbsoluteValue<Real>());
24 return xabs->reduce(Elementwise::ReductionSum<Real>());
27 template<
class Real,
class Exponent>
30 ROL::Ptr<Vector<Real> > xabsp = x.
clone();
32 xabsp->applyUnary(Elementwise::AbsoluteValue<Real>());
33 xabsp->applyUnary(Elementwise::Power<Real>(p));
34 Real sum = xabsp->reduce(Elementwise::ReductionSum<Real>());
35 return std::pow(sum,1.0/p);
41 ROL::Ptr<Vector<Real> > xabs = x.
clone();
44 xabs->applyUnary(Elementwise::AbsoluteValue<Real>());
45 return xabs->reduce(Elementwise::ReductionMax<Real>());
52 #endif // ROL_VECTORNORMS_H
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Real normLinf(const Vector< Real > &x)
Defines the linear algebra or vector space interface.
Real normL1(const Vector< Real > &x)
Real normLp(const Vector< Real > &x, Exponent p)