hdf5DatasetInternal

C++ Class Reference

1 Overview

Constructor with file, group, and dataset name.

2 Detailed Description

fileHDF5 file pointer groupGroup path datasetnameDataset name overwriteWhether to overwrite existing dataset

3 Class Hierarchy

Class diagram

4 Inheritance

Inherits from:

  • BigDataStatMeth::hdf5Dataset

5 Public Interface

5.1 Methods

5.1.1 hdf5DatasetInternal()

BigDataStatMeth::hdf5DatasetInternal::hdf5DatasetInternal(std::string filename, std::string group, std::string datasetname, bool overwrite)

Constructor with filename, group, and dataset name.

Parameters:

  • filename (std::string): Name of HDF5 file
  • group (std::string): Group path
  • datasetname (std::string): Dataset name
  • overwrite (bool): Whether to overwrite existing dataset

filenameName of HDF5 file groupGroup path datasetnameDataset name overwriteWhether to overwrite existing dataset


5.1.2 createDataset()

virtual void BigDataStatMeth::hdf5Dataset::createDataset(BigDataStatMeth::hdf5Dataset *dsLike, std::string strdatatype, int compression_level=6)

Create a dataset based on another dataset’s dimensions with optional compression.

Parameters:

  • dsLike (BigDataStatMeth::hdf5Dataset *): Reference dataset to copy dimensions from
  • strdatatype (std::string): Data type for the new dataset (“int”, “numeric”, “real”, “string”)
  • compression_level (int): Compression level (0=none, 1-9=gzip level, 6=balanced default) 0 = No compression 1-3 = Light compression (fast) 4-6 = Balanced compression (recommended) 7-9 = Maximum compression (slower)

Creates a new dataset with the same dimensions as the reference dataset but with a specified data type and compression settings. This is useful for creating derived datasets or transformations while maintaining dimensional consistency.


5.1.3 createUnlimitedDataset()

void BigDataStatMeth::hdf5DatasetInternal::createUnlimitedDataset(size_t rows, size_t cols, std::string strdatatype, int compression_level=6)

Create an unlimited internal dataset with optional compression.

Parameters:

  • rows (size_t): Initial number of rows
  • cols (size_t): Initial number of columns
  • strdatatype (std::string): Data type for the dataset
  • compression_level (int): Compression level (0=none, 1-9=gzip level, 6=balanced default)

Creates a new internal HDF5 dataset with unlimited dimensions. The dataset is marked as internal and unlimited and can grow in size.


5.1.4 extendUnlimitedDataset()

void BigDataStatMeth::hdf5DatasetInternal::extendUnlimitedDataset(const size_t rows, const size_t cols)

Extend an unlimited internal dataset.

Parameters:

  • rows (const size_t): New number of rows
  • cols (const size_t): New number of columns

Increases the dimensions of an unlimited internal dataset. Only works with datasets created as unlimited.


5.1.5 writeDataset()

void BigDataStatMeth::hdf5DatasetInternal::writeDataset(Rcpp::RObject DatasetValues)

Write data to the internal dataset.

Parameters:

  • DatasetValues (Rcpp::RObject): R object containing the data to write

Writes data to the internal dataset, handling different data types and formats. Optimized for internal storage patterns.


5.1.6 writeDatasetBlock()

void BigDataStatMeth::hdf5DatasetInternal::writeDatasetBlock(std::vector< double > DatasetValues, std::vector< hsize_t > vOffset, std::vector< hsize_t > vCount, std::vector< hsize_t > vStride, std::vector< hsize_t > vBlock)

Write block of vector data to internal dataset.

Parameters:

  • DatasetValues (std::vector< double >): Vector data to write
  • vOffset (std::vector< hsize_t >): Starting position
  • vCount (std::vector< hsize_t >): Number of elements
  • vStride (std::vector< hsize_t >): Stride between elements
  • vBlock (std::vector< hsize_t >): Block size

Writes a block of vector data to the internal dataset. Optimized for vector operations.


5.1.7 readDatasetBlock()

double * BigDataStatMeth::hdf5DatasetInternal::readDatasetBlock(std::vector< hsize_t > ivoffset, std::vector< hsize_t > ivcount, std::vector< hsize_t > ivstride, std::vector< hsize_t > ivblock, double *rdatablock)

Read a block of data from internal dataset.

Parameters:

  • ivoffset (std::vector< hsize_t >): Starting position for read
  • ivcount (std::vector< hsize_t >): Number of elements to read
  • ivstride (std::vector< hsize_t >): Stride between elements
  • ivblock (std::vector< hsize_t >): Size of blocks
  • rdatablock (double *): Pointer to read data (double*)

Returns: Pointer to read data (double*)

Reads a specified block of data from the internal dataset. Optimized for internal data access patterns.


5.1.8 getDatasetptr()

H5::DataSet * BigDataStatMeth::hdf5DatasetInternal::getDatasetptr()

5.1.9 getDatasetName()

std::string BigDataStatMeth::hdf5DatasetInternal::getDatasetName()

Get dataset name.

Returns: Name of the internal dataset

Name of the internal dataset


5.1.10 getGroup()

std::string BigDataStatMeth::hdf5DatasetInternal::getGroup()

Get group name.

Returns: Name of the group containing the internal dataset

Name of the group containing the internal dataset


5.1.11 getFileName()

std::string BigDataStatMeth::hdf5DatasetInternal::getFileName()

Get file name.

Returns: Name of the file containing the internal dataset

Name of the file containing the internal dataset


5.1.12 nrows()

hsize_t BigDataStatMeth::hdf5DatasetInternal::nrows()

5.1.13 ncols()

hsize_t BigDataStatMeth::hdf5DatasetInternal::ncols()

5.1.14 dim()

hsize_t * BigDataStatMeth::hdf5DatasetInternal::dim()

5.1.15 isUnlimited()

bool BigDataStatMeth::hdf5DatasetInternal::isUnlimited()

5.1.16 ~hdf5DatasetInternal()

BigDataStatMeth::hdf5DatasetInternal::~hdf5DatasetInternal()

Destructor.

Closes the internal dataset and releases resources


6 Private Implementation

Note

Internal implementation details for advanced users and contributors.

6.1 Methods

6.1.1 close_dataset()

void BigDataStatMeth::hdf5DatasetInternal::close_dataset()

Close the dataset.

Closes the internal dataset and releases associated resources


6.1.2 close_dataset_file()

void BigDataStatMeth::hdf5DatasetInternal::close_dataset_file()

Close dataset and file.

Closes both the internal dataset and its associated file


6.1.3 convert_DataFrame_to_RangeList()

names * BigDataStatMeth::hdf5DatasetInternal::convert_DataFrame_to_RangeList(Rcpp::RObject DatasetValues, bool bFullDataset)

Convert DataFrame to range list.

Parameters:

  • DatasetValues (Rcpp::RObject): R DataFrame to convert
  • bFullDataset (bool): Whether to convert entire dataset

Returns: Array of name structures

Converts R DataFrame to HDF5-compatible range list format for internal storage.


6.1.4 getDimensExistingDataset()

void BigDataStatMeth::hdf5DatasetInternal::getDimensExistingDataset()

Get dimensions of existing dataset.

Retrieves and stores the dimensions of an existing internal dataset


7 Usage Example

#include "hdf5DatasetInternal.hpp"

// Example usage
hdf5DatasetInternal obj;
// Your code here