ROL
ROL::BatchStdVector< Real > Class Template Reference

Provides the std::vector implementation of the ROL::Vector interface. More...

#include <ROL_BatchStdVector.hpp>

Inheritance diagram for ROL::BatchStdVector< Real >:

Public Member Functions

 BatchStdVector (const Ptr< std::vector< Real > > &vec, const Ptr< BatchManager< Real > > &bman)
virtual Real dot (const Vector< Real > &x) const
virtual Ptr< Vector< Real > > clone (void) const
 Clone to make a new (uninitialized) vector.
int dimension (void) const
 Return dimension of the vector space.
Real reduce (const Elementwise::ReductionOp< Real > &r) const
const Ptr< BatchManager< Real > > getBatchManager (void) const
Public Member Functions inherited from ROL::StdVector< Real, Element >
 StdVector (const Ptr< std::vector< Element > > &std_vec)
 StdVector (const int dim, const Element val=0.0)
 StdVector (std::initializer_list< Element > ilist)
Real & operator[] (int i)
const Real & operator[] (int i) const
void set (const Vector< Real > &x)
void plus (const Vector< Real > &x)
void axpy (const Real alpha, const Vector< Real > &x)
void scale (const Real alpha)
 Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\).
Real norm () const
 Returns \( \| y \| \) where \(y = \mathtt{*this}\).
Ptr< const std::vector< Element > > getVector () const
Ptr< std::vector< Element > > getVector ()
Ptr< Vector< Real > > basis (const int i) const
 Return i-th basis vector.
int dimension () const
 Return dimension of the vector space.
void applyUnary (const Elementwise::UnaryFunction< Real > &f)
void applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector< Real > &x)
Real reduce (const Elementwise::ReductionOp< Real > &r) const
void setScalar (const Real C)
 Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).
void randomize (const Real l=0.0, const Real u=1.0)
 Set vector to be uniform random between [l,u].
virtual void print (std::ostream &outStream) const
Public Member Functions inherited from ROL::ROL::Vector< Real >
virtual ~Vector ()
virtual void plus (const Vector &x)=0
 Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\).
virtual Real dot (const Vector &x) const =0
 Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).
virtual void axpy (const Real alpha, const Vector &x)
 Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\).
virtual void zero ()
 Set to zero vector.
virtual void set (const Vector &x)
 Set \(y \leftarrow x\) where \(y = \mathtt{*this}\).
virtual const Vectordual () const
 Return dual representation of \(\mathtt{*this}\), for example, the result of applying a Riesz map, or change of basis, or change of memory layout.
virtual Real apply (const Vector< Real > &x) const
 Apply \(\mathtt{*this}\) to a dual vector. This is equivalent to the call \(\mathtt{this->dot(x.dual())}\).
virtual void applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector &x)
virtual std::vector< Real > checkVector (const Vector< Real > &x, const Vector< Real > &y, const bool printToStream=true, std::ostream &outStream=std::cout) const
 Verify vector-space methods.

Private Types

typedef std::vector< Real >::size_type uint

Private Attributes

const Ptr< BatchManager< Real > > bman_

Detailed Description

template<class Real>
class ROL::BatchStdVector< Real >

Provides the std::vector implementation of the ROL::Vector interface.

Definition at line 24 of file ROL_BatchStdVector.hpp.

Member Typedef Documentation

◆ uint

template<class Real>
typedef std::vector<Real>::size_type ROL::BatchStdVector< Real >::uint
private

Definition at line 25 of file ROL_BatchStdVector.hpp.

Constructor & Destructor Documentation

◆ BatchStdVector()

template<class Real>
ROL::BatchStdVector< Real >::BatchStdVector ( const Ptr< std::vector< Real > > & vec,
const Ptr< BatchManager< Real > > & bman )
inline

Member Function Documentation

◆ dot()

◆ clone()

template<class Real>
virtual Ptr< Vector< Real > > ROL::BatchStdVector< Real >::clone ( void ) const
inlinevirtual

Clone to make a new (uninitialized) vector.

  @return         A reference-counted pointer to the cloned vector.

  Provides the means of allocating temporary memory in ROL.

  ---             

Reimplemented from ROL::StdVector< Real, Element >.

Reimplemented in ROL::DualAtomVector< Real >, ROL::DualProbabilityVector< Real >, ROL::PrimalAtomVector< Real >, ROL::PrimalProbabilityVector< Real >, and ROL::ProbabilityVector< Real >.

Definition at line 49 of file ROL_BatchStdVector.hpp.

References bman_, and ROL::StdVector< Real, Element >::getVector().

◆ dimension()

template<class Real>
int ROL::BatchStdVector< Real >::dimension ( void ) const
inlinevirtual

◆ reduce()

template<class Real>
Real ROL::BatchStdVector< Real >::reduce ( const Elementwise::ReductionOp< Real > & r) const
inlinevirtual

Reimplemented from ROL::ROL::Vector< Real >.

Definition at line 63 of file ROL_BatchStdVector.hpp.

References bman_, and ROL::StdVector< Real, Element >::getVector().

◆ getBatchManager()

Member Data Documentation

◆ bman_

template<class Real>
const Ptr<BatchManager<Real> > ROL::BatchStdVector< Real >::bman_
private

Definition at line 27 of file ROL_BatchStdVector.hpp.

Referenced by BatchStdVector(), clone(), dimension(), dot(), getBatchManager(), and reduce().


The documentation for this class was generated from the following file: