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 process
  • blockSize (hsize_t): Size of each block
  • starts (std::vector< hsize_t > &): Vector to store starting positions of blocks
  • sizes (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

Function dependencies

6 Source Code

File: inst/include/memAlgebra/memMultiplication.hppLines 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(...);