getSizetoRead

C++ Function Reference

1 Signature

std::vector< hsize_t > BigDataStatMeth::getSizetoRead(bool transp, int count, int rows, int cols)

2 Description

Calculates dimensions for reading matrix blocks.

3 Parameters

  • transp (bool): Whether to transpose dimensions
  • count (int): Number of elements to read
  • rows (int): Total rows in matrix
  • cols (int): Total columns in matrix

4 Returns

std::vector Dimensions for reading

5 Details

transpWhether to transpose dimensions countNumber of elements to read rowsTotal rows in matrix colsTotal columns in matrix std::vector Dimensions for reading Dimension calculation:Handles transposed matricesRespects matrix boundariesOptimizes for memory usageReturns [rows_to_read, cols_to_read]

6 Caller Graph

Function dependencies

7 Source Code

File: inst/include/Utilities/Utilities.hppLines 505-520

inline std::vector<hsize_t> getSizetoRead(bool transp, int count, int rows, int cols)
    {
        std::vector<hsize_t> vcount = {0, 0};

        if(transp == true)
        {
            vcount[0] = cols;
            vcount[1] = count;
            
        } else {
            vcount[0] = count;
            vcount[1] = cols;
        }
        
        return(vcount);
    }

8 Usage Example

#include "BigDataStatMeth.hpp"

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