ROL
|
#include <ROL_RieszVector.hpp>
Public Member Functions | |
RieszDualVector (const ROL::Ptr< V > &v, const ROL::Ptr< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >())) | |
virtual | ~RieszDualVector () |
virtual Real | dot (const V &x) const |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). | |
virtual ROL::Ptr< V > | clone () const |
Clone to make a new (uninitialized) vector. | |
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. | |
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< V > | getVector (void) |
ROL::Ptr< const V > | getVector (void) const |
![]() | |
virtual | ~ElementwiseVector () |
void | plus (const Vector< Real > &x) |
Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\). | |
void | scale (const Real alpha) |
Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\). | |
virtual Real | dot (const Vector< Real > &x) const |
Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). | |
virtual Real | norm () const |
Returns \( \| y \| \) where \(y = \mathtt{*this}\). | |
void | axpy (const Real alpha, const Vector< Real > &x) |
Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\). | |
void | zero () |
Set to zero vector. | |
void | set (const Vector< Real > &x) |
Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). | |
virtual void | applyUnary (const Elementwise::UnaryFunction< Real > &uf)=0 |
virtual void | applyBinary (const Elementwise::BinaryFunction< Real > &bf, const Vector< Real > &x)=0 |
virtual Real | reduce (const Elementwise::ReductionOp< Real > &r) const =0 |
![]() | |
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 Types | |
using | V = Vector< Real > |
using | PrimalVector = RieszPrimalVector< Real > |
using | OP = LinearOperator< Real > |
Private Member Functions | |
void | initialize_primal (void) const |
Private Attributes | |
const ROL::Ptr< V > | v_ |
ROL::Ptr< PrimalVector > | primal_ |
const ROL::Ptr< OP > | op_ |
Real | tol_ |
bool | isPrimalInitialized_ |
Definition at line 163 of file ROL_RieszVector.hpp.
|
private |
Definition at line 165 of file ROL_RieszVector.hpp.
|
private |
Definition at line 166 of file ROL_RieszVector.hpp.
|
private |
Definition at line 167 of file ROL_RieszVector.hpp.
|
inline |
Definition at line 187 of file ROL_RieszVector.hpp.
|
inlinevirtual |
Definition at line 193 of file ROL_RieszVector.hpp.
|
inlineprivate |
Definition at line 178 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::isPrimalInitialized_, ROL::RieszDualVector< Real >::op_, ROL::RieszDualVector< Real >::primal_, ROL::RieszDualVector< Real >::tol_, and ROL::RieszDualVector< Real >::v_.
Referenced by ROL::RieszDualVector< Real >::dot(), and ROL::RieszDualVector< Real >::dual().
|
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::ElementwiseVector< Real >.
Definition at line 195 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::getVector(), ROL::RieszDualVector< Real >::initialize_primal(), ROL::RieszDualVector< Real >::isPrimalInitialized_, and ROL::RieszDualVector< Real >::primal_.
|
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. ---
Implements ROL::Vector< Real >.
Definition at line 204 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::op_, ROL::RieszDualVector< Real >::tol_, and ROL::RieszDualVector< 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 208 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::initialize_primal(), ROL::RieszDualVector< Real >::isPrimalInitialized_, and ROL::RieszDualVector< Real >::primal_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 215 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 219 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::getVector(), and ROL::RieszDualVector< Real >::v_.
|
inlinevirtual |
Implements ROL::ElementwiseVector< Real >.
Definition at line 224 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
|
inlinevirtual |
Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).
@param[in] C is a scalar. On return \f$\mathtt{*this} = C\f$. Uses #applyUnary methods for the computation. Please overload if a more efficient implementation is needed. ---
Reimplemented from ROL::Vector< Real >.
Definition at line 228 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
|
inlinevirtual |
Set vector to be uniform random between [l,u].
@param[in] l is a the lower bound. @param[in] u is a the upper bound. On return the components of \f$\mathtt{*this}\f$ are uniform random numbers on the interval \f$[l,u]\f$. 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 232 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
|
inline |
Definition at line 236 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
Referenced by ROL::RieszDualVector< Real >::applyBinary(), and ROL::RieszDualVector< Real >::dot().
|
inline |
Definition at line 240 of file ROL_RieszVector.hpp.
References ROL::RieszDualVector< Real >::v_.
|
private |
Definition at line 171 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszDualVector< Real >::applyBinary(), ROL::RieszDualVector< Real >::applyUnary(), ROL::RieszDualVector< Real >::clone(), ROL::RieszDualVector< Real >::getVector(), ROL::RieszDualVector< Real >::initialize_primal(), ROL::RieszDualVector< Real >::randomize(), ROL::RieszDualVector< Real >::reduce(), and ROL::RieszDualVector< Real >::setScalar().
|
mutableprivate |
Definition at line 172 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszDualVector< Real >::dot(), ROL::RieszDualVector< Real >::dual(), and ROL::RieszDualVector< Real >::initialize_primal().
|
private |
Definition at line 173 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszDualVector< Real >::clone(), and ROL::RieszDualVector< Real >::initialize_primal().
|
mutableprivate |
Definition at line 174 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszDualVector< Real >::clone(), and ROL::RieszDualVector< Real >::initialize_primal().
|
mutableprivate |
Definition at line 176 of file ROL_RieszVector.hpp.
Referenced by ROL::RieszDualVector< Real >::dot(), ROL::RieszDualVector< Real >::dual(), and ROL::RieszDualVector< Real >::initialize_primal().