diff --git a/Solver/function.cpp b/Solver/function.cpp index 4508cdfe41642b4b3490463a30bfbe567fd11c69..7771988a278ba1e9fbd47df0ae8ae874e1bc1ab0 100644 --- a/Solver/function.cpp +++ b/Solver/function.cpp @@ -92,8 +92,8 @@ dataCacheDouble &dataCacheMap::substitute(const function *f) dataCacheMap::~dataCacheMap() { - for (std::set<dataCacheDouble*>::iterator it = _toDelete.begin(); - it!=_toDelete.end(); it++) { + for (std::set<dataCacheDouble*>::iterator it = _allDataCaches.begin(); + it!=_allDataCaches.end(); it++) { delete *it; } } @@ -309,7 +309,7 @@ class functionLua : public function { void dataCacheMap::setNbEvaluationPoints(int nbEvaluationPoints) { _nbEvaluationPoints = nbEvaluationPoints; - for(std::set<dataCacheDouble*>::iterator it = _toResize.begin(); it!= _toResize.end(); it++){ + for(std::set<dataCacheDouble*>::iterator it = _allDataCaches.begin(); it!= _allDataCaches.end(); it++){ (*it)->resize(); (*it)->_valid = false; } diff --git a/Solver/function.h b/Solver/function.h index 38a62b98114a8d6bc581b7d81618f497f280259c..53c528d33a40bac21e19e16d3818920c5df4a064 100644 --- a/Solver/function.h +++ b/Solver/function.h @@ -147,18 +147,14 @@ class dataCacheMap { std::list<dataCacheMap*> _children; int _nbEvaluationPoints; std::map<const function*, dataCacheDouble*> _cacheDoubleMap; - std::set<dataCacheDouble*> _toDelete; - std::set<dataCacheDouble*> _toResize; + std::set<dataCacheDouble*> _allDataCaches; std::set<dataCacheDouble*> _toInvalidateOnElement; MElement *_element; protected: - void addDataCache(dataCacheDouble *data){ - _toDelete.insert(data); - } void addDataCacheDouble(dataCacheDouble *data, bool invalidatedOnElement){ - _toResize.insert(data); + _allDataCaches.insert(data); if(invalidatedOnElement) _toInvalidateOnElement.insert(data); }