44#ifndef ROL_SROMVECTOR_H
45#define ROL_SROMVECTOR_H
62 typedef typename std::vector<Real>::size_type
uint;
64 const ROL::Ptr<ProbabilityVector<Real> >
pvec_;
65 const ROL::Ptr<AtomVector<Real> >
avec_;
93 void scale(
const Real alpha ) {
113 val = std::sqrt(
dot(*
this) );
117 ROL::Ptr<Vector<Real> >
clone(
void)
const {
118 return ROL::makePtr<SROMVector>(
136 return avec_->dimension() +
pvec_->dimension();
139 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
140 pvec_->applyUnary(f);
141 avec_->applyUnary(f);
150 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
151 Real result = r.initialValue();
152 Real pval =
pvec_->reduce(r);
153 Real aval =
avec_->reduce(r);
154 r.reduce(pval,result);
155 r.reduce(aval,result);
Provides the std::vector implementation of the ROL::Vector interface.
Provides the std::vector implementation of the ROL::Vector interface.
Provides the std::vector implementation of the ROL::Vector interface.
void axpy(const Real alpha, const Vector< Real > &x)
Compute where .
const ROL::Ptr< ProbabilityVector< Real > > pvec_
void set(const Vector< Real > &x)
Set where .
int dimension(void) const
Return dimension of the vector space.
Real norm() const
Returns where .
Real dot(const Vector< Real > &x) const
Compute where .
ROL::Ptr< SROMVector< Real > > dual_vec_
ROL::Ptr< Vector< Real > > clone(void) const
Clone to make a new (uninitialized) vector.
ROL::Ptr< ProbabilityVector< Real > > getProbabilityVector(void)
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector< Real > &x)
Real reduce(const Elementwise::ReductionOp< Real > &r) const
const Vector< Real > & dual(void) const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
void plus(const Vector< Real > &x)
Compute , where .
const ROL::Ptr< AtomVector< Real > > avec_
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
std::vector< Real >::size_type uint
ROL::Ptr< Vector< Real > > dual_avec_
void scale(const Real alpha)
Compute where .
void setAtomVector(const AtomVector< Real > &vec)
ROL::Ptr< AtomVector< Real > > getAtomVector(void)
const ROL::Ptr< const ProbabilityVector< Real > > getProbabilityVector(void) const
const ROL::Ptr< const AtomVector< Real > > getAtomVector(void) const
ROL::Ptr< Vector< Real > > dual_pvec_
void setProbabilityVector(const ProbabilityVector< Real > &vec)
SROMVector(const ROL::Ptr< ProbabilityVector< Real > > &pvec, const ROL::Ptr< AtomVector< Real > > &avec)
Defines the linear algebra or vector space interface.