Skip to content

.mat store ints as doubles  #327

Description

@willGraham01

.mat files save values as doubles by default, and thus the .mat inputs that we provide to TDMS have values stored as double when we are expecting to read them into std::vector<int> for example.

This causes segmentation faults when we attempt to read in data that we expect to be integer-valued, using the HDF5 C++ API.

There are several variables that we attempt to read in as ints. Creating a list of known places here which will be added to as more are found.
Known variables that are affected:

  • campssample -> components (saved as double but contains int values). Appears in VertexPhasors.
  • fieldsample -> i,j,k (saved as double but contains int values). Appears in FieldSample.

We can circumnavigate this by introducing intermediary buffers in our read methods, but this is not ideal.

  • For the purposes of removing the MATLAB header dependency (Remove MATLAB dependency #70) this is an acceptable workaround.
  • However in the future we should look to be stricter in how the input files (via iteratefdtd_matrix and others) are written.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghousekeepingCode cleanupinvestigationA study or investigation of something.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions