ROL
Public Member Functions | Private 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 (Ptr< ParameterList > &parlist, const Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (std::vector< Ptr< ParameterList > > &parlist, const Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (Ptr< ParameterList > &parlistObj, std::vector< Ptr< ParameterList > > &parlistCon, const Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (const Ptr< Vector< Real > > &vec, const Ptr< std::vector< Real > > &statObj, const std::vector< Ptr< std::vector< Real > > > &statCon)
 
 RiskVector (const Ptr< Vector< Real > > &vec)
 
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...
 
Ptr< 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...
 
Ptr< 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
 
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...
 
int dimension (void) const
 Return dimension of the vector space. More...
 
Ptr< const StdVector< Real > > getStatisticVector (const int comp, const int index=0) const
 
Ptr< StdVector< Real > > getStatisticVector (const int comp, const int index=0)
 
Ptr< const Vector< Real > > getVector (void) const
 
Ptr< Vector< Real > > getVector (void)
 
Ptr< std::vector< Real > > getStatistic (const int comp=0, const int index=0)
 
Ptr< const std::vector< Real > > getStatistic (const int comp=0, const int index=0) const
 
void setStatistic (const Real stat, const int comp=0, const int index=0)
 
void setStatistic (const std::vector< Real > &stat, const int comp=0, const int index=0)
 
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 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 Member Functions

void initializeObj (Ptr< ParameterList > &parlist, const Real stat=1)
 
void initializeCon (std::vector< Ptr< ParameterList > > &parlist, const Real stat=1)
 

Private Attributes

Ptr< std::vector< Real > > statObj_
 
Ptr< StdVector< Real > > statObj_vec_
 
bool augmentedObj_
 
int nStatObj_
 
std::vector< Ptr< std::vector
< Real > > > 
statCon_
 
std::vector< Ptr< StdVector
< Real > > > 
statCon_vec_
 
bool augmentedCon_
 
std::vector< int > nStatCon_
 
Ptr< Vector< Real > > vec_
 
bool isDualInitialized_
 
Ptr< std::vector< Real > > dualObj_
 
std::vector< Ptr< std::vector
< Real > > > 
dualCon_
 
Ptr< Vector< Real > > dual_vec1_
 
Ptr< RiskVector< Real > > dual_vec_
 

Detailed Description

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

Definition at line 20 of file ROL_RiskVector.hpp.

Constructor & Destructor Documentation

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

Definition at line 93 of file ROL_RiskVector.hpp.

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

template<class Real>
ROL::RiskVector< Real >::RiskVector ( std::vector< Ptr< ParameterList > > &  parlist,
const Ptr< Vector< Real > > &  vec,
const Real  stat = 0 
)
inline

Definition at line 104 of file ROL_RiskVector.hpp.

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

template<class Real>
ROL::RiskVector< Real >::RiskVector ( Ptr< ParameterList > &  parlistObj,
std::vector< Ptr< ParameterList > > &  parlistCon,
const Ptr< Vector< Real > > &  vec,
const Real  stat = 0 
)
inline
template<class Real>
ROL::RiskVector< Real >::RiskVector ( const Ptr< Vector< Real > > &  vec,
const Ptr< std::vector< Real > > &  statObj,
const std::vector< Ptr< std::vector< Real > > > &  statCon 
)
inline
template<class Real>
ROL::RiskVector< Real >::RiskVector ( const Ptr< Vector< Real > > &  vec)
inline

Definition at line 156 of file ROL_RiskVector.hpp.

Member Function Documentation

template<class Real>
void ROL::RiskVector< Real >::initializeObj ( Ptr< ParameterList > &  parlist,
const Real  stat = 1 
)
inlineprivate
template<class Real>
void ROL::RiskVector< Real >::initializeCon ( std::vector< Ptr< ParameterList > > &  parlist,
const Real  stat = 1 
)
inlineprivate
template<class Real>
void ROL::RiskVector< Real >::set ( const Vector< Real > &  x)
inlinevirtual

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

Parameters
[in]xis a vector.

On return \(\mathtt{*this} = x\). 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 161 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::getStatisticVector(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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 177 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::getStatisticVector(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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 193 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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}\).

Parameters
[in]alphais the scaling of x.
[in]xis a vector.

On return \(\mathtt{*this} = \mathtt{*this} + \alpha x \). 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 208 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::getStatisticVector(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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 224 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::getStatisticVector(), ROL::RiskVector< Real >::getVector(), ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

Referenced by ROL::RiskVector< Real >::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 241 of file ROL_RiskVector.hpp.

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

template<class Real>
Ptr<Vector<Real> > ROL::RiskVector< Real >::clone ( void  ) 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 245 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::nStatCon_, ROL::RiskVector< Real >::nStatObj_, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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 260 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::dual_vec1_, ROL::RiskVector< Real >::dual_vec_, ROL::RiskVector< Real >::dualCon_, ROL::RiskVector< Real >::dualObj_, ROL::RiskVector< Real >::isDualInitialized_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::statCon_, ROL::RiskVector< Real >::statObj_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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

Return i-th basis vector.

Parameters
[in]iis the index of the basis function.
Returns
A reference-counted pointer to the basis vector with index 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 296 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::nStatCon_, ROL::RiskVector< Real >::nStatObj_, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

template<class Real>
void ROL::RiskVector< Real >::applyUnary ( const Elementwise::UnaryFunction< Real > &  f)
inlinevirtual
template<class Real>
void ROL::RiskVector< Real >::applyBinary ( const Elementwise::BinaryFunction< Real > &  f,
const Vector< Real > &  x 
)
inlinevirtual
template<class Real>
Real ROL::RiskVector< Real >::reduce ( const Elementwise::ReductionOp< Real > &  r) const
inlinevirtual
template<class Real>
void ROL::RiskVector< 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 388 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

template<class Real>
void ROL::RiskVector< 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 403 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

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

Return dimension of the vector space.

Returns
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 418 of file ROL_RiskVector.hpp.

References ROL::RiskVector< Real >::augmentedCon_, ROL::RiskVector< Real >::augmentedObj_, dim, ROL::RiskVector< Real >::statCon_vec_, ROL::RiskVector< Real >::statObj_vec_, and ROL::RiskVector< Real >::vec_.

template<class Real>
Ptr<const StdVector<Real> > ROL::RiskVector< Real >::getStatisticVector ( const int  comp,
const int  index = 0 
) const
inline
template<class Real>
Ptr<StdVector<Real> > ROL::RiskVector< Real >::getStatisticVector ( const int  comp,
const int  index = 0 
)
inline
template<class Real>
Ptr<const Vector<Real> > ROL::RiskVector< Real >::getVector ( void  ) const
inline
template<class Real>
Ptr<Vector<Real> > ROL::RiskVector< Real >::getVector ( void  )
inline

Definition at line 467 of file ROL_RiskVector.hpp.

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

template<class Real>
Ptr<std::vector<Real> > ROL::RiskVector< Real >::getStatistic ( const int  comp = 0,
const int  index = 0 
)
inline
template<class Real>
Ptr<const std::vector<Real> > ROL::RiskVector< Real >::getStatistic ( const int  comp = 0,
const int  index = 0 
) const
inline
template<class Real>
void ROL::RiskVector< Real >::setStatistic ( const Real  stat,
const int  comp = 0,
const int  index = 0 
)
inline
template<class Real>
void ROL::RiskVector< Real >::setStatistic ( const std::vector< Real > &  stat,
const int  comp = 0,
const int  index = 0 
)
inline
template<class Real>
void ROL::RiskVector< Real >::setVector ( const Vector< Real > &  vec)
inline

Definition at line 548 of file ROL_RiskVector.hpp.

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

Member Data Documentation

template<class Real>
Ptr<std::vector<Real> > ROL::RiskVector< Real >::statObj_
private
template<class Real>
Ptr<StdVector<Real> > ROL::RiskVector< Real >::statObj_vec_
private
template<class Real>
bool ROL::RiskVector< Real >::augmentedObj_
private
template<class Real>
int ROL::RiskVector< Real >::nStatObj_
private
template<class Real>
std::vector<Ptr<std::vector<Real> > > ROL::RiskVector< Real >::statCon_
private
template<class Real>
std::vector<Ptr<StdVector<Real> > > ROL::RiskVector< Real >::statCon_vec_
private
template<class Real>
bool ROL::RiskVector< Real >::augmentedCon_
private
template<class Real>
std::vector<int> ROL::RiskVector< Real >::nStatCon_
private
template<class Real>
Ptr<Vector<Real> > ROL::RiskVector< Real >::vec_
private
template<class Real>
bool ROL::RiskVector< Real >::isDualInitialized_
mutableprivate

Definition at line 34 of file ROL_RiskVector.hpp.

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

template<class Real>
Ptr<std::vector<Real> > ROL::RiskVector< Real >::dualObj_
mutableprivate

Definition at line 35 of file ROL_RiskVector.hpp.

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

template<class Real>
std::vector<Ptr<std::vector<Real> > > ROL::RiskVector< Real >::dualCon_
mutableprivate

Definition at line 36 of file ROL_RiskVector.hpp.

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

template<class Real>
Ptr<Vector<Real> > ROL::RiskVector< Real >::dual_vec1_
mutableprivate

Definition at line 37 of file ROL_RiskVector.hpp.

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

template<class Real>
Ptr<RiskVector<Real> > ROL::RiskVector< Real >::dual_vec_
mutableprivate

Definition at line 38 of file ROL_RiskVector.hpp.

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


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