ROL
|
#include <ROL_SimulatedVector.hpp>
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 |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). | |
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. | |
![]() | |
SimulatedVector (const std::vector< Vp > &vecs, const VBMp &bman) | |
void | set (const V &x) |
Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). | |
void | plus (const V &x) |
Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\). | |
void | scale (const Real alpha) |
Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\). | |
void | axpy (const Real alpha, const V &x) |
Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\). | |
virtual Real | dot (const V &x) const |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). | |
Real | norm () const |
Returns \( \| y \| \) where \(y = \mathtt{*this}\). | |
virtual Vp | clone () const |
Clone to make a new (uninitialized) vector. | |
virtual const V & | 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. | |
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 |
![]() | |
virtual | ~Vector () |
virtual void | plus (const Vector &x)=0 |
Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\). | |
virtual void | scale (const Real alpha)=0 |
Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\). | |
virtual Real | dot (const Vector &x) const =0 |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). | |
virtual Real | norm () const =0 |
Returns \( \| y \| \) where \(y = \mathtt{*this}\). | |
virtual ROL::Ptr< Vector > | clone () const =0 |
Clone to make a new (uninitialized) vector. | |
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 ROL::Ptr< Vector > | basis (const int i) const |
Return i-th basis vector. | |
virtual int | dimension () const |
Return dimension of the vector space. | |
virtual void | set (const Vector &x) |
Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). | |
virtual const Vector & | dual () 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 | applyUnary (const Elementwise::UnaryFunction< Real > &f) |
virtual void | applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector &x) |
virtual Real | reduce (const Elementwise::ReductionOp< Real > &r) const |
virtual void | print (std::ostream &outStream) const |
virtual void | setScalar (const Real C) |
Set \(y \leftarrow C\) where \(C\in\mathbb{R}\). | |
virtual void | randomize (const Real l=0.0, const Real u=1.0) |
Set vector to be uniform random between [l,u]. | |
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 | |
![]() | |
typedef std::vector< PV >::size_type | size_type |
Definition at line 368 of file ROL_SimulatedVector.hpp.
|
inline |
|
inlinevirtual |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).
@param[in] x is the vector that forms the dot product with \f$\mathtt{*this}\f$. @return The number equal to \f$\langle \mathtt{*this}, x \rangle\f$. ---
Reimplemented from ROL::SimulatedVector< Real >.
Definition at line 388 of file ROL_SimulatedVector.hpp.
References ROL::DualSimulatedVector< Real >::bman_, ROL::SimulatedVector< Real >::get(), ROL::SimulatedVector< Real >::numVectors(), ROL::DualSimulatedVector< Real >::sampler_, and ROL::DualSimulatedVector< Real >::vecs_.
|
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 412 of file ROL_SimulatedVector.hpp.
References ROL::DualSimulatedVector< Real >::bman_, ROL::DualSimulatedVector< Real >::clone(), ROL::DualSimulatedVector< Real >::sampler_, and ROL::DualSimulatedVector< Real >::vecs_.
Referenced by ROL::DualSimulatedVector< Real >::clone(), and ROL::DualSimulatedVector< Real >::DualSimulatedVector().
|
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 420 of file ROL_SimulatedVector.hpp.
References ROL::DualSimulatedVector< Real >::bman_, ROL::DualSimulatedVector< Real >::dual(), ROL::DualSimulatedVector< Real >::isPrimalInitialized_, ROL::DualSimulatedVector< Real >::primal_pvec_, ROL::DualSimulatedVector< Real >::primal_vecs_, ROL::DualSimulatedVector< Real >::sampler_, and ROL::DualSimulatedVector< Real >::vecs_.
Referenced by ROL::DualSimulatedVector< Real >::dual(), and ROL::DualSimulatedVector< Real >::DualSimulatedVector().
|
private |
Definition at line 370 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::clone(), ROL::DualSimulatedVector< Real >::dot(), ROL::DualSimulatedVector< Real >::dual(), and ROL::DualSimulatedVector< Real >::DualSimulatedVector().
|
private |
Definition at line 371 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::clone(), ROL::DualSimulatedVector< Real >::dot(), and ROL::DualSimulatedVector< Real >::dual().
|
private |
Definition at line 372 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::clone(), ROL::DualSimulatedVector< Real >::dot(), ROL::DualSimulatedVector< Real >::dual(), and ROL::DualSimulatedVector< Real >::DualSimulatedVector().
|
mutableprivate |
Definition at line 373 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::dual(), and ROL::DualSimulatedVector< Real >::DualSimulatedVector().
|
mutableprivate |
Definition at line 374 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::dual().
|
mutableprivate |
Definition at line 375 of file ROL_SimulatedVector.hpp.
Referenced by ROL::DualSimulatedVector< Real >::dual().