ROL
Public Member Functions | Private Types | Private Attributes | List of all members
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
 Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). More...
 
virtual Ptr< Vector< Real > > clone (void) const
 Clone to make a new (uninitialized) vector. More...
 
int dimension (void) const
 Return dimension of the vector space. More...
 
Real reduce (const Elementwise::ReductionOp< Real > &r) const
 
const Ptr< BatchManager< Real > > getBatchManager (void) const
 
- Public Member Functions inherited from ROL::StdVector< Real >
 StdVector (const Ptr< std::vector< Real >> &std_vec)
 
 StdVector (const int dim, const Realval=0.0)
 
 StdVector (std::initializer_list< Real > ilist)
 
Real & operator[] (int i)
 
const Real & operator[] (int i) const
 
void set (const Vector< Real > &x)
 Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). More...
 
void plus (const Vector< Real > &x)
 Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\). More...
 
void axpy (const Real alpha, const Vector< Real > &x)
 Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\). More...
 
void scale (const Real alpha)
 Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\). More...
 
Real norm () const
 Returns \( \| y \| \) where \(y = \mathtt{*this}\). More...
 
Ptr< const std::vector< Real > > getVector () const
 
Ptr< std::vector< Real > > getVector ()
 
Ptr< Vector< Real > > basis (const int i) const
 Return i-th basis vector. More...
 
int dimension () const
 Return dimension of the vector space. More...
 
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}\). More...
 
void randomize (const Real l=0.0, const Real u=1.0)
 Set vector to be uniform random between [l,u]. More...
 
virtual void print (std::ostream &outStream) const
 
- Public Member Functions inherited from ROL::Vector< Real >
virtual ~Vector ()
 
virtual void zero ()
 Set to zero vector. More...
 
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. More...
 
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())}\). More...
 
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. More...
 

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 58 of file ROL_BatchStdVector.hpp.

Member Typedef Documentation

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

Definition at line 59 of file ROL_BatchStdVector.hpp.

Constructor & Destructor Documentation

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

Definition at line 64 of file ROL_BatchStdVector.hpp.

Member Function Documentation

template<class Real >
virtual Real ROL::BatchStdVector< Real >::dot ( const Vector< Real > &  x) const
inlinevirtual

Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).

Parameters
[in]xis the vector that forms the dot product with \(\mathtt{*this}\).
Returns
The number equal to \(\langle \mathtt{*this}, x \rangle\).

Reimplemented from ROL::StdVector< Real >.

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

Definition at line 68 of file ROL_BatchStdVector.hpp.

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

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

Clone to make a new (uninitialized) vector.

Returns
A reference-counted pointer to the cloned vector.

Provides the means of allocating temporary memory in ROL.


Reimplemented from ROL::StdVector< Real >.

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

Definition at line 83 of file ROL_BatchStdVector.hpp.

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

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

Return dimension of the vector space.

Returns
The dimension of the vector space, i.e., the total number of basis vectors.

Overload if the basis is overloaded.


Reimplemented from ROL::Vector< Real >.

Definition at line 90 of file ROL_BatchStdVector.hpp.

References ROL::BatchStdVector< Real >::bman_, and dim.

Referenced by ROL::PrimalAtomVector< Real >::clone(), ROL::DualAtomVector< Real >::clone(), ROL::PrimalAtomVector< Real >::dot(), ROL::DualAtomVector< Real >::dot(), ROL::PrimalAtomVector< Real >::dual(), and ROL::DualAtomVector< Real >::dual().

template<class Real >
Real ROL::BatchStdVector< Real >::reduce ( const Elementwise::ReductionOp< Real > &  r) const
inlinevirtual
template<class Real >
const Ptr<BatchManager<Real> > ROL::BatchStdVector< Real >::getBatchManager ( void  ) const
inline

Member Data Documentation

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

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