mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 08:55:37 +00:00
Hdf5File: random generator state I/O fix
This commit is contained in:
parent
abd8bfc91c
commit
4f2e87cf4f
@ -124,8 +124,8 @@ void Hdf5File::save(const RandGenState &state, const string &name)
|
|||||||
group = h5File_->createGroup(name.c_str() + nameOffset(name));
|
group = h5File_->createGroup(name.c_str() + nameOffset(name));
|
||||||
attr = group.createAttribute("type", PredType::NATIVE_SHORT, attrSpace);
|
attr = group.createAttribute("type", PredType::NATIVE_SHORT, attrSpace);
|
||||||
attr.write(PredType::NATIVE_SHORT, &rgStateType);
|
attr.write(PredType::NATIVE_SHORT, &rgStateType);
|
||||||
dataset = group.createDataSet("data", PredType::NATIVE_DOUBLE, dataSpace);
|
dataset = group.createDataSet("data", PredType::NATIVE_INT, dataSpace);
|
||||||
dataset.write(state.data(), PredType::NATIVE_DOUBLE);
|
dataset.write(state.data(), PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read first name ////////////////////////////////////////////////////////////
|
// read first name ////////////////////////////////////////////////////////////
|
||||||
@ -262,7 +262,7 @@ void Hdf5File::load(RandGenState &state, const DataSet &d)
|
|||||||
dataspace.getSimpleExtentDims(dim);
|
dataspace.getSimpleExtentDims(dim);
|
||||||
if (dim[0] != RLXG_STATE_SIZE)
|
if (dim[0] != RLXG_STATE_SIZE)
|
||||||
{
|
{
|
||||||
// error here
|
LATAN_ERROR(Io, "random generator state has a wrong length");
|
||||||
}
|
}
|
||||||
d.read(state.data(), PredType::NATIVE_INT);
|
d.read(state.data(), PredType::NATIVE_INT);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user