Commit e67faa80 authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

add_evalable in measurement.cpp now throws an exception when trying to read a...

add_evalable in measurement.cpp now throws an exception when trying to read a non-existent observable


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@29 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent f1dc5154
......@@ -61,7 +61,14 @@ void measurements :: add_evalable(std::string name, std::vector<std::string>& n,
{
evalable *e = new evalable(name);
std::vector<observable* > v;
for (uint i=0;i<n.size();++i) v.push_back(obs_v[eo[n[i]]]);
for (uint i=0;i<n.size();++i) {
if (eo.find(n[i]) == eo.end()) {
stringstream s;
s << "No observable with name " << n[i];
throw s.str();
}
v.push_back(obs_v[eo[n[i]]]);
}
e->jackknife(v,f);
eva_v.push_back(e);
eo[name]=eva_v.size()-1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment