get_block_size
C++ Function Reference
1 Signature
hsize_t BigDataStatMeth::get_block_size(Rcpp::Nullable< int > wsize, hsize_t reference_size, hsize_t alternative_size)2 Description
Calculate optimal block size for processing.
3 Parameters
wsize(Rcpp::Nullable< int >): User-specified block size (optional)reference_size(hsize_t): Primary dimension sizealternative_size(hsize_t): Secondary dimension size
4 Returns
Optimal block size for processing
5 Details
Determines the optimal block size for processing based on matrix dimensions and memory constraints.
6 Caller Graph
7 Source Code
NoteImplementation
File: inst/include/hdf5Algebra/matrixSdMean.hpp • Lines 56-77
inline hsize_t get_block_size( Rcpp::Nullable<int> wsize, hsize_t reference_size, hsize_t alternative_size) {
hsize_t bsize = 0;
if( wsize.isNull()) {
if( reference_size > MAXELEMSINBLOCK ){
bsize = 1;
} else {
hsize_t maxsize = std::max( alternative_size, reference_size);
bsize = std::ceil( MAXELEMSINBLOCK / maxsize);
}
} else {
if(reference_size > MAXELEMSINBLOCK){
bsize = 1;
} else {
bsize = Rcpp::as<int> (wsize);
}
}
return(bsize);
}8 Usage Example
#include "BigDataStatMeth.hpp"
// Example usage
auto result = get_block_size(...);