ROL
|
#include <ROL_SimulatedVector.hpp>
Public Member Functions | |
PrimalSimulatedVector (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 |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). More... | |
ROL::Ptr< Vector< Real > > | clone (void) const |
Clone to make a new (uninitialized) vector. More... | |
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. More... | |
Public Member Functions inherited from ROL::SimulatedVector< Real > | |
SimulatedVector (const std::vector< Vp > &vecs, const VBMp &bman) | |
void | set (const V &x) |
Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). More... | |
void | plus (const V &x) |
Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\). More... | |
void | scale (const Real alpha) |
Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\). More... | |
void | axpy (const Real alpha, const V &x) |
Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\). More... | |
Real | norm () const |
Returns \( \| y \| \) where \(y = \mathtt{*this}\). More... | |
Vp | basis (const int i) const |
Return i-th basis vector. More... | |
int | dimension () const |
Return dimension of the vector space. More... | |
void | zero () |
Set to zero vector. More... | |
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}\). More... | |
void | randomize (const Real l=0.0, const Real u=1.0) |
Set vector to be uniform random between [l,u]. More... | |
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::Vector< Real > | |
virtual | ~Vector () |
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. More... | |
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 > > > | dual_vecs_ |
ROL::Ptr< DualSimulatedVector < Real > > | dual_pvec_ |
bool | isDualInitialized_ |
Additional Inherited Members | |
Public Types inherited from ROL::SimulatedVector< Real > | |
typedef std::vector< PV > ::size_type | size_type |
Definition at line 62 of file ROL_SimulatedVector.hpp.
|
inline |
|
inlinevirtual |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).
[in] | x | is the vector that forms the dot product with \(\mathtt{*this}\). |
Reimplemented from ROL::SimulatedVector< Real >.
Definition at line 321 of file ROL_SimulatedVector.hpp.
References ROL::PrimalSimulatedVector< Real >::bman_, ROL::SimulatedVector< Real >::get(), ROL::SimulatedVector< Real >::numVectors(), ROL::PrimalSimulatedVector< Real >::sampler_, and ROL::PrimalSimulatedVector< Real >::vecs_.
|
inlinevirtual |
Clone to make a new (uninitialized) vector.
Provides the means of allocating temporary memory in ROL.
Reimplemented from ROL::SimulatedVector< Real >.
Definition at line 345 of file ROL_SimulatedVector.hpp.
References ROL::PrimalSimulatedVector< Real >::bman_, ROL::PrimalSimulatedVector< Real >::sampler_, and ROL::PrimalSimulatedVector< Real >::vecs_.
Referenced by ROL::PrimalSimulatedVector< Real >::PrimalSimulatedVector().
|
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.
By default, returns the current object. Please overload if you need a dual representation.
Reimplemented from ROL::SimulatedVector< Real >.
Definition at line 353 of file ROL_SimulatedVector.hpp.
References ROL::PrimalSimulatedVector< Real >::bman_, ROL::PrimalSimulatedVector< Real >::dual_pvec_, ROL::PrimalSimulatedVector< Real >::dual_vecs_, ROL::PrimalSimulatedVector< Real >::isDualInitialized_, ROL::PrimalSimulatedVector< Real >::sampler_, and ROL::PrimalSimulatedVector< Real >::vecs_.
Referenced by ROL::PrimalSimulatedVector< Real >::PrimalSimulatedVector().
|
private |
Definition at line 303 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::clone(), ROL::PrimalSimulatedVector< Real >::dot(), ROL::PrimalSimulatedVector< Real >::dual(), and ROL::PrimalSimulatedVector< Real >::PrimalSimulatedVector().
|
private |
Definition at line 304 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::clone(), ROL::PrimalSimulatedVector< Real >::dot(), and ROL::PrimalSimulatedVector< Real >::dual().
|
private |
Definition at line 305 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::clone(), ROL::PrimalSimulatedVector< Real >::dot(), ROL::PrimalSimulatedVector< Real >::dual(), and ROL::PrimalSimulatedVector< Real >::PrimalSimulatedVector().
|
mutableprivate |
Definition at line 306 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::dual(), and ROL::PrimalSimulatedVector< Real >::PrimalSimulatedVector().
|
mutableprivate |
Definition at line 307 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::dual().
|
mutableprivate |
Definition at line 308 of file ROL_SimulatedVector.hpp.
Referenced by ROL::PrimalSimulatedVector< Real >::dual().