45 #ifndef ROL_ELEMENTWISE_VECTOR_H
46 #define ROL_ELEMENTWISE_VECTOR_H
74 void scale(
const Real alpha ) {
75 this->
applyUnary(Elementwise::Scale<Real>(alpha));
79 ROL::Ptr<Vector<Real> > y = this->
clone();
81 y->applyBinary(Elementwise::Multiply<Real>(),x);
82 return y->reduce(Elementwise::ReductionSum<Real>());
85 virtual Real
norm()
const {
86 return std::sqrt(this->
dot(*
this));
90 this->
applyBinary(Elementwise::Axpy<Real>(alpha),x);
94 this->
applyUnary(Elementwise::Fill<Real>(Real(0)));
102 virtual void applyUnary(
const Elementwise::UnaryFunction<Real> &uf ) = 0;
104 virtual void applyBinary(
const Elementwise::BinaryFunction<Real> &bf,
107 virtual Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const = 0;
117 #endif // ROL_ELEMENTWISE_VECTOR_H