46 #ifndef ROL_SCALEDVECTOR_HPP
47 #define ROL_SCALEDVECTOR_HPP
72 template<
typename Real>
84 Elementwise::Multiply<Real>
mult_;
102 virtual Real
dot(
const V& x )
const override {
108 virtual Ptr<V>
clone()
const override {
112 virtual Ptr<V>
basis(
const int i )
const override {
116 virtual void const V&
dual()
const override {
119 return *( makePtr<VDual>( dual_vec, scaling_vec ) );
133 template<
typename Real>
134 class DualScaledVector :
public WrappedVector<Real> {
145 Elementwise::Divide<Real>
div_;
163 virtual Real
dot(
const V& x )
const override {
166 return this->getVector()->dot(*y);
169 virtual Ptr<V>
clone()
const override {
170 return makePtr<VDual>( this->getVector()->clone(),
scaling_vec_ );
173 virtual Ptr<V>
basis(
const int i )
const override {
174 return makePtr<VDual>( this->getVector()->basis(i),
scaling_vec_ );
177 virtual void const V&
dual()
const override {
178 auto primal_vec =
workspace_.copy( this->getVector() );
180 return *( makePtr<VPrim>( primal_vec, scaling_vec ) );
virtual ~PrimalScaledVector()
virtual ~DualScaledVector()
PrimalScaledVector(const Ptr< V > &vec, const Ptr< V > &scaling_vec)
Elementwise::Multiply< Real > mult_
virtual Ptr< V > basis(const int i) const override
const Ptr< V > & getScalingVector()
VectorWorkspace< Real > & getWorkspace() const
const Ptr< const V > & getScalingVector() const
const Ptr< const V > & getScalingVector() const
void multiply_scaling(const Ptr< V > &y) const
Elementwise::Divide< Real > div_
Defines the linear algebra or vector space interface.
const Ptr< V > & getVector()
Provides the implementation of the ROL::Vector interface that handles scalings in the inner product...
Provides the implementation of the ROL::Vector interface that handles scalings in the inner product...
virtual Ptr< V > clone() const override
void setScalingVector(const Ptr< const V & > &scaling_vec) const
virtual Real dot(const V &x) const override
void setScalingVector(const Ptr< const V & > &scaling_vec) const
VectorWorkspace< Real > & getWorkspace() const
virtual Ptr< V > basis(const int i) const override
virtual Real dot(const V &x) const override
const Ptr< V > & getScalingVector()
Provides an interface layer which encapulates a pointer to a ROL::Vector and has the default behavior...
void divide_scaling(const < V > &y) const
virtual Ptr< V > clone() const override
virtual void const V & dual() const override
VectorWorkspace< Real > workspace_
DualScaledVector(const Ptr< V > &vec, const Ptr< V > &scaling_vec)
VectorWorkspace< Real > workspace_
virtual void const V & dual() const override