evalable.h 832 Bytes
Newer Older
1
#pragma once
Stefan Weßel's avatar
ic  
Stefan Weßel committed
2
3

#include <vector>
4
#include <functional>
5
#include <string>
Lukas Weber's avatar
Lukas Weber committed
6
#include "results.h"
7
8
9
10
11
12
13
14
15
16
17
18

class evalable {
public:
	// Internally all observables are vectors, so you need a function
	//
	// std::vector<double> calculate_stuff(const std::vector<std::vector<double>>& obs);
	//
	// to create your evalable. The vector then contains all the observable values you
	// specified when constructing the evalable
	// 
	typedef std::function<std::vector<double>(const std::vector<std::vector<double>>& observables)> func;
	
19
	evalable(std::string name, std::vector<std::string> used_observables, func fun); 
20
	const std::string& name() const;
Lukas Weber's avatar
Lukas Weber committed
21
	void jackknife(const results& res, observable_result &out) const;
22
23
24
25
26

private:
        const std::string name_;
        const std::vector<std::string> used_observables_;
        const func fun_;
Stefan Weßel's avatar
ic  
Stefan Weßel committed
27
};