Cleaned up variable elimination code in ClusterGraph
[libdai.git] / include / dai / alldai.h
1 /* This file is part of libDAI - http://www.libdai.org/
2 *
3 * libDAI is licensed under the terms of the GNU General Public License version
4 * 2, or (at your option) any later version. libDAI is distributed without any
5 * warranty. See the file COPYING for more details.
6 *
7 * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
8 * Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
9 */
10
11
12 /// \file
13 /// \brief Main libDAI header file. It \#includes all other libDAI headers.
14
15
16 #ifndef __defined_libdai_alldai_h
17 #define __defined_libdai_alldai_h
18
19
20 #include <string>
21 #include <dai/daialg.h>
22 #include <dai/properties.h>
23 #include <dai/exactinf.h>
24 #include <dai/evidence.h>
25 #include <dai/emalg.h>
26 #ifdef DAI_WITH_BP
27 #include <dai/bp.h>
28 #endif
29 #ifdef DAI_WITH_FBP
30 #include <dai/fbp.h>
31 #endif
32 #ifdef DAI_WITH_MF
33 #include <dai/mf.h>
34 #endif
35 #ifdef DAI_WITH_HAK
36 #include <dai/hak.h>
37 #endif
38 #ifdef DAI_WITH_LC
39 #include <dai/lc.h>
40 #endif
41 #ifdef DAI_WITH_TREEEP
42 #include <dai/treeep.h>
43 #endif
44 #ifdef DAI_WITH_JTREE
45 #include <dai/jtree.h>
46 #endif
47 #ifdef DAI_WITH_MR
48 #include <dai/mr.h>
49 #endif
50 #ifdef DAI_WITH_GIBBS
51 #include <dai/gibbs.h>
52 #endif
53 #ifdef DAI_WITH_CBP
54 #include <dai/cbp.h>
55 #endif
56
57
58 /// Namespace for libDAI
59 namespace dai {
60
61
62 /// Constructs a new inference algorithm.
63 /** \param name The name of the inference algorithm (should be one of the names in DAINames).
64 * \param fg The FactorGraph that the algorithm should be applied to.
65 * \param opts A PropertySet specifying the options for the algorithm.
66 * \return Returns a pointer to the new InfAlg object; it is the responsibility of the caller to delete it later.
67 * \throw UNKNOWN_DAI_ALGORITHM if the requested name is not known/compiled in.
68 */
69 InfAlg *newInfAlg( const std::string &name, const FactorGraph &fg, const PropertySet &opts );
70
71
72 /// Constructs a new inference algorithm.
73 /** \param nameOpts The name and options of the inference algorithm (should be in the format "name[key1=val1,key2=val2,...,keyn=valn]").
74 * \param fg The FactorGraph that the algorithm should be applied to.
75 * \return Returns a pointer to the new InfAlg object; it is the responsibility of the caller to delete it later.
76 * \throw UNKNOWN_DAI_ALGORITHM if the requested name is not known/compiled in.
77 * \todo Support aliases like in testdai.cpp
78 */
79 InfAlg *newInfAlgFromString( const std::string &nameOpts, const FactorGraph &fg );
80
81
82 /// Contains the names of all inference algorithms compiled into libDAI.
83 static const char* DAINames[] = {
84 ExactInf::Name,
85 #ifdef DAI_WITH_BP
86 BP::Name,
87 #endif
88 #ifdef DAI_WITH_FBP
89 FBP::Name,
90 #endif
91 #ifdef DAI_WITH_MF
92 MF::Name,
93 #endif
94 #ifdef DAI_WITH_HAK
95 HAK::Name,
96 #endif
97 #ifdef DAI_WITH_LC
98 LC::Name,
99 #endif
100 #ifdef DAI_WITH_TREEEP
101 TreeEP::Name,
102 #endif
103 #ifdef DAI_WITH_JTREE
104 JTree::Name,
105 #endif
106 #ifdef DAI_WITH_MR
107 MR::Name,
108 #endif
109 #ifdef DAI_WITH_GIBBS
110 Gibbs::Name,
111 #endif
112 #ifdef DAI_WITH_CBP
113 CBP::Name,
114 #endif
115 ""
116 };
117
118
119 } // end of namespace dai
120
121
122 #endif