44 #ifndef ROL_SROMVECTOR_H 45 #define ROL_SROMVECTOR_H 62 typedef typename std::vector<Real>::size_type
uint;
64 const Teuchos::RCP<ProbabilityVector<Real> >
pvec_;
65 const Teuchos::RCP<AtomVector<Real> >
avec_;
75 : pvec_(pvec), avec_(avec) {
76 dual_pvec_ = (pvec_->dual()).
clone();
77 dual_avec_ = (avec_->dual()).
clone();
92 void scale(
const Real alpha ) {
112 val = std::sqrt(
dot(*
this) );
116 Teuchos::RCP<Vector<Real> >
clone(
void)
const {
123 dual_pvec_->set(pvec_->dual());
124 dual_avec_->set(avec_->dual());
132 return avec_->dimension() + pvec_->dimension();
135 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
136 pvec_->applyUnary(f);
137 avec_->applyUnary(f);
146 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
147 Real result = r.initialValue();
148 Real pval = pvec_->reduce(r);
149 Real aval = avec_->reduce(r);
150 r.reduce(pval,result);
151 r.reduce(aval,result);
void axpy(const Real alpha, const Vector< Real > &x)
Compute where .
const Teuchos::RCP< AtomVector< Real > > avec_
Provides the std::vector implementation of the ROL::Vector interface.
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
const Teuchos::RCP< const ProbabilityVector< Real > > getProbabilityVector(void) const
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 .
Teuchos::RCP< 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 Teuchos::RCP< const AtomVector< Real > > getAtomVector(void) const
Teuchos::RCP< AtomVector< Real > > getAtomVector(void)
Real norm() const
Returns where .
const Teuchos::RCP< ProbabilityVector< Real > > pvec_
Provides the std::vector implementation of the ROL::Vector interface.
Teuchos::RCP< ProbabilityVector< Real > > getProbabilityVector(void)
Provides the std::vector implementation of the ROL::Vector interface.
Teuchos::RCP< SROMVector< Real > > dual_vec_
int dimension(void) const
Return dimension of the vector space.
void setProbabilityVector(const ProbabilityVector< Real > &vec)
Teuchos::RCP< Vector< Real > > dual_pvec_
void scale(const Real alpha)
Compute where .
void setAtomVector(const AtomVector< Real > &vec)
void set(const Vector< Real > &x)
Set where .
Teuchos::RCP< Vector< Real > > dual_avec_
SROMVector(const Teuchos::RCP< ProbabilityVector< Real > > &pvec, const Teuchos::RCP< AtomVector< Real > > &avec)
std::vector< Real >::size_type uint