11 #ifndef ROL_WRAPPEDVECTOR_HPP
12 #define ROL_WRAPPEDVECTOR_HPP
31 template<
typename Real>
32 class PrimalScaledVector {
49 virtual void plus(
const V& x )
override {
vec_->plus(x); }
50 virtual void scale(
const Real alpha )
override {
vec_->scale(alpha); }
52 virtual Real
dot(
const V& x )
const override {
return vec_->dot(x); }
54 virtual Real
norm()
const override {
return std::sqrt( this->
dot(*
this) ); }
56 virtual Ptr<V>
clone()
const override {
57 return makePtr<WrappedVector>(
vec_->clone() );
60 virtual void axpy(
const Real alpha,
const V& x )
override {
61 vec_->axpy( alpha, x );
64 virtual Ptr<V>
basis(
const int i )
const override {
65 return makePtr<VPrim>(
vec_->basis(i) );
70 virtual void set(
const V& x )
override {
vec_->set(x); }
72 virtual void const V&
dual()
const override {
return vec_->dual(); }
74 virtual Real
apply(
const V& x )
const override {
return vec_->apply(x); }
76 virtual void applyUnary(
const Elementwise::UnaryFunction<Real>& f )
override {
80 virtual void applyBinary(
const Elementwise::BinaryFunction<Real>& f,
81 const V& x )
override {
82 vec_->applyBinary(f,x);
85 virtual Real
reduce(
const Elementwise::ReductionOp<Real>& r )
const override {
86 return vec_->reduce(r);
91 virtual void randomize(
const Real l=0.0,
const Real u=1.0 )
override {
95 virtual void print( std::ostream& os )
override {
vec_->print(os); }
virtual void print(std::ostream &os) override
virtual void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x) override
virtual int dimension() const override
virtual void scale(const Real alpha) override
virtual void set(const V &x) override
Defines the linear algebra or vector space interface.
const Ptr< V > & getVector()
virtual void axpy(const Real alpha, const V &x) override
Provides the implementation of the ROL::Vector interface that handles scalings in the inner product...
WrappedVector(const Ptr< V > &vec)
Provides the implementation of the ROL::Vector interface that handles scalings in the inner product...
virtual void plus(const V &x) override
virtual Ptr< V > clone() const override
virtual Real dot(const V &x) const override
virtual void setVector(const Ptr< const V > &vec) const
virtual Ptr< V > basis(const int i) const override
virtual void applyUnary(const Elementwise::UnaryFunction< Real > &f) override
virtual Real norm() const override
const Ptr< const V > & getVector() const
virtual void randomize(const Real l=0.0, const Real u=1.0) override
virtual void setScalar(const Real C) override
virtual Real reduce(const Elementwise::ReductionOp< Real > &r) const override
virtual Real apply(const V &x) const override
virtual void const V & dual() const override