ROL
Public Member Functions | Private Types | List of all members
ROL::MultiVector< Real > Class Template Referenceabstract

Provides a container and operations on multiple ROL vectors for use with other Trilinos packages which require multivectors. More...

#include <ROL_MultiVector.hpp>

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

Public Member Functions

virtual ~MultiVector ()
 
virtual PMV clone () const =0
 Make a new MultiVector of the same dimensions. More...
 
virtual PMV clone (const int numvecs) const =0
 Make a new MultiVector of specified "width". More...
 
virtual PMV deepCopy () const =0
 Make a deep copy of this MultiVector. More...
 
virtual PMV deepCopy (const std::vector< int > &index) const =0
 Make a deep copy of this MultiVector. More...
 
virtual PMV shallowCopy (const std::vector< int > &index)=0
 Make a shallow copy of this MultiVector. More...
 
virtual const PMV shallowCopyConst (const std::vector< int > &index) const =0
 Make a shallow copy of this MultiVector. More...
 
virtual ptrdiff_t getLength () const =0
 Get the number of elements of a vector in the MultiVector. More...
 
virtual int getNumberOfVectors () const =0
 Get the number of vectors in the MultiVector. More...
 
virtual void gemm (const Real alpha, const MV &A, const Teuchos::SerialDenseMatrix< int, Real > &B, const Real beta)=0
 Generic BLAS level 3 matrix multiplication \(\text{this}\leftarrow \alpha A B+\beta\text{*this}\)
More...
 
virtual void axpy (const Real alpha, const MV &x)=0
 Perform the axpy operation columnwise on the MultiVector \( y_i\leftarrow y_i+\alpha x_i\) where \(y\) is this MultiVector. More...
 
virtual void scale (const Real alpha)=0
 Scale the MultiVector by a single scalar alpha \(\text{this}\leftarrow\alpha\text{this}\). More...
 
virtual void scale (const std::vector< Real > &alpha)=0
 Scale each vector in the MultiVector by a different alpha \(\text{this}[i]\leftarrow\alpha[i]\text{*this}[i]\). More...
 
virtual void set (const MV &A)=0
 Set the MultiVector equal to another MultiVector. More...
 
virtual void set (const MV &A, const std::vector< int > &index)=0
 Set some of the vectors in this MultiVector equal to corresponding vectors in another MultiVector. More...
 
virtual void innerProducts (const Real alpha, const MV &A, Teuchos::SerialDenseMatrix< int, Real > &B) const =0
 Compute \(\alpha A^\top \text{*this}\). More...
 
virtual void dots (const MV &A, std::vector< Real > &b) const =0
 Compute dot products of pairs of vectors. More...
 
virtual void norms (std::vector< Real > &normvec) const =0
 Compute the norm of each vector in the MultiVector. More...
 
virtual void zero ()=0
 Zero each of the vectors in the MultiVector. More...
 
virtual PV getVector (int i) const =0
 Return a pointer to the ith vector. More...
 

Private Types

typedef Vector< Real > V
 
typedef Teuchos::RCP< VPV
 
typedef Teuchos::ArrayRCP< PVAPV
 
typedef MultiVector< Real > MV
 
typedef Teuchos::RCP< MVPMV
 

Detailed Description

template<class Real>
class ROL::MultiVector< Real >

Provides a container and operations on multiple ROL vectors for use with other Trilinos packages which require multivectors.

Definition at line 63 of file ROL_MultiVector.hpp.

Member Typedef Documentation

◆ V

template<class Real>
typedef Vector<Real> ROL::MultiVector< Real >::V
private

Definition at line 65 of file ROL_MultiVector.hpp.

◆ PV

template<class Real>
typedef Teuchos::RCP<V> ROL::MultiVector< Real >::PV
private

Definition at line 66 of file ROL_MultiVector.hpp.

◆ APV

template<class Real>
typedef Teuchos::ArrayRCP<PV> ROL::MultiVector< Real >::APV
private

Definition at line 67 of file ROL_MultiVector.hpp.

◆ MV

template<class Real>
typedef MultiVector<Real> ROL::MultiVector< Real >::MV
private

Definition at line 68 of file ROL_MultiVector.hpp.

◆ PMV

template<class Real>
typedef Teuchos::RCP<MV> ROL::MultiVector< Real >::PMV
private

Definition at line 69 of file ROL_MultiVector.hpp.

Constructor & Destructor Documentation

◆ ~MultiVector()

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

Definition at line 73 of file ROL_MultiVector.hpp.

Member Function Documentation

◆ clone() [1/2]

template<class Real>
virtual PMV ROL::MultiVector< Real >::clone ( ) const
pure virtual

Make a new MultiVector of the same dimensions.

Returns
A reference-counted pointer to the cloned MultiVector

Implemented in ROL::MultiVectorDefault< Real >.

◆ clone() [2/2]

template<class Real>
virtual PMV ROL::MultiVector< Real >::clone ( const int  numvecs) const
pure virtual

Make a new MultiVector of specified "width".

Returns
A reference-counted pointer to the cloned MultiVector

Implemented in ROL::MultiVectorDefault< Real >.

◆ deepCopy() [1/2]

template<class Real>
virtual PMV ROL::MultiVector< Real >::deepCopy ( ) const
pure virtual

Make a deep copy of this MultiVector.

Returns
A reference-counted pointer to a new MultiVector containing deep copied values

Implemented in ROL::MultiVectorDefault< Real >.

◆ deepCopy() [2/2]

template<class Real>
virtual PMV ROL::MultiVector< Real >::deepCopy ( const std::vector< int > &  index) const
pure virtual

Make a deep copy of this MultiVector.

Parameters
[in]Arrayof indices of the vectors to copy
Returns
A reference-counted pointer to a new MultiVector containing deep copied values

Implemented in ROL::MultiVectorDefault< Real >.

◆ shallowCopy()

template<class Real>
virtual PMV ROL::MultiVector< Real >::shallowCopy ( const std::vector< int > &  index)
pure virtual

Make a shallow copy of this MultiVector.

Parameters
[in]Arrayof indices of the vectors to copy
Returns
A reference-counted pointer to a new MultiVector where the elements point to the data in *this

Implemented in ROL::MultiVectorDefault< Real >.

◆ shallowCopyConst()

template<class Real>
virtual const PMV ROL::MultiVector< Real >::shallowCopyConst ( const std::vector< int > &  index) const
pure virtual

Make a shallow copy of this MultiVector.

Parameters
[in]Arrayof indices of the vectors to copy
Returns
A reference-counted pointer to a new MultiVector where the elements point to the data in *this

Implemented in ROL::MultiVectorDefault< Real >.

◆ getLength()

template<class Real>
virtual ptrdiff_t ROL::MultiVector< Real >::getLength ( ) const
pure virtual

Get the number of elements of a vector in the MultiVector.

Returns
Number of elements in a vector

Implemented in ROL::MultiVectorDefault< Real >.

Referenced by ROL::MultiVectorDefault< Real >::dimensionMismatch().

◆ getNumberOfVectors()

template<class Real>
virtual int ROL::MultiVector< Real >::getNumberOfVectors ( ) const
pure virtual

Get the number of vectors in the MultiVector.

Returns
Number of vectors in the MultiVector

Implemented in ROL::MultiVectorDefault< Real >.

Referenced by ROL::MultiVectorDefault< Real >::dimensionMismatch(), ROL::MultiVectorDefault< Real >::innerProducts(), and norm_sum().

◆ gemm()

template<class Real>
virtual void ROL::MultiVector< Real >::gemm ( const Real  alpha,
const MV A,
const Teuchos::SerialDenseMatrix< int, Real > &  B,
const Real  beta 
)
pure virtual

Generic BLAS level 3 matrix multiplication \(\text{this}\leftarrow \alpha A B+\beta\text{*this}\)

Parameters
[in]alphais a multiplicative factor of A
[in]

Implemented in ROL::MultiVectorDefault< Real >.

◆ axpy()

template<class Real>
virtual void ROL::MultiVector< Real >::axpy ( const Real  alpha,
const MV x 
)
pure virtual

Perform the axpy operation columnwise on the MultiVector \( y_i\leftarrow y_i+\alpha x_i\) where \(y\) is this MultiVector.

Parameters
[in]alphais the scaling factor
[in]mvis the

Implemented in ROL::MultiVectorDefault< Real >.

◆ scale() [1/2]

template<class Real>
virtual void ROL::MultiVector< Real >::scale ( const Real  alpha)
pure virtual

Scale the MultiVector by a single scalar alpha \(\text{this}\leftarrow\alpha\text{this}\).

Parameters
[in]alphais a scalar multiplicative factor

Implemented in ROL::MultiVectorDefault< Real >.

◆ scale() [2/2]

template<class Real>
virtual void ROL::MultiVector< Real >::scale ( const std::vector< Real > &  alpha)
pure virtual

Scale each vector in the MultiVector by a different alpha \(\text{this}[i]\leftarrow\alpha[i]\text{*this}[i]\).

Parameters
[in]alphais a vector of multiplicative factors

Implemented in ROL::MultiVectorDefault< Real >.

◆ set() [1/2]

template<class Real>
virtual void ROL::MultiVector< Real >::set ( const MV A)
pure virtual

Set the MultiVector equal to another MultiVector.

Parameters
[in]

Implemented in ROL::MultiVectorDefault< Real >.

◆ set() [2/2]

template<class Real>
virtual void ROL::MultiVector< Real >::set ( const MV A,
const std::vector< int > &  index 
)
pure virtual

Set some of the vectors in this MultiVector equal to corresponding vectors in another MultiVector.

Parameters
[in]

Implemented in ROL::MultiVectorDefault< Real >.

◆ innerProducts()

template<class Real>
virtual void ROL::MultiVector< Real >::innerProducts ( const Real  alpha,
const MV A,
Teuchos::SerialDenseMatrix< int, Real > &  B 
) const
pure virtual

Compute \(\alpha A^\top \text{*this}\).

Parameters
[in]alphais a multiplicative factor
[in]

Implemented in ROL::MultiVectorDefault< Real >.

◆ dots()

template<class Real>
virtual void ROL::MultiVector< Real >::dots ( const MV A,
std::vector< Real > &  b 
) const
pure virtual

Compute dot products of pairs of vectors.

Parameters
[in]

Implemented in ROL::MultiVectorDefault< Real >.

◆ norms()

template<class Real>
virtual void ROL::MultiVector< Real >::norms ( std::vector< Real > &  normvec) const
pure virtual

Compute the norm of each vector in the MultiVector.

Parameters
[out]&bb is a vector containing the norms of the vectors contained in this MultiVector

Implemented in ROL::MultiVectorDefault< Real >.

Referenced by norm_sum().

◆ zero()

template<class Real>
virtual void ROL::MultiVector< Real >::zero ( )
pure virtual

Zero each of the vectors in the MultiVector.

Implemented in ROL::MultiVectorDefault< Real >.

◆ getVector()

template<class Real>
virtual PV ROL::MultiVector< Real >::getVector ( int  i) const
pure virtual

Return a pointer to the ith vector.

Parameters
[in]iis the index of the desired vector
Returns
A reference-counted pointer to the desired vector

Implemented in ROL::MultiVectorDefault< Real >.

Referenced by ROL::MultiVectorDefault< Real >::axpy(), ROL::MultiVectorDefault< Real >::dots(), ROL::MultiVectorDefault< Real >::gemm(), and ROL::MultiVectorDefault< Real >::innerProducts().


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