SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MAPInference.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Shell Hu
8  * Copyright (C) 2013 Shell Hu
9  */
10 
11 #ifndef __MAP_INFERENCE_H__
12 #define __MAP_INFERENCE_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/base/SGObject.h>
17 #include <shogun/lib/SGVector.h>
20 
21 namespace shogun
22 {
23 
31 {
39 };
40 
41 class CMAPInferImpl;
42 
48 class CMAPInference : public CSGObject
49 {
50 public:
52  CMAPInference();
53 
59  CMAPInference(CFactorGraph* fg, EMAPInferType inference_method);
60 
62  virtual ~CMAPInference();
63 
65  virtual const char* get_name() const { return "MAPInference"; }
66 
68  virtual void inference();
69 
75 
77  float64_t get_energy() const;
78 
79 private:
81  void init();
82 
83 protected:
86 
89 
92 
95 };
96 
100 class CMAPInferImpl : public CSGObject
101 {
102 public:
104  CMAPInferImpl();
105 
111 
113  virtual ~CMAPInferImpl();
114 
116  virtual const char* get_name() const { return "MAPInferImpl"; }
117 
122  virtual float64_t inference(SGVector<int32_t> assignment) = 0;
123 
124 private:
126  void register_parameters();
127 
128 protected:
131 };
132 
133 }
134 
135 #endif

SHOGUN Machine Learning Toolbox - Documentation