GLAC  1.0
correlator.h
Go to the documentation of this file.
1 
13 #ifndef CORRELATOR_H
14 #define CORRELATOR_H
15 
16 #include "math/lattice.h"
17 #include "tools/observablestorer.h"
18 #include <vector>
19 
21 {
22 protected:
23  // Lattice dimension array
24  std::vector<unsigned int> m_N;
25 
26  // (sub)lattice size
27  double m_latticeSize;
28 
29  // Lattice spacing
30  double m_a;
31 
32  // Observable name
33  const int m_headerWidth = 20;
34  const std::string m_observableName = "Correlator";
35  const std::string m_observableNameCompact = "correlator";
36 
37  // Creates a object that store the observable
39 
40  // Object that holds info of whether or not we are storing flow observables
41  bool m_storeFlowObservable = false;
42 public:
43  Correlator(bool storeFlowObservable);
44  Correlator();
45  virtual ~Correlator();
46  virtual void calculate(Lattice<SU3> *lattice, unsigned int iObs);
47  virtual void writeObservableToFile(double acceptanceRatio);
48  virtual void writeFlowObservablesToFile(unsigned int iFlow);
49  virtual void runStatistics();
50 
51  // Printers
52  virtual void printObservable(unsigned int iObs);
53  virtual void printHeader();
54  virtual void printStatistics();
55 
56  // Observable copyer
57  virtual void copyObservable(unsigned int iObs, std::vector<double> obs);
58  virtual std::vector<double> getObservablesVector(unsigned int iObs);
59 
60  // Getters
61  virtual double getObservable(unsigned int iObs);
62  virtual std::string getObservableName() { return m_observableName; }
63  virtual int getHeaderWidth() { return m_headerWidth; }
64 
65  // Setters
66  virtual void reset();
67  virtual void initializeObservableStorer(bool storeFlowObservable);
68 };
69 
70 
71 #endif // CORRELATOR_H
const int m_headerWidth
Definition: correlator.h:33
A class for storing the observable data.
Definition: observablestorer.h:19
virtual std::string getObservableName()
Definition: correlator.h:62
virtual void calculate(Lattice< SU3 > *lattice, unsigned int iObs)
Correlator::calculate calculates a observable.
Definition: correlator.cpp:42
virtual void copyObservable(unsigned int iObs, std::vector< double > obs)
Correlator::copyObservable copies the observable if has already been calculated at zero flow time.
Definition: correlator.cpp:154
virtual std::vector< double > getObservablesVector(unsigned int iObs)
Correlator::getObservablesVector.
Definition: correlator.cpp:166
virtual double getObservable(unsigned int iObs)
Correlator::getObservable.
Definition: correlator.cpp:64
virtual void initializeObservableStorer(bool storeFlowObservable)
Correlator::initializeObservableStorer initializes ObservableStorer.
Definition: correlator.cpp:127
Correlator()
Correlator::Correlator.
Definition: correlator.cpp:23
virtual ~Correlator()
Definition: correlator.cpp:31
std::vector< unsigned int > m_N
Definition: correlator.h:24
const std::string m_observableName
Definition: correlator.h:34
virtual void writeObservableToFile(double acceptanceRatio)
Correlator::writeObservableToFile calls the ObservableStorer for writing observable to file.
Definition: correlator.cpp:118
double m_latticeSize
Definition: correlator.h:27
bool m_storeFlowObservable
Definition: correlator.h:41
virtual void printObservable(unsigned int iObs)
Correlator::printObservable prints the observable for the output.
Definition: correlator.cpp:73
virtual void printStatistics()
Correlator::printStatistics prints statistics from ObservableStorer.
Definition: correlator.cpp:175
ObservableStorer * m_observable
Definition: correlator.h:38
virtual void printHeader()
Correlator::printHeader prints a the observable name for output in header.
Definition: correlator.cpp:54
base class for observables.
Definition: correlator.h:20
double m_a
Definition: correlator.h:30
const std::string m_observableNameCompact
Definition: correlator.h:35
virtual void writeFlowObservablesToFile(unsigned int iFlow)
Correlator::writeFlowObservablesToFile.
Definition: correlator.cpp:108
virtual int getHeaderWidth()
Definition: correlator.h:63
virtual void reset()
Correlator::reset resets ObservableStorer.
Definition: correlator.cpp:144
virtual void runStatistics()
Correlator::runStatistics.
Definition: correlator.cpp:93