diff --git a/Solver/function.cpp b/Solver/function.cpp index 154f188e1506c4915a0f2584f6b8e2c2ae8178e4..a493fa0a91dec20d2c866229dc605e7c207915c5 100644 --- a/Solver/function.cpp +++ b/Solver/function.cpp @@ -68,15 +68,13 @@ dataCacheDouble::dataCacheDouble(dataCacheMap *m, function *f): for (int i = 0; i < f->_functionReplaces.size(); i++) { functionReplaceCaches.push_back (new functionReplaceCache(m, f->_functionReplaces[i], this)); } + f->registerInDataCacheMap(m, this); } void dataCacheDouble::resize() { _value = fullMatrix<double>(_nRowByPoint==0?1:_nRowByPoint*_cacheMap.getNbEvaluationPoints(),_value.size2()); } void dataCacheDouble::_eval() { - /*for(unsigned int i=0;i<_substitutions.size(); i++){ - _substitutions[i].first->set() = (*_substitutions[i].second)(); - }*/ for(unsigned int i=0;i<_dependencies.size(); i++){ _function->arguments[i].val->setAsProxy((*_dependencies[i])()); } @@ -378,7 +376,8 @@ class functionC : public function { "\tg++ -shared -fPIC -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<\n", filename.c_str(), "_tmpSrc.cpp"); fclose(tmpMake); - system("make -f _tmpMake"); + if(system("make -f _tmpMake")) + Msg::Error("make command failed\n"); unlink ("_tmpSrc.cpp"); unlink ("_tmpMake.cpp"); } diff --git a/Solver/function.h b/Solver/function.h index baa9a630eae1c63094b6b7003c22602fe7c4a256..d1ca9706c33bb4ea7c717d226d08cfb176dff5bc 100644 --- a/Solver/function.h +++ b/Solver/function.h @@ -46,6 +46,7 @@ class function { std::vector<int> _childrenCache; std::vector<substitutedFunction> _substitutedFunctions; virtual void call (dataCacheMap *m, fullMatrix<double> &res)=0; + virtual void registerInDataCacheMap(dataCacheMap *m, dataCacheDouble *d) {} std::vector<argument> arguments; const void setArgument(fullMatrix<double> &v, const function *f, int iMap = 0) { if(f==NULL)