⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 montecarlo.h

📁 The package includes 3 Matlab-interfaces to the c-code: 1. inference.m An interface to the full
💻 H
字号:
#include "InferenceAlgorithm.h"#ifndef __MONTE_CARLO__#define __MONTE_CARLO__class MonteCarlo : public InferenceAlgorithm {  /**     This class defines the interface for making inference using     Monte-Carlo sampling method        Part of the c_inference package     @version November 2004     @author Talya Meltzer  */   public:  // ctor  MonteCarlo(MRF const* mrf, int* startX, int burningTime, int samplingInterval, int S) :    InferenceAlgorithm(mrf),    mc_burning(burningTime), mc_interval(samplingInterval),    mc_S(S)    { mc_currX = 0; init(startX); }    virtual ~MonteCarlo(); // dtor    virtual void reachEquilibrium();  virtual double** inference(int* converged);  void getCurrentState(int* currX) const;    void init(int* startX);  void initState(int* startX);  void setBurningTime(int burningTime) { mc_burning = burningTime; }  void setSamplingInterval(int samplingInterval) { mc_interval = samplingInterval; }  void setSamplesNum(int S) { mc_S = S; } protected:    int mc_burning; // burning time to wait before sampling  int mc_interval; // time to wait between samples  int mc_S; // number of samples to take  int* mc_currX; // the current state  double* mc_Pi;  double** mc_Pxi;  virtual void transition() = 0;    void freeState();  int chooseInteger(double* q, int n);};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -