Commit 5ca67d2a authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

runner_pt: evalables now work correctly


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@14 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent da2df04a
...@@ -412,3 +412,22 @@ void evalable :: vectorjackknife(vector<observable*>& v, ...@@ -412,3 +412,22 @@ void evalable :: vectorjackknife(vector<observable*>& v,
} }
} }
string evalable::toString() {
std::stringstream ss;
get_statistics(ss);
/* ss << "name: " << name_ << "\n";
ss << "bins: " << bins_ << "\n";
ss << "vector length: " << vector_length_ << "\n";
ss << "bin length: " << bin_length_ << "\n";
ss << "binning base: " << binning_base << "\n";
ss << "--------------------\n";
for (size_t i = 0; i < mean_v.size(); ++i) {
valarray<double> *v = &mean_v[i],
*e = &error_v[i];
for (size_t j = 0; j < v->size(); ++j)
ss << (*v)[j] << "\t" << (*e)[j] << "\n";
}*/
return ss.str();
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define MCL_VECTOREVALABLE_H #define MCL_VECTOREVALABLE_H
#include <iostream> #include <iostream>
#include <sstream>
#include <cmath> #include <cmath>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -40,6 +41,8 @@ class evalable ...@@ -40,6 +41,8 @@ class evalable
void reset() {mean_v.clear();error_v.clear();} void reset() {mean_v.clear();error_v.clear();}
void get_statistics(ostream&); void get_statistics(ostream&);
string toString();
vector<valarray<double> > mean_v; vector<valarray<double> > mean_v;
vector<valarray<double> > error_v; vector<valarray<double> > error_v;
......
...@@ -116,6 +116,7 @@ void measurements :: add_evalable(std::string name, std::vector<std::string>& n, ...@@ -116,6 +116,7 @@ void measurements :: add_evalable(std::string name, std::vector<std::string>& n,
std::vector<observable* > v; 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) v.push_back(obs_v[eo[n[i]]]);
e->jackknife(v,f,p); e->jackknife(v,f,p);
cout << e->toString() << endl;
eva_v.push_back(e); eva_v.push_back(e);
eo[name]=eva_v.size()-1; eo[name]=eva_v.size()-1;
tag[name]=0; tag[name]=0;
......
Supports Markdown
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