getBlockPositionsSizes_hdf5

C++ Function Reference

1 Signature

void BigDataStatMeth::getBlockPositionsSizes_hdf5(hsize_t maxPosition, hsize_t blockSize, std::vector< hsize_t > &starts, std::vector< hsize_t > &sizes)

2 Description

Calculate block positions and sizes for HDF5 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 on HDF5 datasets.

5 Call Graph

Function dependencies

6 Source Code

File: inst/include/hdf5Algebra/multiplication 2.hppLines 72-92

inline void getBlockPositionsSizes_hdf5( 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( ii + blockSize > maxPosition ) {
            //     isize = blockSize + 1; }
            if( sizetoRead > blockSize ) {
                ii = ii - blockSize + sizetoRead; }
        }

    }

7 Usage Example

#include "BigDataStatMeth.hpp"

// Example usage
auto result = getBlockPositionsSizes_hdf5(...);