[kernel] Important change in initMemory of DS
The memory is only initialized if we need more steps in Memory.
This hacks is done to avoid multiple memory resetting if multiple simulations shared the same memory
In the latter case, this has to be done more carefully in the future.
*/
#include "DynamicalSystem.hpp"
+// #define DEBUG_NOCOLOR
// #define DEBUG_MESSAGES
// #define DEBUG_STDOUT
#include "debug.h"
@@ -238,7 +239,9 @@ void DynamicalSystem::update(double time)
void DynamicalSystem::initMemory(unsigned int steps)
{
-
+ DEBUG_BEGIN("void DynamicalSystem::initMemory(unsigned int steps)\n");
+ if (steps > _xMemory.size())
+ {
if (steps == 0)
std::cout << "Warning : initMemory with size equal to zero" << std::endl;
else
@@ -246,6 +249,9 @@ void DynamicalSystem::initMemory(unsigned int steps)
_stepsInMemory = steps;
_xMemory.setMemorySize(steps, _n);
}
+ }
+ DEBUG_EXPR(_xMemory.display(););
+ DEBUG_END("void DynamicalSystem::initMemory(unsigned int steps)\n");
}
