ergo
|
Describes dimensions of matrix and its blocks on all levels. More...
#include <SizesAndBlocks.h>
Public Member Functions | |
SizesAndBlocks () | |
Default constructor. | |
SizesAndBlocks (SizesAndBlocks const &other) | |
Copy constructor. | |
SizesAndBlocks (std::vector< int > const &blockSizesInp, int const nScalarsInp) | |
Constructor used for explicit calls. | |
SizesAndBlocks & | operator= (SizesAndBlocks const &other) |
Assignment operator. | |
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. | |
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. | |
int | nBlocks |
This is the number of blocks in the current block. | |
int | nScalars |
Number of scalars in the current block. | |
int | offset |
Offset in entire system. | |
int | nTotalScalars |
Total number of scalars in entire system. | |
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.
References nBlocks, nScalars, nTotalScalars, and offset.
Referenced by getSizesAndBlocksForLowerLevel(), operator=(), operator==(), and SizesAndBlocks().
mat::SizesAndBlocks::SizesAndBlocks | ( | SizesAndBlocks const & | other | ) |
Copy constructor.
References blockSizes, nBlocks, nScalars, nTotalScalars, offset, and SizesAndBlocks().
|
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 nBlocks, nScalars, nTotalScalars, offset, and setup().
|
inline |
|
inlineprotected |
References nBlocks, nScalars, nTotalScalars, offset, and setup().
void mat::SizesAndBlocks::getBlockSizeVector | ( | std::vector< int > & | blockSizesCopy | ) | const |
References blockSizes.
|
inline |
References nBlocks.
|
inline |
References nScalars.
|
inline |
References nTotalScalars.
|
inline |
References offset.
SizesAndBlocks mat::SizesAndBlocks::getSizesAndBlocksForLowerLevel | ( | int const | blockNumber | ) | const |
References blockSizes, nScalars, nTotalScalars, offset, and SizesAndBlocks().
|
inline |
References blockSizes.
SizesAndBlocks & mat::SizesAndBlocks::operator= | ( | SizesAndBlocks const & | other | ) |
Assignment operator.
References blockSizes, nBlocks, nScalars, nTotalScalars, offset, and SizesAndBlocks().
bool mat::SizesAndBlocks::operator== | ( | SizesAndBlocks const & | other | ) | const |
References blockSizes, nBlocks, nScalars, nTotalScalars, offset, and SizesAndBlocks().
|
protected |
References blockSizes, nBlocks, and nScalars.
Referenced by SizesAndBlocks(), and SizesAndBlocks().
|
inline |
Returns the blocknumber (between 0 and nBlocks-1) that contains elements with the given global index.
References blockSizes, and offset.
|
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=(), operator==(), setup(), SizesAndBlocks(), and whichBlock().
|
protected |
This is the number of blocks in the current block.
== nScalars at lowest level
Referenced by getNBlocks(), operator=(), operator==(), setup(), SizesAndBlocks(), SizesAndBlocks(), SizesAndBlocks(), and SizesAndBlocks().
|
protected |
Number of scalars in the current block.
Referenced by getNScalars(), getSizesAndBlocksForLowerLevel(), operator=(), operator==(), setup(), SizesAndBlocks(), SizesAndBlocks(), SizesAndBlocks(), and SizesAndBlocks().
|
protected |
Total number of scalars in entire system.
Referenced by getNTotalScalars(), getSizesAndBlocksForLowerLevel(), operator=(), operator==(), SizesAndBlocks(), SizesAndBlocks(), SizesAndBlocks(), and SizesAndBlocks().
|
protected |
Offset in entire system.
Referenced by getOffset(), getSizesAndBlocksForLowerLevel(), operator=(), operator==(), SizesAndBlocks(), SizesAndBlocks(), SizesAndBlocks(), SizesAndBlocks(), and whichBlock().