10 #ifndef ROL_SROMVECTOR_H
11 #define ROL_SROMVECTOR_H
30 const ROL::Ptr<ProbabilityVector<Real> >
pvec_;
31 const ROL::Ptr<AtomVector<Real> >
avec_;
59 void scale(
const Real alpha ) {
79 val = std::sqrt(
dot(*
this) );
83 ROL::Ptr<Vector<Real> >
clone(
void)
const {
84 return ROL::makePtr<SROMVector>(
85 ROL::staticPtrCast<ProbabilityVector<Real> >(
pvec_->clone()),
92 ROL::staticPtrCast<ProbabilityVector<Real> >(
dual_pvec_),
102 return avec_->dimension() +
pvec_->dimension();
105 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
106 pvec_->applyUnary(f);
107 avec_->applyUnary(f);
116 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
117 Real result = r.initialValue();
118 Real pval =
pvec_->reduce(r);
119 Real aval =
avec_->reduce(r);
120 r.reduce(pval,result);
121 r.reduce(aval,result);
typename PV< Real >::size_type size_type
const ROL::Ptr< const ProbabilityVector< Real > > getProbabilityVector(void) const
void axpy(const Real alpha, const Vector< Real > &x)
Compute where .
Provides the std::vector implementation of the ROL::Vector interface.
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
void plus(const Vector< Real > &x)
Compute , where .
Defines the linear algebra or vector space interface.
Real reduce(const Elementwise::ReductionOp< Real > &r) const
Real dot(const Vector< Real > &x) const
Compute where .
ROL::Ptr< Vector< Real > > clone(void) const
Clone to make a new (uninitialized) vector.
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector< Real > &x)
const Vector< Real > & dual(void) const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
const ROL::Ptr< ProbabilityVector< Real > > pvec_
Real norm() const
Returns where .
const ROL::Ptr< AtomVector< Real > > avec_
Provides the std::vector implementation of the ROL::Vector interface.
Provides the std::vector implementation of the ROL::Vector interface.
ROL::Ptr< ProbabilityVector< Real > > getProbabilityVector(void)
ROL::Ptr< Vector< Real > > dual_avec_
const ROL::Ptr< const AtomVector< Real > > getAtomVector(void) const
ROL::Ptr< Vector< Real > > dual_pvec_
int dimension(void) const
Return dimension of the vector space.
void setProbabilityVector(const ProbabilityVector< Real > &vec)
void scale(const Real alpha)
Compute where .
void setAtomVector(const AtomVector< Real > &vec)
void set(const Vector< Real > &x)
Set where .
SROMVector(const ROL::Ptr< ProbabilityVector< Real > > &pvec, const ROL::Ptr< AtomVector< Real > > &avec)
std::vector< Real >::size_type uint
ROL::Ptr< SROMVector< Real > > dual_vec_
ROL::Ptr< AtomVector< Real > > getAtomVector(void)