46 #ifndef ROL_WRAPPEDVECTOR_HPP
47 #define ROL_WRAPPEDVECTOR_HPP
66 template<
typename Real>
67 class PrimalScaledVector {
84 virtual void plus(
const V& x )
override {
vec_->plus(x); }
85 virtual void scale(
const Real alpha )
override {
vec_->scale(alpha); }
87 virtual Real
dot(
const V& x )
const override {
return vec_->dot(x); }
89 virtual Real
norm()
const override {
return std::sqrt( this->
dot(*
this) ); }
91 virtual Ptr<V>
clone()
const override {
92 return makePtr<WrappedVector>(
vec_->clone() );
95 virtual void axpy(
const Real alpha,
const V& x )
override {
96 vec_->axpy( alpha, x );
99 virtual Ptr<V>
basis(
const int i )
const override {
100 return makePtr<VPrim>(
vec_->basis(i) );
105 virtual void set(
const V& x )
override {
vec_->set(x); }
107 virtual void const V&
dual()
const override {
return vec_->dual(); }
109 virtual void applyUnary(
const Elementwise::UnaryFunction<Real>& f )
override {
113 virtual void applyBinary(
const Elementwise::BinaryFunction<Real>& f,
114 const V& x )
override {
115 vec_->applyBinary(f,x);
118 virtual Real
reduce(
const Elementwise::ReductionOp<Real>& r )
const override {
119 return vec_->reduce(r);
124 virtual void randomize(
const Real l=0.0,
const Real u=1.0 )
override {
125 vec_->randomize(l,u);
128 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 void const V & dual() const override