ROL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ROL::RieszDualVector< Real > Class Template Reference

#include <ROL_RieszVector.hpp>

+ Inheritance diagram for ROL::RieszDualVector< Real >:

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}\). More...
 
virtual ROL::Ptr< Vclone () const
 Clone to make a new (uninitialized) vector. More...
 
virtual const Vdual () 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< VgetVector (void)
 
ROL::Ptr< const VgetVector (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< Vectorbasis (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 PrimalVector = RieszPrimalVector< Real >
 
using OP = LinearOperator< Real >
 

Private Member Functions

void initialize_primal (void) const
 

Private Attributes

const ROL::Ptr< Vv_
 
ROL::Ptr< PrimalVectorprimal_
 
const ROL::Ptr< OPop_
 
Real tol_
 
bool isPrimalInitialized_
 

Detailed Description

template<class Real>
class ROL::RieszDualVector< Real >

Definition at line 39 of file ROL_RieszVector.hpp.

Member Typedef Documentation

template<class Real >
using ROL::RieszDualVector< Real >::V = Vector<Real>
private

Definition at line 131 of file ROL_RieszVector.hpp.

template<class Real >
using ROL::RieszDualVector< Real >::PrimalVector = RieszPrimalVector<Real>
private

Definition at line 132 of file ROL_RieszVector.hpp.

template<class Real >
using ROL::RieszDualVector< Real >::OP = LinearOperator<Real>
private

Definition at line 133 of file ROL_RieszVector.hpp.

Constructor & Destructor Documentation

template<class Real >
ROL::RieszDualVector< Real >::RieszDualVector ( const ROL::Ptr< V > &  v,
const ROL::Ptr< OP > &  op,
Real  tol = std::sqrt(ROL_EPSILON<Real>()) 
)
inline

Definition at line 153 of file ROL_RieszVector.hpp.

template<class Real >
virtual ROL::RieszDualVector< Real >::~RieszDualVector ( )
inlinevirtual

Definition at line 159 of file ROL_RieszVector.hpp.

Member Function Documentation

template<class Real >
void ROL::RieszDualVector< Real >::initialize_primal ( void  ) const
inlineprivate
template<class Real >
virtual Real ROL::RieszDualVector< Real >::dot ( const V x) const
inlinevirtual

Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).

Parameters
[in]xis the vector that forms the dot product with \(\mathtt{*this}\).
Returns
The number equal to \(\langle \mathtt{*this}, x \rangle\).

Reimplemented from ROL::ElementwiseVector< Real >.

Definition at line 161 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::initialize_primal(), ROL::RieszDualVector< Real >::isPrimalInitialized_, and ROL::RieszDualVector< Real >::primal_.

template<class Real >
virtual ROL::Ptr<V> ROL::RieszDualVector< Real >::clone ( ) const
inlinevirtual

Clone to make a new (uninitialized) vector.

Returns
A reference-counted pointer to the cloned vector.

Provides the means of allocating temporary memory in ROL.


Implements ROL::Vector< Real >.

Definition at line 170 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::op_, ROL::RieszDualVector< Real >::tol_, and ROL::RieszDualVector< Real >::v_.

template<class Real >
virtual const V& ROL::RieszDualVector< 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::Vector< Real >.

Definition at line 174 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::initialize_primal(), ROL::RieszDualVector< Real >::isPrimalInitialized_, and ROL::RieszDualVector< Real >::primal_.

template<class Real >
void ROL::RieszDualVector< Real >::applyUnary ( const Elementwise::UnaryFunction< Real > &  f)
inlinevirtual

Implements ROL::ElementwiseVector< Real >.

Definition at line 181 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
void ROL::RieszDualVector< Real >::applyBinary ( const Elementwise::BinaryFunction< Real > &  f,
const V x 
)
inlinevirtual

Implements ROL::ElementwiseVector< Real >.

Definition at line 185 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
Real ROL::RieszDualVector< Real >::reduce ( const Elementwise::ReductionOp< Real > &  r) const
inlinevirtual

Implements ROL::ElementwiseVector< Real >.

Definition at line 190 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
void ROL::RieszDualVector< Real >::setScalar ( const Real  C)
inlinevirtual

Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).

Parameters
[in]Cis 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 194 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
void ROL::RieszDualVector< Real >::randomize ( const Real  l = 0.0,
const Real  u = 1.0 
)
inlinevirtual

Set vector to be uniform random between [l,u].

Parameters
[in]lis a the lower bound.
[in]uis 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 198 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
ROL::Ptr<V> ROL::RieszDualVector< Real >::getVector ( void  )
inline

Definition at line 202 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

template<class Real >
ROL::Ptr<const V> ROL::RieszDualVector< Real >::getVector ( void  ) const
inline

Definition at line 206 of file ROL_RieszVector.hpp.

References ROL::RieszDualVector< Real >::v_.

Member Data Documentation

template<class Real >
const ROL::Ptr<V> ROL::RieszDualVector< Real >::v_
private
template<class Real >
ROL::Ptr<PrimalVector> ROL::RieszDualVector< Real >::primal_
mutableprivate
template<class Real >
const ROL::Ptr<OP> ROL::RieszDualVector< Real >::op_
private
template<class Real >
Real ROL::RieszDualVector< Real >::tol_
mutableprivate
template<class Real >
bool ROL::RieszDualVector< Real >::isPrimalInitialized_
mutableprivate

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