ROL
ROL::DualSimulatedVector< Real > Class Template Reference

#include <ROL_SimulatedVector.hpp>

Inheritance diagram for ROL::DualSimulatedVector< Real >:

Public Member Functions

 DualSimulatedVector (const std::vector< ROL::Ptr< Vector< Real > > > &vecs, const ROL::Ptr< BatchManager< Real > > &bman, const ROL::Ptr< SampleGenerator< Real > > &sampler)
Real dot (const Vector< Real > &x) const
ROL::Ptr< Vector< Real > > clone (void) const
 Clone to make a new (uninitialized) vector.
const Vector< Real > & dual (void) 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.
Public Member Functions inherited from ROL::SimulatedVector< Real >
 SimulatedVector (const std::vector< Vp > &vecs, const VBMp &bman)
void set (const V &x)
void plus (const V &x)
void scale (const Real alpha)
 Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\).
void axpy (const Real alpha, const V &x)
Real norm () const
 Returns \( \| y \| \) where \(y = \mathtt{*this}\).
Vp basis (const int i) const
 Return i-th basis vector.
int dimension () const
 Return dimension of the vector space.
void zero ()
 Set to zero vector.
void applyUnary (const Elementwise::UnaryFunction< Real > &f)
void applyBinary (const Elementwise::BinaryFunction< Real > &f, const V &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].
ROL::Ptr< const Vector< Real > > get (size_type i) const
ROL::Ptr< Vector< Real > > get (size_type i)
void set (size_type i, const V &x)
void zero (size_type i)
size_type numVectors () 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 set (const Vector &x)
 Set \(y \leftarrow x\) where \(y = \mathtt{*this}\).
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 void print (std::ostream &outStream) const
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 Attributes

const std::vector< ROL::Ptr< Vector< Real > > > vecs_
const ROL::Ptr< BatchManager< Real > > bman_
const ROL::Ptr< SampleGenerator< Real > > sampler_
std::vector< ROL::Ptr< Vector< Real > > > primal_vecs_
ROL::Ptr< PrimalSimulatedVector< Real > > primal_pvec_
bool isPrimalInitialized_

Additional Inherited Members

Public Types inherited from ROL::SimulatedVector< Real >
typedef std::vector< PV >::size_type size_type

Detailed Description

template<class Real>
class ROL::DualSimulatedVector< Real >

Definition at line 334 of file ROL_SimulatedVector.hpp.

Constructor & Destructor Documentation

◆ DualSimulatedVector()

template<class Real>
ROL::DualSimulatedVector< Real >::DualSimulatedVector ( const std::vector< ROL::Ptr< Vector< Real > > > & vecs,
const ROL::Ptr< BatchManager< Real > > & bman,
const ROL::Ptr< SampleGenerator< Real > > & sampler )
inline

Member Function Documentation

◆ dot()

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

◆ clone()

template<class Real>
ROL::Ptr< Vector< Real > > ROL::DualSimulatedVector< 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::SimulatedVector< Real >.

Definition at line 378 of file ROL_SimulatedVector.hpp.

References bman_, clone(), sampler_, and vecs_.

Referenced by clone(), and DualSimulatedVector().

◆ dual()

template<class Real>
const Vector< Real > & ROL::DualSimulatedVector< Real >::dual ( void ) const
inlinevirtual

Return dual representation of \(\mathtt{*this}\), for example, the result of applying a Riesz map, or change of basis, or change of memory layout.

Returns
A const reference to dual representation.

By default, returns the current object. Please overload if you need a dual representation.


Reimplemented from ROL::SimulatedVector< Real >.

Definition at line 386 of file ROL_SimulatedVector.hpp.

References bman_, dual(), isPrimalInitialized_, primal_pvec_, primal_vecs_, sampler_, and vecs_.

Referenced by dual(), and DualSimulatedVector().

Member Data Documentation

◆ vecs_

template<class Real>
const std::vector<ROL::Ptr<Vector<Real> > > ROL::DualSimulatedVector< Real >::vecs_
private

Definition at line 336 of file ROL_SimulatedVector.hpp.

Referenced by clone(), dot(), dual(), and DualSimulatedVector().

◆ bman_

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

Definition at line 337 of file ROL_SimulatedVector.hpp.

Referenced by clone(), dot(), dual(), and DualSimulatedVector().

◆ sampler_

template<class Real>
const ROL::Ptr<SampleGenerator<Real> > ROL::DualSimulatedVector< Real >::sampler_
private

Definition at line 338 of file ROL_SimulatedVector.hpp.

Referenced by clone(), dot(), dual(), and DualSimulatedVector().

◆ primal_vecs_

template<class Real>
std::vector<ROL::Ptr<Vector<Real> > > ROL::DualSimulatedVector< Real >::primal_vecs_
mutableprivate

Definition at line 339 of file ROL_SimulatedVector.hpp.

Referenced by dual(), and DualSimulatedVector().

◆ primal_pvec_

template<class Real>
ROL::Ptr<PrimalSimulatedVector<Real> > ROL::DualSimulatedVector< Real >::primal_pvec_
mutableprivate

Definition at line 340 of file ROL_SimulatedVector.hpp.

Referenced by dual().

◆ isPrimalInitialized_

template<class Real>
bool ROL::DualSimulatedVector< Real >::isPrimalInitialized_
mutableprivate

Definition at line 341 of file ROL_SimulatedVector.hpp.

Referenced by dual(), and DualSimulatedVector().


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