10 #ifndef ROL_SCALEDSTDVECTOR_H
11 #define ROL_SCALEDSTDVECTOR_H
27 template <
class Real,
class Element=Real>
30 template <
class Real,
class Element=Real>
33 template <
class Real,
class Element>
47 const Ptr<std::vector<Element> > & scaling_vec) :
53 const std::vector<Element>& xval = *ex.
getVector();
58 val += yval[i]*xval[i]*(*scaling_vec_)[i];
63 Ptr<Vector<Real> >
clone()
const {
65 return makePtr<PrimalScaledStdVector>(
72 dual_vec_ = makePtr<DualScaledStdVector<Real>>(
73 makePtr<std::vector<Element>>(n),
77 for (
uint i = 0; i < n; i++) {
101 template <
class Real,
class Element>
102 class DualScaledStdVector :
public StdVector<Real> {
115 const Ptr<std::vector<Element> > & scaling_vec) :
121 const std::vector<Element>& xval = *ex.getVector();
126 val += yval[i]*xval[i]/(*scaling_vec_)[i];
133 return makePtr<DualScaledStdVector>(
140 primal_vec_ = makePtr<PrimalScaledStdVector<Real>>(
141 makePtr<std::vector<Element>>(n),
145 for (
uint i = 0; i < n; i++) {
typename PV< Real >::size_type size_type
Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
std::vector< Element >::size_type uint
Provides the std::vector implementation of the ROL::Vector interface that handles scalings in the inn...
Ptr< const std::vector< Element > > getVector() const
DualScaledStdVector(const Ptr< std::vector< Element > > &std_vec, const Ptr< std::vector< Element > > &scaling_vec)
std::vector< Element >::size_type uint
Defines the linear algebra or vector space interface.
Real dot(const Vector< Real > &x) const
Compute where .
Real dot(const Vector< Real > &x) const
Compute where .
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
Ptr< PrimalScaledStdVector< Real > > primal_vec_
Ptr< std::vector< Element > > scaling_vec_
PrimalScaledStdVector(const Ptr< std::vector< Element > > &std_vec, const Ptr< std::vector< Element > > &scaling_vec)
Ptr< Vector< Real > > clone() const
Clone to make a new (uninitialized) vector.
Ptr< Vector< Real > > clone() const
Clone to make a new (uninitialized) vector.
Ptr< DualScaledStdVector< Real > > dual_vec_
int dimension() const
Return dimension of the vector space.
Provides the std::vector implementation of the ROL::Vector interface that handles scalings in the inn...
Ptr< std::vector< Element > > scaling_vec_
const Vector< Real > & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
const Vector< Real > & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Real apply(const Vector< Real > &x) const
Apply to a dual vector. This is equivalent to the call .
virtual Real dot(const Vector< Real > &x) const
Compute where .