hops
MarkovChain.hpp
Go to the documentation of this file.
1 #ifndef HOPS_MARKOVCHAIN_HPP
2 #define HOPS_MARKOVCHAIN_HPP
3 
4 #include <Eigen/Core>
5 #include <memory>
6 #include <vector>
7 
11 
12 
13 namespace hops {
14  class FileWriter;
15 
16  template<typename StateType = Eigen::VectorXd>
18  public:
19  virtual ~MarkovChainInterface() = default;
20 
26  virtual void draw(RandomNumberGenerator &randomNumberGenerator, long numberOfSamples) = 0;
27 
34  virtual void draw(RandomNumberGenerator &randomNumberGenerator, long numberOfSamples, long thinning) = 0;
35 
40  virtual void writeHistory(FileWriter *fileWriter) = 0;
41 
42  virtual void installDataObject(ChainData &chainData) = 0;
43 
44  virtual const std::vector<StateType> &getStateRecords() = 0;
45 
46  virtual void reserveStateRecords(long numberOfSamples) = 0;
47 
51  virtual void clearHistory() = 0;
52 
53  virtual std::string getName() = 0;
54 
55  virtual void setAttribute(MarkovChainAttribute markovChainAttribute, double value) = 0;
56 
57  virtual void setState(StateType state) = 0;
58 
59  virtual double getAttribute(MarkovChainAttribute markovChainAttribute) = 0;
60 
61  virtual double getAcceptanceRate() = 0;
62  };
63 
65 }
66 
67 #endif //HOPS_MARKOVCHAIN_HPP
RandomNumberGenerator.hpp
hops::MarkovChainInterface::setAttribute
virtual void setAttribute(MarkovChainAttribute markovChainAttribute, double value)=0
hops::MarkovChainInterface::setState
virtual void setState(StateType state)=0
hops::MarkovChainInterface::getStateRecords
virtual const std::vector< StateType > & getStateRecords()=0
pcg_detail::engine
Definition: pcg_random.hpp:364
hops::MarkovChainInterface::getAcceptanceRate
virtual double getAcceptanceRate()=0
hops::ChainData
Definition: ChainData.hpp:12
hops::MarkovChainInterface::clearHistory
virtual void clearHistory()=0
Deletes all stored chain history.
hops::FileWriter
Definition: FileWriter.hpp:9
hops
Definition: CsvReader.hpp:8
hops::MarkovChainInterface::~MarkovChainInterface
virtual ~MarkovChainInterface()=default
hops::MarkovChainInterface
Definition: MarkovChain.hpp:17
ChainData.hpp
hops::MarkovChainInterface::getName
virtual std::string getName()=0
hops::MarkovChainAttribute
MarkovChainAttribute
Definition: MarkovChainAttribute.hpp:5
MarkovChainAttribute.hpp
hops::MarkovChainInterface::installDataObject
virtual void installDataObject(ChainData &chainData)=0
string
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
hops::MarkovChainInterface::writeHistory
virtual void writeHistory(FileWriter *fileWriter)=0
Writes all stored chain history using the fileWriter.
hops::MarkovChainInterface::reserveStateRecords
virtual void reserveStateRecords(long numberOfSamples)=0
hops::MarkovChainInterface::getAttribute
virtual double getAttribute(MarkovChainAttribute markovChainAttribute)=0
hops::MarkovChainInterface::draw
virtual void draw(RandomNumberGenerator &randomNumberGenerator, long numberOfSamples)=0
Updates internal state of the chain and stores numberOfSamples samples in memory.
hops::MarkovChain
MarkovChainInterface< Eigen::VectorXd > MarkovChain
Definition: MarkovChain.hpp:64