11 #ifndef ROL_SCALEDVECTOR_HPP
12 #define ROL_SCALEDVECTOR_HPP
37 template<
typename Real>
49 Elementwise::Multiply<Real>
mult_;
67 virtual Real
dot(
const V& x )
const override {
73 virtual Ptr<V>
clone()
const override {
77 virtual Ptr<V>
basis(
const int i )
const override {
81 virtual void const V&
dual()
const override {
84 return *( makePtr<VDual>( dual_vec, scaling_vec ) );
98 template<
typename Real>
99 class DualScaledVector :
public WrappedVector<Real> {
110 Elementwise::Divide<Real>
div_;
128 virtual Real
dot(
const V& x )
const override {
131 return this->getVector()->dot(*y);
134 virtual Ptr<V>
clone()
const override {
135 return makePtr<VDual>( this->getVector()->clone(),
scaling_vec_ );
138 virtual Ptr<V>
basis(
const int i )
const override {
139 return makePtr<VDual>( this->getVector()->basis(i),
scaling_vec_ );
142 virtual void const V&
dual()
const override {
143 auto primal_vec =
workspace_.copy( this->getVector() );
145 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