GEOSX
|
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=1984) |
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 32 of file KrylovSolver.hpp.
|
inlineexplicitprotected |
Create a vector of nBlocks
blocks.
nBlocks | number of blocks |
Definition at line 218 of file BlockVectorView.hpp.
void geosx::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 343 of file BlockVectorView.hpp.
void geosx::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 332 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 171 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 180 of file BlockVectorView.hpp.
localIndex geosx::BlockVectorView< VECTOR >::blockSize | ( | ) | const |
void geosx::BlockVectorView< VECTOR >::copy | ( | BlockVectorView< VECTOR > const & | src | ) |
Update vector y
as y
= x
.
src | the vector to copy |
Definition at line 260 of file BlockVectorView.hpp.
real64 geosx::BlockVectorView< VECTOR >::dot | ( | BlockVectorView< VECTOR > const & | x | ) | const |
Dot product.
x | the block vector to compute product with |
Definition at line 297 of file BlockVectorView.hpp.
globalIndex geosx::BlockVectorView< VECTOR >::globalSize | ( | ) | const |
localIndex geosx::BlockVectorView< VECTOR >::localSize | ( | ) | const |
real64 geosx::BlockVectorView< VECTOR >::norm2 | ( | ) | const |
2-norm of the block vector.
Definition at line 309 of file BlockVectorView.hpp.
real64 geosx::BlockVectorView< VECTOR >::normInf | ( | ) | const |
Inf-norm of the block vector.
Definition at line 321 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 189 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 197 of file BlockVectorView.hpp.
|
delete |
Deleted copy assignment.
rhs | the block vector to copy |
this
object
|
deletenoexcept |
Deleted move assignment.
rhs | the block vector to move from |
this
object void geosx::BlockVectorView< VECTOR >::print | ( | std::ostream & | os = std::cout | ) | const |
Print the block vector.
os | the stream to print to |
Definition at line 383 of file BlockVectorView.hpp.
void geosx::BlockVectorView< VECTOR >::rand | ( | unsigned const | seed = 1984 | ) |
Set vector elements to random entries.
seed | the random seed to use |
Definition at line 288 of file BlockVectorView.hpp.
|
inlineprotected |
Resize to a new number of blocks.
size | the new size |
Definition at line 238 of file BlockVectorView.hpp.
void geosx::BlockVectorView< VECTOR >::scale | ( | real64 const | factor | ) |
Scale the block vector with factor
.
factor | multiplication factor |
Definition at line 270 of file BlockVectorView.hpp.
|
inlineprotected |
Set pointer to a vector.
i | index of vector |
vec | new pointer to vector |
Definition at line 248 of file BlockVectorView.hpp.