ROL
|
#include <ROL_RieszVector.hpp>
Public Member Functions | |
RieszPrimalVector (const ROL::Ptr< V > &v, const ROL::Ptr< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >())) | |
virtual | ~RieszPrimalVector () |
virtual Real | dot (const V &x) const |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). More... | |
virtual ROL::Ptr< V > | clone () const |
Clone to make a new (uninitialized) vector. More... | |
virtual const V & | 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. 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< V > | getVector (void) |
ROL::Ptr< const V > | getVector (void) const |
Public Member Functions inherited from ROL::ElementwiseVector< Real > | |
virtual | ~ElementwiseVector () |
void | plus (const Vector< Real > &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... | |
virtual Real | norm () const |
Returns \( \| y \| \) 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 | zero () |
Set to zero vector. More... | |
void | set (const Vector< Real > &x) |
Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). More... | |
Public Member Functions inherited from ROL::Vector< Real > | |
virtual | ~Vector () |
virtual ROL::Ptr< Vector > | basis (const int i) const |
Return i-th basis vector. More... | |
virtual int | dimension () const |
Return dimension of the vector space. 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 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 Types | |
using | V = Vector< Real > |
using | DualVector = RieszDualVector< Real > |
using | OP = LinearOperator< Real > |
Private Member Functions | |
void | initialize_dual (void) const |
Private Attributes | |
const ROL::Ptr< V > | v_ |
ROL::Ptr< DualVector > | dual_ |
const ROL::Ptr< OP > | op_ |
Real | tol_ |
bool | isDualInitialized_ |
Definition at line 36 of file ROL_RieszVector.hpp.
|
private |
Definition at line 45 of file ROL_RieszVector.hpp.
|
private |
Definition at line 46 of file ROL_RieszVector.hpp.
|
private |
Definition at line 47 of file ROL_RieszVector.hpp.
|
inline |
Definition at line 67 of file ROL_RieszVector.hpp.
|
inlinevirtual |
Definition at line 73 of file ROL_RieszVector.hpp.
|
inlineprivate |
Definition at line 58 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::dual_, ROL::RieszPrimalVector< Real >::isDualInitialized_, ROL::RieszPrimalVector< Real >::op_, ROL::RieszPrimalVector< Real >::tol_, and ROL::RieszPrimalVector< Real >::v_.
Referenced by ROL::RieszPrimalVector< Real >::dot(), and ROL::RieszPrimalVector< Real >::dual().
|
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::ElementwiseVector< Real >.
Definition at line 75 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::dual_, ROL::RieszPrimalVector< Real >::getVector(), ROL::RieszPrimalVector< Real >::initialize_dual(), and ROL::RieszPrimalVector< Real >::isDualInitialized_.
|
inlinevirtual |
Clone to make a new (uninitialized) vector.
Provides the means of allocating temporary memory in ROL.
Implements ROL::Vector< Real >.
Definition at line 84 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::op_, ROL::RieszPrimalVector< Real >::tol_, and ROL::RieszPrimalVector< Real >::v_.
|
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::Vector< Real >.
Definition at line 88 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::dual_, ROL::RieszPrimalVector< Real >::initialize_dual(), and ROL::RieszPrimalVector< Real >::isDualInitialized_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 95 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 99 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::getVector(), and ROL::RieszPrimalVector< Real >::v_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 104 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
|
inlinevirtual |
Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).
[in] | C | is a scalar. |
On return \(\mathtt{*this} = C\). Uses applyUnary methods for the computation. Please overload if a more efficient implementation is needed.
Reimplemented from ROL::Vector< Real >.
Definition at line 108 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
|
inlinevirtual |
Set vector to be uniform random between [l,u].
[in] | l | is a the lower bound. |
[in] | u | is a the upper bound. |
On return the components of \(\mathtt{*this}\) are uniform random numbers on the interval \([l,u]\). The default implementation uses applyUnary methods for the computation. Please overload if a more efficient implementation is needed.
Reimplemented from ROL::Vector< Real >.
Definition at line 112 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
|
inline |
Definition at line 116 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
Referenced by ROL::RieszPrimalVector< Real >::applyBinary(), and ROL::RieszPrimalVector< Real >::dot().
|
inline |
Definition at line 120 of file ROL_RieszVector.hpp.
References ROL::RieszPrimalVector< Real >::v_.
|
private |
Definition at line 51 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszPrimalVector< Real >::applyBinary(), ROL::RieszPrimalVector< Real >::applyUnary(), ROL::RieszPrimalVector< Real >::clone(), ROL::RieszPrimalVector< Real >::getVector(), ROL::RieszPrimalVector< Real >::initialize_dual(), ROL::RieszPrimalVector< Real >::randomize(), ROL::RieszPrimalVector< Real >::reduce(), and ROL::RieszPrimalVector< Real >::setScalar().
|
mutableprivate |
Definition at line 52 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszPrimalVector< Real >::dot(), ROL::RieszPrimalVector< Real >::dual(), and ROL::RieszPrimalVector< Real >::initialize_dual().
|
private |
Definition at line 53 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszPrimalVector< Real >::clone(), and ROL::RieszPrimalVector< Real >::initialize_dual().
|
mutableprivate |
Definition at line 54 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszPrimalVector< Real >::clone(), and ROL::RieszPrimalVector< Real >::initialize_dual().
|
mutableprivate |
Definition at line 56 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszPrimalVector< Real >::dot(), ROL::RieszPrimalVector< Real >::dual(), and ROL::RieszPrimalVector< Real >::initialize_dual().