As a first step to fix the memory corruption issues reported in bug report https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 , the data arrays were replaced by std::vector. Many (but not all) data accesses are done via at(), avoiding that indexing issues go undetected in the future.
As a second step, if possible, the code block should be reworked to use integer arithmetic (and avoid floating point arithmetic) as much as possible to avoid the rounding issues reported in https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 .
Moreover, since the computation of the parameters done in function Wake::init uses several parameters from an instance of class Time, it might be useful to pass a const pointer to that instance to Collective::initWake instead of these parameters...
As a first step to fix the memory corruption issues reported in bug report https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 , the data arrays were replaced by std::vector. Many (but not all) data accesses are done via
at()
, avoiding that indexing issues go undetected in the future.As a second step, if possible, the code block should be reworked to use integer arithmetic (and avoid floating point arithmetic) as much as possible to avoid the rounding issues reported in https://github.com/svenreiche/Genesis-1.3-Version4/issues/144 . Moreover, since the computation of the parameters done in function
Wake::init
uses several parameters from an instance of classTime
, it might be useful to pass a const pointer to that instance toCollective::initWake
instead of these parameters...