Giter Site home page Giter Site logo

highfive's Introduction

HighFive - HDF5 header-only C++ Library

Build Status

Coverity Statys

Brief

HighFive is a modern C++/C++11 friendly interface for libhdf5.

HighFive supports STL vector/string, Boost::UBLAS and Boost::Multi-array. It handles C++ from/to HDF5 automatic type mapping. HighFive does not require an additional library and supports both HDF5 thread safety and Parallel HDF5 (contrary to the official hdf5 cpp)

Design

  • Simple C++-ish minimalist interface
  • No other dependency than libhdf5
  • Zero overhead
  • Support C++11 ( compatible with C++98 )

Dependencies

  • libhdf5
  • (optional) boost >= 1.41

Usage

Write a std::vector to 1D HDF5 dataset and read it back

using namespace HighFive;
// we create a new hdf5 file
File file("/tmp/new_file.h5", File::ReadWrite | File::Create | File::Truncate);

std::vector<int> data(50, 1);

// lets create a dataset of native interger with the size of the vector 'data'
DataSet dataset = file.createDataSet<int>("/dataset_one",  DataSpace::From(data));

// lets write our vector of int to the HDF5 dataset
dataset.write(data);

// read back
std::vector<int> result;
dataset.read(result);

Write a 2 dimensional C double float array to a 2D HDF5 dataset

See create_dataset_double.cpp

Write and read a matrix of double float (boost::ublas) to a 2D HDF5 dataset

See boost_ublas_double.cpp

Write and read a subset of a 2D double dataset

See select_partial_dataset_cpp11.cpp

Create, write and list HDF5 attributes

See create_attribute_string_integer.cpp

And others

See src/examples/ sub-directory for more infos

Compile with HighFive

c++ -o program -I/path/to/highfive/include source.cpp  -lhdf5

Test Compilation

Remember: Compilation is not required. Used only for unit test and examples

mkdir build; pushd build   
cmake ../   
make   
make test   

Feature support

  • create/read/write file, dataset, group, dataspace.
  • automatic memory management / ref counting
  • automatic convertion of std::vector and nested std::vector from/to any dataset with basic types
  • automatic convertion of std::string to/from variable length string dataset
  • selection() / slice support
  • parallel Read/Write operations from several nodes with Parallel HDF5
  • support HDF5 attributes

Contributors

License

Boost Software License 1.0

highfive's People

Contributors

adevress avatar tristan0x avatar acdemiralp avatar ferdonline avatar tribal-tec avatar ptoharia avatar

Watchers

James Cloos avatar Wolf Vollprecht avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.