ergo
|
Describes dimensions of matrix and its blocks on all levels. More...
#include <SizesAndBlocks.h>
Public Member Functions | |
SizesAndBlocks () | |
Default constructor. More... | |
SizesAndBlocks (SizesAndBlocks const &other) | |
Copy constructor. More... | |
SizesAndBlocks (std::vector< int > const &blockSizesInp, int const nScalarsInp) | |
Constructor used for explicit calls. More... | |
SizesAndBlocks & | operator= (SizesAndBlocks const &other) |
Assignment operator. More... | |
bool | operator== (SizesAndBlocks const &other) const |
SizesAndBlocks | getSizesAndBlocksForLowerLevel (int const blockNumber) const |
bool | is_empty () const |
int const & | getNBlocks () const |
int const & | getNScalars () const |
void | getBlockSizeVector (std::vector< int > &blockSizesCopy) const |
int | whichBlock (int const globalIndex) const |
Returns the blocknumber (between 0 and nBlocks-1) that contains elements with the given global index. More... | |
int | getOffset () const |
int | getNTotalScalars () const |
~SizesAndBlocks () | |
Protected Member Functions | |
SizesAndBlocks (std::vector< int > const &blockSizesInp, int const nScalarsInp, int const offsetInp, int const nTotalScalarsInp) | |
void | setup (std::vector< int > const &blockSizesInp) |
Protected Attributes | |
std::vector< int > | blockSizes |
This is the number of scalars in each block, (not the number of blocks in each block) for each level starting with the highest level. More... | |
int | nBlocks |
This is the number of blocks in the current block. More... | |
int | nScalars |
Number of scalars in the current block. More... | |
int | offset |
Offset in entire system. More... | |
int | nTotalScalars |
Total number of scalars in entire system. More... | |
Describes dimensions of matrix and its blocks on all levels.
The key ability is to provide the count and size of blocks, and their offset in the entire matrix. It can generate a corresponding object for lower-level blocks.
|
inline |
Default constructor.
Referenced by getSizesAndBlocksForLowerLevel().
mat::SizesAndBlocks::SizesAndBlocks | ( | SizesAndBlocks const & | other | ) |
Copy constructor.
|
inline |
Constructor used for explicit calls.
For sizes and blocks at the highest level. nScalarsInp is the number of total scalar rows/columns in this case.
References setup().
|
inline |
|
inlineprotected |
References setup().
void mat::SizesAndBlocks::getBlockSizeVector | ( | std::vector< int > & | blockSizesCopy | ) | const |
References blockSizes.
Referenced by GetDensFromFock::create_checkpoint(), and mat::MatrixSymmetric< Treal, Tmatrix >::getSizesAndBlocksForFrobNormMat().
|
inline |
References nBlocks.
Referenced by mat::Matrix< Treal, Telement >::addValues(), mat::Vector< Treal, Telement >::allocate(), mat::Matrix< Treal, Telement >::allocate(), mat::Matrix< Treal, Telement >::assignFromSparse(), mat::Matrix< Treal, Telement >::getValues(), mat::VectorHierarchicBase< Treal >::n(), mat::MatrixHierarchicBase< Treal >::ncols(), mat::MatrixHierarchicBase< Treal >::nElements(), and mat::MatrixHierarchicBase< Treal >::nrows().
|
inline |
|
inline |
References nTotalScalars.
Referenced by mat::Vector< Treal >::addFromFull(), mat::Matrix< Treal, Telement >::assignFromFull(), mat::Matrix< Treal >::assignFromFull(), mat::Matrix< Treal, Telement >::fullMatrix(), mat::Matrix< Treal >::fullMatrix(), mat::Vector< Treal, Telement >::fullVector(), mat::Vector< Treal >::fullVector(), mat::MatrixSymmetric< Treal, Tmatrix >::getSizesAndBlocksForFrobNormMat(), mat::MatrixHierarchicBase< Treal >::highestLevel(), mat::Matrix< Treal, Telement >::syFullMatrix(), mat::Matrix< Treal >::syFullMatrix(), mat::Matrix< Treal, Telement >::syUpTriFullMatrix(), and mat::Matrix< Treal >::syUpTriFullMatrix().
|
inline |
References offset.
Referenced by mat::Vector< Treal >::addFromFull(), mat::Matrix< Treal >::assignFromFull(), mat::Matrix< Treal, Telement >::fullMatrix(), mat::Matrix< Treal >::fullMatrix(), mat::Vector< Treal, Telement >::fullVector(), mat::Vector< Treal >::fullVector(), mat::Matrix< Treal >::geAccumulateWith(), mat::Matrix< Treal >::getAllValues(), mat::Matrix< Treal >::setElementsByRule(), mat::Matrix< Treal >::syAccumulateWith(), mat::Matrix< Treal, Telement >::syFullMatrix(), mat::Matrix< Treal >::syFullMatrix(), mat::Matrix< Treal >::syGetAllValues(), mat::Matrix< Treal >::sySetElementsByRule(), mat::Matrix< Treal, Telement >::syUpTriFullMatrix(), and mat::Matrix< Treal >::syUpTriFullMatrix().
SizesAndBlocks mat::SizesAndBlocks::getSizesAndBlocksForLowerLevel | ( | int const | blockNumber | ) | const |
References blockSizes, nScalars, nTotalScalars, offset, and SizesAndBlocks().
Referenced by mat::Vector< Treal, Telement >::allocate(), and mat::Matrix< Treal, Telement >::allocate().
|
inline |
References blockSizes.
Referenced by mat::VectorHierarchicBase< Treal >::is_empty(), and mat::MatrixHierarchicBase< Treal >::is_empty().
SizesAndBlocks & mat::SizesAndBlocks::operator= | ( | SizesAndBlocks const & | other | ) |
Assignment operator.
References nBlocks.
bool mat::SizesAndBlocks::operator== | ( | SizesAndBlocks const & | other | ) | const |
References blockSizes, nBlocks, nScalars, nTotalScalars, and offset.
|
protected |
References blockSizes, nBlocks, and nScalars.
Referenced by SizesAndBlocks().
|
inline |
Returns the blocknumber (between 0 and nBlocks-1) that contains elements with the given global index.
References blockSizes, and offset.
Referenced by mat::Matrix< Treal, Telement >::addValues(), mat::Matrix< Treal >::addValues(), mat::Matrix< Treal, Telement >::assignFromSparse(), mat::Matrix< Treal >::assignFromSparse(), mat::Matrix< Treal, Telement >::getValues(), and mat::Matrix< Treal >::getValues().
|
protected |
This is the number of scalars in each block, (not the number of blocks in each block) for each level starting with the highest level.
It should be 1 at the lowest level. Example: [1000 100 10 1] Length is level() + 1
Referenced by getBlockSizeVector(), getSizesAndBlocksForLowerLevel(), is_empty(), operator==(), setup(), and whichBlock().
|
protected |
This is the number of blocks in the current block.
== nScalars at lowest level
Referenced by getNBlocks(), operator=(), operator==(), and setup().
|
protected |
Number of scalars in the current block.
Referenced by getNScalars(), getSizesAndBlocksForLowerLevel(), operator==(), and setup().
|
protected |
Total number of scalars in entire system.
Referenced by getNTotalScalars(), getSizesAndBlocksForLowerLevel(), and operator==().
|
protected |
Offset in entire system.
Referenced by getOffset(), getSizesAndBlocksForLowerLevel(), operator==(), and whichBlock().