44 #ifndef ROL_VECTORNORMS_H
45 #define ROL_VECTORNORMS_H
54 ROL::Ptr<Vector<Real> > xabs = x.
clone();
57 xabs->applyUnary(Elementwise::AbsoluteValue<Real>());
58 return xabs->reduce(Elementwise::ReductionSum<Real>());
61 template<
class Real,
class Exponent>
64 ROL::Ptr<Vector<Real> > xabsp = x.
clone();
66 xabsp->applyUnary(Elementwise::AbsoluteValue<Real>());
67 xabsp->applyUnary(Elementwise::Power<Real>(p));
68 Real sum = xabsp->reduce(Elementwise::ReductionSum<Real>());
69 return std::pow(sum,1.0/p);
75 ROL::Ptr<Vector<Real> > xabs = x.
clone();
78 xabs->applyUnary(Elementwise::AbsoluteValue<Real>());
79 return xabs->reduce(Elementwise::ReductionMax<Real>());
86 #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)