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

#include <ROL_RiskVector.hpp>

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

Public Member Functions

 RiskVector (Teuchos::ParameterList &parlist, const Teuchos::RCP< Vector< Real > > &vec, const Real stat=1)
 
 RiskVector (const Teuchos::RCP< Vector< Real > > &vec, const bool augmented=false)
 
 RiskVector (const Teuchos::RCP< Vector< Real > > &vec, const std::vector< Real > &stat, const bool augmented=true)
 
void set (const Vector< Real > &x)
 Set \(y \leftarrow x\) where \(y = \mathtt{*this}\). More...
 
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...
 
void axpy (const Real alpha, const Vector< Real > &x)
 Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\). More...
 
Real dot (const Vector< Real > &x) const
 Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\). More...
 
Real norm (void) const
 Returns \( \| y \| \) where \(y = \mathtt{*this}\). More...
 
Teuchos::RCP< Vector< Real > > clone (void) const
 Clone to make a new (uninitialized) vector. More...
 
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. More...
 
Teuchos::RCP< Vector< Real > > basis (const int i) const
 Return i-th basis vector. More...
 
void applyUnary (const Elementwise::UnaryFunction< Real > &f)
 
void applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector< Real > &x)
 
Real reduce (const Elementwise::ReductionOp< Real > &r) const
 
int dimension (void) const
 Return dimension of the vector space. More...
 
Teuchos::RCP< const StdVector< Real > > getStatistic (void) const
 
Teuchos::RCP< StdVector< Real > > getStatistic (void)
 
Teuchos::RCP< const Vector< Real > > getVector (void) const
 
Teuchos::RCP< Vector< Real > > getVector (void)
 
const Real getStatistic (const int i) const
 
void getStatistic (std::vector< Real > &stat) const
 
void setStatistic (const Real stat)
 
void setStatistic (const std::vector< Real > &stat)
 
void setVector (const Vector< Real > &vec)
 
- Public Member Functions inherited from ROL::Vector< Real >
virtual ~Vector ()
 
virtual void zero ()
 Set to zero vector. More...
 
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 Attributes

Teuchos::RCP< std::vector< Real > > stat_
 
Teuchos::RCP< StdVector< Real > > stat_vec_
 
Teuchos::RCP< Vector< Real > > vec_
 
bool augmented_
 
int nStat_
 
bool isDualInitialized_
 
Teuchos::RCP< Vector< Real > > dual_vec1_
 
Teuchos::RCP< RiskVector< Real > > dual_vec_
 

Detailed Description

template<class Real>
class ROL::RiskVector< Real >

Definition at line 54 of file ROL_RiskVector.hpp.

Constructor & Destructor Documentation

◆ RiskVector() [1/3]

template<class Real>
ROL::RiskVector< Real >::RiskVector ( Teuchos::ParameterList &  parlist,
const Teuchos::RCP< Vector< Real > > &  vec,
const Real  stat = 1 
)
inline

◆ RiskVector() [2/3]

template<class Real>
ROL::RiskVector< Real >::RiskVector ( const Teuchos::RCP< Vector< Real > > &  vec,
const bool  augmented = false 
)
inline

◆ RiskVector() [3/3]

template<class Real>
ROL::RiskVector< Real >::RiskVector ( const Teuchos::RCP< Vector< Real > > &  vec,
const std::vector< Real > &  stat,
const bool  augmented = true 
)
inline

Member Function Documentation

◆ set()

template<class Real>
void ROL::RiskVector< Real >::set ( const Vector< Real > &  x)
inlinevirtual

Set \(y \leftarrow x\) where \(y = \mathtt{*this}\).

   @param[in]      x     is a vector.

   On return \f$\mathtt{*this} = x\f$.
   Uses #zero and #plus methods for the computation.
   Please overload if a more efficient implementation is needed.

   ---

Reimplemented from ROL::Vector< Real >.

Definition at line 109 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::getStatistic(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ plus()

template<class Real>
void ROL::RiskVector< Real >::plus ( const Vector< Real > &  x)
inlinevirtual

Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\).

Parameters
[in]xis the vector to be added to \(\mathtt{*this}\).

On return \(\mathtt{*this} = \mathtt{*this} + x\).


Implements ROL::Vector< Real >.

Definition at line 117 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::getStatistic(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ scale()

template<class Real>
void ROL::RiskVector< Real >::scale ( const Real  alpha)
inlinevirtual

Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\).

Parameters
[in]alphais the scaling of \(\mathtt{*this}\).

On return \(\mathtt{*this} = \alpha (\mathtt{*this}) \).


Implements ROL::Vector< Real >.

Definition at line 125 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ axpy()

template<class Real>
void ROL::RiskVector< Real >::axpy ( const Real  alpha,
const Vector< Real > &  x 
)
inlinevirtual

Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\).

   @param[in]      alpha is the scaling of @b x.
   @param[in]      x     is a vector.

   On return \f$\mathtt{*this} = \mathtt{*this} + \alpha x \f$.
   Uses #clone, #set, #scale and #plus for the computation.
   Please overload if a more efficient implementation is needed.

   ---

Reimplemented from ROL::Vector< Real >.

Definition at line 132 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::getStatistic(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ dot()

template<class Real>
Real ROL::RiskVector< Real >::dot ( const Vector< Real > &  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\).

Implements ROL::Vector< Real >.

Definition at line 140 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::getStatistic(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

Referenced by ROL::RiskVector< Real >::norm().

◆ norm()

template<class Real>
Real ROL::RiskVector< Real >::norm ( void  ) const
inlinevirtual

Returns \( \| y \| \) where \(y = \mathtt{*this}\).

Returns
A nonnegative number equal to the norm of \(\mathtt{*this}\).

Implements ROL::Vector< Real >.

Definition at line 149 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::dot().

◆ clone()

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::RiskVector< Real >::clone ( void  ) 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::Vector< Real >.

Definition at line 153 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::nStat_, ROL::RiskVector< Real >::RiskVector(), and ROL::RiskVector< Real >::vec_.

◆ dual()

template<class Real>
const Vector<Real>& ROL::RiskVector< 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 158 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::dual_vec1_, ROL::RiskVector< Real >::dual_vec_, ROL::RiskVector< Real >::isDualInitialized_, ROL::RiskVector< Real >::nStat_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::stat_, and ROL::RiskVector< Real >::vec_.

◆ basis()

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::RiskVector< Real >::basis ( const int  i) const
inlinevirtual

Return i-th basis vector.

   @param[in] i is the index of the basis function.
   @return A reference-counted pointer to the basis vector with index @b i.

   Overloading the basis is only required if the default gradient implementation
   is used, which computes a finite-difference approximation.

   ---

Reimplemented from ROL::Vector< Real >.

Definition at line 176 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::nStat_, ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ applyUnary()

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

◆ applyBinary()

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

◆ reduce()

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

◆ dimension()

template<class Real>
int ROL::RiskVector< Real >::dimension ( void  ) const
inlinevirtual

Return dimension of the vector space.

   @return The dimension of the vector space, i.e., the total number of basis vectors.

   Overload if the basis is overloaded.

   ---

Reimplemented from ROL::Vector< Real >.

Definition at line 218 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmented_, ROL::RiskVector< Real >::stat_vec_, and ROL::RiskVector< Real >::vec_.

◆ getStatistic() [1/4]

template<class Real>
Teuchos::RCP<const StdVector<Real> > ROL::RiskVector< Real >::getStatistic ( void  ) const
inline

◆ getStatistic() [2/4]

template<class Real>
Teuchos::RCP<StdVector<Real> > ROL::RiskVector< Real >::getStatistic ( void  )
inline

Definition at line 233 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::stat_vec_.

◆ getVector() [1/2]

template<class Real>
Teuchos::RCP<const Vector<Real> > ROL::RiskVector< Real >::getVector ( void  ) const
inline

◆ getVector() [2/2]

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::RiskVector< Real >::getVector ( void  )
inline

Definition at line 241 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::vec_.

◆ getStatistic() [3/4]

template<class Real>
const Real ROL::RiskVector< Real >::getStatistic ( const int  i) const
inline

◆ getStatistic() [4/4]

template<class Real>
void ROL::RiskVector< Real >::getStatistic ( std::vector< Real > &  stat) const
inline

◆ setStatistic() [1/2]

template<class Real>
void ROL::RiskVector< Real >::setStatistic ( const Real  stat)
inline

◆ setStatistic() [2/2]

template<class Real>
void ROL::RiskVector< Real >::setStatistic ( const std::vector< Real > &  stat)
inline

◆ setVector()

template<class Real>
void ROL::RiskVector< Real >::setVector ( const Vector< Real > &  vec)
inline

Member Data Documentation

◆ stat_

template<class Real>
Teuchos::RCP<std::vector<Real> > ROL::RiskVector< Real >::stat_
private

◆ stat_vec_

template<class Real>
Teuchos::RCP<StdVector<Real> > ROL::RiskVector< Real >::stat_vec_
private

◆ vec_

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::RiskVector< Real >::vec_
private

◆ augmented_

template<class Real>
bool ROL::RiskVector< Real >::augmented_
private

◆ nStat_

template<class Real>
int ROL::RiskVector< Real >::nStat_
private

◆ isDualInitialized_

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

Definition at line 63 of file ROL_RiskVector.hpp.

Referenced by ROL::RiskVector< Real >::dual().

◆ dual_vec1_

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::RiskVector< Real >::dual_vec1_
mutableprivate

Definition at line 64 of file ROL_RiskVector.hpp.

Referenced by ROL::RiskVector< Real >::dual().

◆ dual_vec_

template<class Real>
Teuchos::RCP<RiskVector<Real> > ROL::RiskVector< Real >::dual_vec_
mutableprivate

Definition at line 65 of file ROL_RiskVector.hpp.

Referenced by ROL::RiskVector< Real >::dual().


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