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

Provides the std::vector implementation of the ROL::Vector interface. More...

#include <ROL_SROMVector.hpp>

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

Public Member Functions

 SROMVector (const Teuchos::RCP< ProbabilityVector< Real > > &pvec, const Teuchos::RCP< AtomVector< Real > > &avec)
 
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 () 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...
 
int dimension (void) const
 Return dimension of the vector space. 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
 
const Teuchos::RCP< const AtomVector< Real > > getAtomVector (void) const
 
const Teuchos::RCP< const ProbabilityVector< Real > > getProbabilityVector (void) const
 
Teuchos::RCP< AtomVector< Real > > getAtomVector (void)
 
Teuchos::RCP< ProbabilityVector< Real > > getProbabilityVector (void)
 
void setAtomVector (const AtomVector< Real > &vec)
 
void setProbabilityVector (const ProbabilityVector< Real > &vec)
 
- Public Member Functions inherited from ROL::Vector< Real >
virtual ~Vector ()
 
virtual void zero ()
 Set to zero vector. More...
 
virtual Teuchos::RCP< Vectorbasis (const int i) const
 Return i-th basis 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 Types

typedef std::vector< Real >::size_type uint
 

Private Attributes

const Teuchos::RCP< ProbabilityVector< Real > > pvec_
 
const Teuchos::RCP< AtomVector< Real > > avec_
 
Teuchos::RCP< Vector< Real > > dual_pvec_
 
Teuchos::RCP< Vector< Real > > dual_avec_
 
Teuchos::RCP< SROMVector< Real > > dual_vec_
 

Detailed Description

template<class Real>
class ROL::SROMVector< Real >

Provides the std::vector implementation of the ROL::Vector interface.

Definition at line 61 of file ROL_SROMVector.hpp.

Member Typedef Documentation

template<class Real>
typedef std::vector<Real>::size_type ROL::SROMVector< Real >::uint
private

Definition at line 62 of file ROL_SROMVector.hpp.

Constructor & Destructor Documentation

template<class Real>
ROL::SROMVector< Real >::SROMVector ( const Teuchos::RCP< ProbabilityVector< Real > > &  pvec,
const Teuchos::RCP< AtomVector< Real > > &  avec 
)
inline

Member Function Documentation

template<class Real>
void ROL::SROMVector< 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 80 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::getAtomVector(), ROL::SROMVector< Real >::getProbabilityVector(), and ROL::SROMVector< Real >::set().

Referenced by ROL::SROMVector< Real >::set().

template<class Real>
void ROL::SROMVector< 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 86 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::getAtomVector(), ROL::SROMVector< Real >::getProbabilityVector(), and ROL::SROMVector< Real >::plus().

Referenced by ROL::SROMVector< Real >::plus().

template<class Real>
void ROL::SROMVector< 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 92 of file ROL_SROMVector.hpp.

template<class Real>
void ROL::SROMVector< 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 97 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::axpy(), ROL::SROMVector< Real >::getAtomVector(), and ROL::SROMVector< Real >::getProbabilityVector().

Referenced by ROL::SROMVector< Real >::axpy().

template<class Real>
Real ROL::SROMVector< 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 103 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::dot(), ROL::SROMVector< Real >::getAtomVector(), and ROL::SROMVector< Real >::getProbabilityVector().

Referenced by ROL::SROMVector< Real >::dot(), and ROL::SROMVector< Real >::norm().

template<class Real>
Real ROL::SROMVector< Real >::norm ( ) 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 110 of file ROL_SROMVector.hpp.

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

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::SROMVector< 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 116 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::SROMVector().

Referenced by ROL::SROMVector< Real >::SROMVector().

template<class Real>
const Vector<Real>& ROL::SROMVector< 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 122 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::dual_vec_, and ROL::SROMVector< Real >::SROMVector().

template<class Real>
int ROL::SROMVector< 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 131 of file ROL_SROMVector.hpp.

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

Reimplemented from ROL::Vector< Real >.

Definition at line 135 of file ROL_SROMVector.hpp.

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

Reimplemented from ROL::Vector< Real >.

Definition at line 146 of file ROL_SROMVector.hpp.

template<class Real>
const Teuchos::RCP<const AtomVector<Real> > ROL::SROMVector< Real >::getAtomVector ( void  ) const
inline
template<class Real>
const Teuchos::RCP<const ProbabilityVector<Real> > ROL::SROMVector< Real >::getProbabilityVector ( void  ) const
inline
template<class Real>
Teuchos::RCP<AtomVector<Real> > ROL::SROMVector< Real >::getAtomVector ( void  )
inline

Definition at line 163 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::avec_.

template<class Real>
Teuchos::RCP<ProbabilityVector<Real> > ROL::SROMVector< Real >::getProbabilityVector ( void  )
inline

Definition at line 167 of file ROL_SROMVector.hpp.

References ROL::SROMVector< Real >::pvec_.

template<class Real>
void ROL::SROMVector< Real >::setAtomVector ( const AtomVector< Real > &  vec)
inline

Definition at line 171 of file ROL_SROMVector.hpp.

template<class Real>
void ROL::SROMVector< Real >::setProbabilityVector ( const ProbabilityVector< Real > &  vec)
inline

Definition at line 175 of file ROL_SROMVector.hpp.

Member Data Documentation

template<class Real>
const Teuchos::RCP<ProbabilityVector<Real> > ROL::SROMVector< Real >::pvec_
private

Definition at line 64 of file ROL_SROMVector.hpp.

Referenced by ROL::SROMVector< Real >::getProbabilityVector().

template<class Real>
const Teuchos::RCP<AtomVector<Real> > ROL::SROMVector< Real >::avec_
private

Definition at line 65 of file ROL_SROMVector.hpp.

Referenced by ROL::SROMVector< Real >::getAtomVector().

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::SROMVector< Real >::dual_pvec_
mutableprivate

Definition at line 67 of file ROL_SROMVector.hpp.

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::SROMVector< Real >::dual_avec_
mutableprivate

Definition at line 68 of file ROL_SROMVector.hpp.

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

Definition at line 69 of file ROL_SROMVector.hpp.

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


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