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 (ROL::Ptr< ROL::ParameterList > &parlist, const ROL::Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (std::vector< ROL::Ptr< ROL::ParameterList > > &parlist, const ROL::Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (ROL::Ptr< ROL::ParameterList > &parlistObj, std::vector< ROL::Ptr< ROL::ParameterList > > &parlistCon, const ROL::Ptr< Vector< Real > > &vec, const Real stat=0)
 
 RiskVector (const ROL::Ptr< Vector< Real > > &vec, const ROL::Ptr< std::vector< Real > > &statObj, const std::vector< ROL::Ptr< std::vector< Real > > > &statCon)
 
 RiskVector (const ROL::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...
 
ROL::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...
 
ROL::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...
 
ROL::Ptr< const StdVector< Real > > getStatisticVector (const int comp, const int index=0) const
 
ROL::Ptr< StdVector< Real > > getStatisticVector (const int comp, const int index=0)
 
ROL::Ptr< const Vector< Real > > getVector (void) const
 
ROL::Ptr< Vector< Real > > getVector (void)
 
ROL::Ptr< std::vector< Real > > getStatistic (const int comp=0, const int index=0)
 
ROL::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 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 (ROL::Ptr< ROL::ParameterList > &parlist, const Real stat=1)
 
void initializeCon (std::vector< ROL::Ptr< ROL::ParameterList > > &parlist, const Real stat=1)
 

Private Attributes

ROL::Ptr< std::vector< Real > > statObj_
 
ROL::Ptr< StdVector< Real > > statObj_vec_
 
bool augmentedObj_
 
int nStatObj_
 
std::vector< ROL::Ptr
< std::vector< Real > > > 
statCon_
 
std::vector< ROL::Ptr
< StdVector< Real > > > 
statCon_vec_
 
bool augmentedCon_
 
std::vector< int > nStatCon_
 
ROL::Ptr< Vector< Real > > vec_
 
bool isDualInitialized_
 
ROL::Ptr< std::vector< Real > > dualObj_
 
std::vector< ROL::Ptr
< std::vector< Real > > > 
dualCon_
 
ROL::Ptr< Vector< Real > > dual_vec1_
 
ROL::Ptr< 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

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

Definition at line 127 of file ROL_RiskVector.hpp.

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

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

Definition at line 138 of file ROL_RiskVector.hpp.

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

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

Definition at line 190 of file ROL_RiskVector.hpp.

Member Function Documentation

template<class Real>
void ROL::RiskVector< Real >::initializeObj ( ROL::Ptr< ROL::ParameterList > &  parlist,
const Real  stat = 1 
)
inlineprivate
template<class Real>
void ROL::RiskVector< Real >::initializeCon ( std::vector< ROL::Ptr< ROL::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 195 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 211 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 227 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 242 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 258 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 275 of file ROL_RiskVector.hpp.

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

template<class Real>
ROL::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 279 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 294 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>
ROL::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 330 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 422 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 437 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 452 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>
ROL::Ptr<const StdVector<Real> > ROL::RiskVector< Real >::getStatisticVector ( const int  comp,
const int  index = 0 
) const
inline
template<class Real>
ROL::Ptr<StdVector<Real> > ROL::RiskVector< Real >::getStatisticVector ( const int  comp,
const int  index = 0 
)
inline
template<class Real>
ROL::Ptr<const Vector<Real> > ROL::RiskVector< Real >::getVector ( void  ) const
inline
template<class Real>
ROL::Ptr<Vector<Real> > ROL::RiskVector< Real >::getVector ( void  )
inline

Definition at line 501 of file ROL_RiskVector.hpp.

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

template<class Real>
ROL::Ptr<std::vector<Real> > ROL::RiskVector< Real >::getStatistic ( const int  comp = 0,
const int  index = 0 
)
inline
template<class Real>
ROL::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 582 of file ROL_RiskVector.hpp.

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

Member Data Documentation

template<class Real>
ROL::Ptr<std::vector<Real> > ROL::RiskVector< Real >::statObj_
private
template<class Real>
ROL::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<ROL::Ptr<std::vector<Real> > > ROL::RiskVector< Real >::statCon_
private
template<class Real>
std::vector<ROL::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>
ROL::Ptr<Vector<Real> > ROL::RiskVector< Real >::vec_
private
template<class Real>
bool ROL::RiskVector< Real >::isDualInitialized_
mutableprivate

Definition at line 68 of file ROL_RiskVector.hpp.

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

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

Definition at line 69 of file ROL_RiskVector.hpp.

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

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

Definition at line 70 of file ROL_RiskVector.hpp.

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

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

Definition at line 71 of file ROL_RiskVector.hpp.

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

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

Definition at line 72 of file ROL_RiskVector.hpp.

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


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