Skip to content

Fix problem when parsing lists of doubles from input file

Eskil Vik requested to merge bugfix/fix-cpp-double-parsing into master

There was a bug in reading lists of doubles (e.g. Yokoya factors, added frequencies) from the input files with the C++ executables. It is unknown what caused the bug, but result was that only the first double would be read, and all the rest would be set to 0.

This MR fixes this issue by changing the input functions to use std::istringstreams instead of strtod, which does not seem to cause the same problems. In addition, some basic error handling was added, which prints warnings (or in the case of Yokoya factors: throws an exception) when the function did not reach the end of line when parsing.

Merge request reports