getBlockPositionsSizes_mat
C++ Function Reference
1 Signature
void BigDataStatMeth::getBlockPositionsSizes_mat(hsize_t maxPosition, hsize_t blockSize, std::vector< hsize_t > &starts, std::vector< hsize_t > &sizes)2 Description
Calculate block positions and sizes for matrix operations.
3 Parameters
maxPosition(hsize_t): Maximum position to processblockSize(hsize_t): Size of each blockstarts(std::vector< hsize_t > &): Vector to store starting positions of blockssizes(std::vector< hsize_t > &): Vector to store sizes of blocks
4 Details
Determines optimal block positions and sizes for block-based matrix operations, ensuring efficient memory usage and processing.
5 Call Graph
6 Source Code
NoteImplementation
File: inst/include/memAlgebra/memMultiplication.hpp • Lines 85-103
inline void getBlockPositionsSizes_mat( hsize_t maxPosition, hsize_t blockSize, std::vector<hsize_t>& starts, std::vector<hsize_t>& sizes ){
hsize_t isize = blockSize + 1;
for (hsize_t ii = 0; ii < maxPosition; ii += blockSize)
{
if( ii + blockSize > maxPosition ) {
isize = maxPosition - ii; }
hsize_t sizetoRead = getOptimBlockSize( maxPosition, blockSize, ii, isize);
starts.push_back(ii);
sizes.push_back(sizetoRead);
if( sizetoRead > blockSize ) {
ii = ii - blockSize + sizetoRead; }
}
}7 Usage Example
#include "BigDataStatMeth.hpp"
// Example usage
auto result = getBlockPositionsSizes_mat(...);