Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science


HDF5 Compound Type Datasets and ILNumerics.Array of struct (C#) - using low level HDF.PInvoke API

This example demonstrates the creation of a custom C# struct and how to store it into a HDF5 file, using ILNumerics and HDF.PInvoke. The struct serves as element type T in regular Array instances. However, since in version 5.5 ILNumerics.IO.HDF5 does not yet support compound data types _directly_ we must use the low level API (HDF5.PInvoke) in order to create the datatypes and the dataset in the HF5 file. Also, we must manually write and read the data from/into ILNumerics.Array of appropriate sizes.

This example uses ILNumerics.Core, ILNumerics.Computing, ILNumerics.IO.HDF5, HDF5.PInvoke assemblies. They are found in the ILNumerics installation folder ([install folder]/Distribution Files/.NET Assemblies/

Read the Getting Started Guide on ILNumerics with .NET Core projects:Link.

Last modified: November 02 2020 16:23

Download ZIP


All Examples