44 #ifndef ROL_SCALEDSTDVECTOR_H
45 #define ROL_SCALEDSTDVECTOR_H
61 template <
class Real,
class Element=Real>
64 template <
class Real,
class Element=Real>
67 template <
class Real,
class Element>
81 const Ptr<std::vector<Element> > & scaling_vec) :
87 const std::vector<Element>& xval = *ex.
getVector();
92 val += yval[i]*xval[i]*(*scaling_vec_)[i];
97 Ptr<Vector<Real> >
clone()
const {
99 return makePtr<PrimalScaledStdVector>(
106 dual_vec_ = makePtr<DualScaledStdVector<Real>>(
107 makePtr<std::vector<Element>>(n),
111 for (
uint i = 0; i < n; i++) {
135 template <
class Real,
class Element>
136 class DualScaledStdVector :
public StdVector<Real> {
149 const Ptr<std::vector<Element> > & scaling_vec) :
155 const std::vector<Element>& xval = *ex.getVector();
160 val += yval[i]*xval[i]/(*scaling_vec_)[i];
167 return makePtr<DualScaledStdVector>(
174 primal_vec_ = makePtr<PrimalScaledStdVector<Real>>(
175 makePtr<std::vector<Element>>(n),
179 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 .