|
GEOS
|
Abstract view of a block vector. More...
#include <BlockVectorView.hpp>

Public Types | |
| using | Vector = VECTOR |
| Alias for sub-vector type. | |
Public Member Functions | |
Constructors | |
| BlockVectorView & | operator= (BlockVectorView const &rhs)=delete |
| Deleted copy assignment. More... | |
| BlockVectorView & | operator= (BlockVectorView &&rhs) noexcept=delete |
| Deleted move assignment. More... | |
| virtual | ~BlockVectorView ()=default |
| Destructor. | |
Setters | |
| void | copy (BlockVectorView const &src) |
Update vector y as y = x. More... | |
Linear Algebra Operations | |
| 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... | |
Accessors | |
| 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... | |
Protected Member Functions | |
| 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... | |
Constructor/assignment Methods | |
| |
| BlockVectorView (localIndex const nBlocks) | |
Create a vector of nBlocks blocks. More... | |
| BlockVectorView (BlockVectorView const &)=default | |
| Copy constructor. | |
| BlockVectorView (BlockVectorView &&)=default | |
| Move constructor. | |
Abstract view of a block vector.
| VECTOR | type of sub-vectors |
This class does not deal with constructing or storing sub-vectors, only provides high-level access functions. See derived classes BlockVector and BlockVectorWrapper for ways to construct a block vector.
Definition at line 37 of file BlockVectorView.hpp.
|
inlineexplicitprotected |
Create a vector of nBlocks blocks.
| nBlocks | number of blocks |
Definition at line 220 of file BlockVectorView.hpp.
| void geos::BlockVectorView< VECTOR >::axpby | ( | real64 const | alpha, |
| BlockVectorView< VECTOR > const & | x, | ||
| real64 const | beta | ||
| ) |
Update vector y as y = alpha*x + beta*y.
| alpha | scaling factor for added vector |
| x | vector to add |
| beta | scaling factor for self vector |
Definition at line 345 of file BlockVectorView.hpp.
| void geos::BlockVectorView< VECTOR >::axpy | ( | real64 const | alpha, |
| BlockVectorView< VECTOR > const & | x | ||
| ) |
Update vector y as y = alpha*x + y.
| alpha | scaling factor for added vector |
| x | vector to add |
Definition at line 334 of file BlockVectorView.hpp.
|
inline |
Get a reference to the vector corresponding to block blockRowIndex.
| blockIndex | index of the block to return |
Definition at line 182 of file BlockVectorView.hpp.
|
inline |
Get a reference to the vector corresponding to block blockRowIndex.
| blockIndex | index of the block to return |
Definition at line 173 of file BlockVectorView.hpp.
| localIndex geos::BlockVectorView< VECTOR >::blockSize |
| void geos::BlockVectorView< VECTOR >::copy | ( | BlockVectorView< VECTOR > const & | src | ) |
Update vector y as y = x.
| src | the vector to copy |
Definition at line 262 of file BlockVectorView.hpp.
| real64 geos::BlockVectorView< VECTOR >::dot | ( | BlockVectorView< VECTOR > const & | x | ) | const |
Dot product.
| x | the block vector to compute product with |
Definition at line 299 of file BlockVectorView.hpp.
| globalIndex geos::BlockVectorView< VECTOR >::globalSize |
| localIndex geos::BlockVectorView< VECTOR >::localSize |
| real64 geos::BlockVectorView< VECTOR >::norm2 |
2-norm of the block vector.
Definition at line 311 of file BlockVectorView.hpp.
| real64 geos::BlockVectorView< VECTOR >::normInf |
Inf-norm of the block vector.
Definition at line 323 of file BlockVectorView.hpp.
|
inline |
Get a reference to the vector corresponding to block blockRowIndex.
| blockIndex | index of the block to return |
Definition at line 199 of file BlockVectorView.hpp.
|
inline |
Get a reference to the vector corresponding to block blockRowIndex.
| blockIndex | index of the block to return |
Definition at line 191 of file BlockVectorView.hpp.
|
deletenoexcept |
Deleted move assignment.
| rhs | the block vector to move from |
this object
|
delete |
Deleted copy assignment.
| rhs | the block vector to copy |
this object | void geos::BlockVectorView< VECTOR >::print | ( | std::ostream & | os = std::cout | ) | const |
Print the block vector.
| os | the stream to print to |
Definition at line 385 of file BlockVectorView.hpp.
| void geos::BlockVectorView< VECTOR >::rand | ( | unsigned const | seed | ) |
Set vector elements to random entries.
| seed | the random seed to use |
Definition at line 290 of file BlockVectorView.hpp.
|
inlineprotected |
Resize to a new number of blocks.
| size | the new size |
Definition at line 240 of file BlockVectorView.hpp.
| void geos::BlockVectorView< VECTOR >::scale | ( | real64 const | factor | ) |
Scale the block vector with factor.
| factor | multiplication factor |
Definition at line 272 of file BlockVectorView.hpp.
|
inlineprotected |
Set pointer to a vector.
| i | index of vector |
| vec | new pointer to vector |
Definition at line 250 of file BlockVectorView.hpp.