GEOS
Public Types | Public Member Functions | List of all members
geos::BlockVectorWrapper< VECTOR > Class Template Reference

"Shallow" representation of a block vector. More...

#include <BlockVectorWrapper.hpp>

Inheritance diagram for geos::BlockVectorWrapper< VECTOR >:
Inheritance graph
[legend]

Public Types

using Base = BlockVectorView< VECTOR >
 Alias for base type.
 
- Public Types inherited from geos::BlockVectorView< VECTOR >
using Vector = VECTOR
 Alias for sub-vector type.
 

Public Member Functions

 BlockVectorWrapper (localIndex const nBlocks)
 Create a vector wrapper of nBlocks blocks. More...
 
 BlockVectorWrapper (BlockVectorWrapper< VECTOR > const &rhs)=default
 Deleted copy constructor. More...
 
 BlockVectorWrapper (BlockVectorWrapper< VECTOR > &&rhs)=default
 Deleted move constructor. More...
 
virtual ~BlockVectorWrapper () override=default
 Destructor.
 
void set (localIndex const blockIndex, VECTOR &vec)
 Assign a sub-block to point to a given vector. More...
 
- Public Member Functions inherited from geos::BlockVectorView< VECTOR >
BlockVectorViewoperator= (BlockVectorView const &rhs)=delete
 Deleted copy assignment. More...
 
BlockVectorViewoperator= (BlockVectorView &&rhs) noexcept=delete
 Deleted move assignment. More...
 
virtual ~BlockVectorView ()=default
 Destructor.
 
void copy (BlockVectorView const &src)
 Update vector y as y = x. More...
 
void scale (real64 const factor)
 Scale the block vector with factor. More...
 
void zero ()
 Set the vector to zero.
 
void rand (unsigned const seed)
 Set vector elements to random entries. More...
 
real64 dot (BlockVectorView const &x) const
 Dot product. More...
 
real64 norm2 () const
 2-norm of the block vector. More...
 
real64 normInf () const
 Inf-norm of the block vector. More...
 
void axpy (real64 const alpha, BlockVectorView const &x)
 Update vector y as y = alpha*x + y. More...
 
void axpby (real64 const alpha, BlockVectorView const &x, real64 const beta)
 Update vector y as y = alpha*x + beta*y. More...
 
localIndex blockSize () const
 Get block size. More...
 
globalIndex globalSize () const
 Get global size. More...
 
localIndex localSize () const
 Get local size. More...
 
void print (std::ostream &os=std::cout) const
 Print the block vector. More...
 
VECTOR const & block (localIndex const blockIndex) const
 Get a reference to the vector corresponding to block blockRowIndex. More...
 
VECTOR & block (localIndex const blockIndex)
 Get a reference to the vector corresponding to block blockRowIndex. More...
 
VECTOR const & operator() (localIndex const blockIndex) const
 Get a reference to the vector corresponding to block blockRowIndex. More...
 
VECTOR & operator() (localIndex const blockIndex)
 Get a reference to the vector corresponding to block blockRowIndex. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geos::BlockVectorView< VECTOR >
void resize (localIndex const size)
 Resize to a new number of blocks. More...
 
void setPointer (localIndex i, VECTOR *vec)
 Set pointer to a vector. More...
 
 BlockVectorView (localIndex const nBlocks)
 Create a vector of nBlocks blocks. More...
 
 BlockVectorView (BlockVectorView const &)=default
 Copy constructor.
 
 BlockVectorView (BlockVectorView &&)=default
 Move constructor.
 

Detailed Description

template<typename VECTOR>
class geos::BlockVectorWrapper< VECTOR >

"Shallow" representation of a block vector.

Template Parameters
VECTORtype of sub-vectors

This extends BlockVectorView class by providing a way to assign sub-block pointers. The sub-blocks themselves must be stored elsewhere. Therefore, it's an easy way to assemble a block vector representation from pre-existing blocks.

Definition at line 38 of file BlockVectorWrapper.hpp.

Constructor & Destructor Documentation

◆ BlockVectorWrapper() [1/3]

template<typename VECTOR >
geos::BlockVectorWrapper< VECTOR >::BlockVectorWrapper ( localIndex const  nBlocks)
inlineexplicit

Create a vector wrapper of nBlocks blocks.

Parameters
nBlocksnumber of blocks

Definition at line 49 of file BlockVectorWrapper.hpp.

◆ BlockVectorWrapper() [2/3]

template<typename VECTOR >
geos::BlockVectorWrapper< VECTOR >::BlockVectorWrapper ( BlockVectorWrapper< VECTOR > const &  rhs)
default

Deleted copy constructor.

Parameters
rhsthe block vector to copy

◆ BlockVectorWrapper() [3/3]

template<typename VECTOR >
geos::BlockVectorWrapper< VECTOR >::BlockVectorWrapper ( BlockVectorWrapper< VECTOR > &&  rhs)
default

Deleted move constructor.

Parameters
rhsthe block vector to move from

Member Function Documentation

◆ set()

template<typename VECTOR >
void geos::BlockVectorWrapper< VECTOR >::set ( localIndex const  blockIndex,
VECTOR &  vec 
)
inline

Assign a sub-block to point to a given vector.

Parameters
blockIndexindex of the block
vectarget vector (must not go out of scope before the wrapper object)

Definition at line 75 of file BlockVectorWrapper.hpp.


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