Skip to content

Commit 0c4c8f4

Browse files
committed
resolve conversation
1 parent 8d417e3 commit 0c4c8f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Simulator/Recorders/Hdf5Recorder.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ class Hdf5Recorder : public Recorder {
132132
hdf5Datatype_ = PredType::NATIVE_INT;
133133
} else if (dataType_ == typeid(int).name()) {
134134
hdf5Datatype_ = PredType::NATIVE_INT;
135-
} else if (dataType_ == typeid(BGFLOAT).name()) {
135+
} else if (dataType_ == typeid(float).name()) {
136136
hdf5Datatype_ = PredType::NATIVE_FLOAT;
137+
} else if (dataType_ == typeid(double).name()) {
138+
hdf5Datatype_ = PredType::NATIVE_DOUBLE;
137139
} else {
138140
throw runtime_error("Unsupported data type");
139141
}
@@ -146,9 +148,9 @@ class Hdf5Recorder : public Recorder {
146148
if (variableLocation_.getNumElements() > 0) {
147149
// Prepare the data buffer based on the HDF5 data type
148150
if (hdf5Datatype_ == PredType::NATIVE_FLOAT) {
149-
vector<BGFLOAT> dataBuffer(variableLocation_.getNumElements());
151+
vector<float> dataBuffer(variableLocation_.getNumElements());
150152
for (int i = 0; i < variableLocation_.getNumElements(); ++i) {
151-
dataBuffer[i] = get<BGFLOAT>(variableLocation_.getElement(i));
153+
dataBuffer[i] = get<float>(variableLocation_.getElement(i));
152154
}
153155
// Write the data to the dataset
154156
hdf5DataSet_.write(dataBuffer.data(), hdf5Datatype_);

0 commit comments

Comments
 (0)