ROL
ROL::RieszPrimalVector< Real > Class Template Reference

#include <ROL_RieszVector.hpp>

Inheritance diagram for ROL::RieszPrimalVector< Real >:

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
virtual ROL::Ptr< Vclone () const
 Clone to make a new (uninitialized) vector.
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.
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< VgetVector (void)
ROL::Ptr< const VgetVector (void) const
Public Member Functions inherited from ROL::ElementwiseVector< Real >
virtual ~ElementwiseVector ()
void plus (const Vector< Real > &x)
void scale (const Real alpha)
 Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\).
virtual Real norm () const
 Returns \( \| y \| \) where \(y = \mathtt{*this}\).
void axpy (const Real alpha, const Vector< Real > &x)
void zero ()
 Set to zero vector.
void set (const Vector< Real > &x)
Public Member Functions inherited from ROL::ROL::Vector< Real >
virtual ~Vector ()
virtual void plus (const Vector &x)=0
 Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\).
virtual Real dot (const Vector &x) const =0
 Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).
virtual void axpy (const Real alpha, const Vector &x)
 Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\).
virtual ROL::Ptr< Vectorbasis (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 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 applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector &x)
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.

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< Vv_
ROL::Ptr< DualVectordual_
const ROL::Ptr< OPop_
Real tol_
bool isDualInitialized_

Detailed Description

template<class Real>
class ROL::RieszPrimalVector< Real >

Definition at line 43 of file ROL_RieszVector.hpp.

Member Typedef Documentation

◆ V

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

Definition at line 45 of file ROL_RieszVector.hpp.

◆ DualVector

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

Definition at line 46 of file ROL_RieszVector.hpp.

◆ OP

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

Definition at line 47 of file ROL_RieszVector.hpp.

Constructor & Destructor Documentation

◆ RieszPrimalVector()

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

Definition at line 67 of file ROL_RieszVector.hpp.

References isDualInitialized_, op_, ROL::ROL_EPSILON(), tol_, and v_.

Referenced by applyBinary(), and dot().

◆ ~RieszPrimalVector()

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

Definition at line 73 of file ROL_RieszVector.hpp.

Member Function Documentation

◆ initialize_dual()

template<class Real>
void ROL::RieszPrimalVector< Real >::initialize_dual ( void ) const
inlineprivate

Definition at line 58 of file ROL_RieszVector.hpp.

References dual_, isDualInitialized_, op_, tol_, and v_.

Referenced by dot(), and dual().

◆ dot()

template<class Real>
virtual Real ROL::RieszPrimalVector< Real >::dot ( const V & x) const
inlinevirtual

◆ clone()

template<class Real>
virtual ROL::Ptr< V > ROL::RieszPrimalVector< Real >::clone ( ) const
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::ROL::Vector< Real >.

Definition at line 84 of file ROL_RieszVector.hpp.

References op_, tol_, and v_.

◆ dual()

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

Definition at line 88 of file ROL_RieszVector.hpp.

References dual_, initialize_dual(), and isDualInitialized_.

◆ applyUnary()

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

Implements ROL::ElementwiseVector< Real >.

Definition at line 95 of file ROL_RieszVector.hpp.

References v_.

◆ applyBinary()

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

Implements ROL::ElementwiseVector< Real >.

Definition at line 99 of file ROL_RieszVector.hpp.

References getVector(), RieszPrimalVector(), and v_.

◆ reduce()

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

Implements ROL::ElementwiseVector< Real >.

Definition at line 104 of file ROL_RieszVector.hpp.

References v_.

◆ setScalar()

template<class Real>
void ROL::RieszPrimalVector< Real >::setScalar ( const Real C)
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::ROL::Vector< Real >.

Definition at line 108 of file ROL_RieszVector.hpp.

References v_.

◆ randomize()

template<class Real>
void ROL::RieszPrimalVector< Real >::randomize ( const Real l = 0.0,
const Real u = 1.0 )
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::ROL::Vector< Real >.

Definition at line 112 of file ROL_RieszVector.hpp.

References v_.

◆ getVector() [1/2]

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

Definition at line 116 of file ROL_RieszVector.hpp.

References v_.

Referenced by applyBinary(), and dot().

◆ getVector() [2/2]

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

Definition at line 120 of file ROL_RieszVector.hpp.

References v_.

Member Data Documentation

◆ v_

template<class Real>
const ROL::Ptr<V> ROL::RieszPrimalVector< Real >::v_
private

◆ dual_

template<class Real>
ROL::Ptr<DualVector> ROL::RieszPrimalVector< Real >::dual_
mutableprivate

Definition at line 52 of file ROL_RieszVector.hpp.

Referenced by dot(), dual(), and initialize_dual().

◆ op_

template<class Real>
const ROL::Ptr<OP> ROL::RieszPrimalVector< Real >::op_
private

Definition at line 53 of file ROL_RieszVector.hpp.

Referenced by clone(), initialize_dual(), and RieszPrimalVector().

◆ tol_

template<class Real>
Real ROL::RieszPrimalVector< Real >::tol_
mutableprivate

Definition at line 54 of file ROL_RieszVector.hpp.

Referenced by clone(), initialize_dual(), and RieszPrimalVector().

◆ isDualInitialized_

template<class Real>
bool ROL::RieszPrimalVector< Real >::isDualInitialized_
mutableprivate

Definition at line 56 of file ROL_RieszVector.hpp.

Referenced by dot(), dual(), initialize_dual(), and RieszPrimalVector().


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