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++) {
122 template <
class Real,
class Element>
123 class DualScaledStdVector :
public StdVector<Real> {
136 const Ptr<std::vector<Element> > & scaling_vec) :
142 const std::vector<Element>& xval = *ex.getVector();
147 val += yval[i]*xval[i]/(*scaling_vec_)[i];
154 return makePtr<DualScaledStdVector>(
161 primal_vec_ = makePtr<PrimalScaledStdVector<Real>>(
162 makePtr<std::vector<Element>>(n),
166 for (
uint i = 0; i < n; i++) {
typename PV< Real >::size_type size_type
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...