Skip to content
Snippets Groups Projects
Commit 6e63582c authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

function : correct replace mechanism

parent b51a8acf
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,8 @@ dataCacheDouble &dataCacheMap::get(const function *f, dataCacheDouble *caller) { ...@@ -98,7 +98,8 @@ dataCacheDouble &dataCacheMap::get(const function *f, dataCacheDouble *caller) {
if (it != cParent->_cacheDoubleMap.end()) { if (it != cParent->_cacheDoubleMap.end()) {
r = it->second; r = it->second;
for (std::set<dataCacheDouble*>::iterator dep = r->_iDependOn.begin(); dep != r->_iDependOn.end(); dep++) { for (std::set<dataCacheDouble*>::iterator dep = r->_iDependOn.begin(); dep != r->_iDependOn.end(); dep++) {
if (&(*dep)->_cacheMap == this) { //if (_cacheDoubleMap.find((*dep)->_function) != _cacheDoubleMap.end()) {
if (&get((*dep)->_function) != *dep) {
r = NULL; r = NULL;
break; break;
} }
...@@ -499,9 +500,11 @@ void functionReplace::get(fullMatrix<double> &v, const function *f, int iMap) { ...@@ -499,9 +500,11 @@ void functionReplace::get(fullMatrix<double> &v, const function *f, int iMap) {
} }
void functionReplace::compute(){ void functionReplace::compute(){
for (int i = 0; i < _toReplace.size(); i++) for (int i = 0; i < _toReplace.size(); i++){
currentCache->toReplace[i]->set(); currentCache->toReplace[i]->set();
}
for (int i = 0; i < _toCompute.size(); i++) { for (int i = 0; i < _toCompute.size(); i++) {
currentCache->toCompute[i]->_valid =false;
_toCompute[i].val->setAsProxy((*currentCache->toCompute[i])()); _toCompute[i].val->setAsProxy((*currentCache->toCompute[i])());
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment