44 #ifndef ROL_SROMVECTOR_H
45 #define ROL_SROMVECTOR_H
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>(
119 ROL::staticPtrCast<ProbabilityVector<Real> >(
pvec_->clone()),
126 ROL::staticPtrCast<ProbabilityVector<Real> >(
dual_pvec_),
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);
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)