Significant improvement of documentation
[libdai.git] / include / dai / alldai.h
1 /* Copyright (C) 2006-2008 Joris Mooij [joris dot mooij at tuebingen dot mpg dot de]
2 Radboud University Nijmegen, The Netherlands /
3 Max Planck Institute for Biological Cybernetics, Germany
4
5 This file is part of libDAI.
6
7 libDAI is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 libDAI is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with libDAI; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23 /// \file
24 /// \brief Main libDAI header file
25
26
27 #ifndef __defined_libdai_alldai_h
28 #define __defined_libdai_alldai_h
29
30
31 #include <string>
32 #include <dai/daialg.h>
33 #include <dai/properties.h>
34 #include <dai/exactinf.h>
35 #ifdef DAI_WITH_BP
36 #include <dai/bp.h>
37 #endif
38 #ifdef DAI_WITH_MF
39 #include <dai/mf.h>
40 #endif
41 #ifdef DAI_WITH_HAK
42 #include <dai/hak.h>
43 #endif
44 #ifdef DAI_WITH_LC
45 #include <dai/lc.h>
46 #endif
47 #ifdef DAI_WITH_TREEEP
48 #include <dai/treeep.h>
49 #endif
50 #ifdef DAI_WITH_JTREE
51 #include <dai/jtree.h>
52 #endif
53 #ifdef DAI_WITH_MR
54 #include <dai/mr.h>
55 #endif
56
57
58 /// Namespace for libDAI
59 namespace dai {
60
61
62 /// Constructs a new approximate inference algorithm.
63 /** \param name The name of the approximate 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 */
68 InfAlg *newInfAlg( const std::string &name, const FactorGraph &fg, const PropertySet &opts );
69
70
71 /// Contains the names of all approximate inference algorithms compiled into libDAI.
72 static const char* DAINames[] = {
73 ExactInf::Name,
74 #ifdef DAI_WITH_BP
75 BP::Name,
76 #endif
77 #ifdef DAI_WITH_MF
78 MF::Name,
79 #endif
80 #ifdef DAI_WITH_HAK
81 HAK::Name,
82 #endif
83 #ifdef DAI_WITH_LC
84 LC::Name,
85 #endif
86 #ifdef DAI_WITH_TREEEP
87 TreeEP::Name,
88 #endif
89 #ifdef DAI_WITH_JTREE
90 JTree::Name,
91 #endif
92 #ifdef DAI_WITH_MR
93 MR::Name,
94 #endif
95 ""
96 };
97
98
99 } // end of namespace dai
100
101
102 /** \mainpage libDAI reference manual
103 * \author Joris Mooij
104 * \version 0.2.2
105 * \date 30 September 2008
106 *
107 * \section about About libDAI
108 * libDAI is a free/open source C++ library (licensed under GPL) that provides
109 * implementations of various (approximate) inference methods for discrete
110 * graphical models. libDAI supports arbitrary factor graphs with discrete
111 * variables; this includes discrete Markov Random Fields and Bayesian
112 * Networks.
113 *
114 * The library is targeted at researchers; to be able to use the library, a
115 * good understanding of graphical models is needed.
116 *
117 * \section limitations Limitations
118 * libDAI is not intended to be a complete package for approximate inference.
119 * Instead, it should be considered as an "inference engine", providing
120 * various inference methods. In particular, it contains no GUI, currently
121 * only supports its own file format for input and output (although support
122 * for standard file formats may be added later), and provides very limited
123 * visualization functionalities.
124 *
125 * \section features Features
126 * Currently, libDAI supports the following (approximate) inference methods:
127 * - Exact inference by brute force enumeration;
128 * - Exact inference by junction-tree methods;
129 * - Mean Field;
130 * - Loopy Belief Propagation [\ref KFL01];
131 * - Tree Expectation Propagation [\ref MiQ04];
132 * - Generalized Belief Propagation [\ref YFW05];
133 * - Double-loop GBP [\ref HAK03];
134 * - Various variants of Loop Corrected Belief Propagation
135 * [\ref MoK07, \ref MoR05].
136 *
137 * \section language Why C++?
138 * Because libDAI is implemented in C++, it is very fast compared with
139 * implementations in MatLab (a factor 1000 faster is not uncommon).
140 * libDAI does provide a MatLab interface for easy integration with MatLab.
141 *
142 */
143
144
145 /** \page Bibliography
146 * \section Bibliograpy
147 * \anchor KFL01 \ref KFL01
148 * F. R. Kschischang and B. J. Frey and H.-A. Loeliger (2001):
149 * "Factor Graphs and the Sum-Product Algorithm",
150 * <em>IEEE Transactions on Information Theory</em> 47(2):498-519.
151 * http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=910572
152 *
153 * \anchor MiQ04 \ref MiQ04
154 * T. Minka and Y. Qi (2004):
155 * "Tree-structured Approximations by Expectation Propagation",
156 * <em>Advances in Neural Information Processing Systems</em> (NIPS) 16.
157 * http://books.nips.cc/papers/files/nips16/NIPS2003_AA25.pdf
158 *
159 * \anchor MoR05 \ref MoR05
160 * A. Montanari and T. Rizzo (2005):
161 * "How to Compute Loop Corrections to the Bethe Approximation",
162 * <em>Journal of Statistical Mechanics: Theory and Experiment</em>
163 * 2005(10)-P10011.
164 * http://stacks.iop.org/1742-5468/2005/P10011
165 *
166 * \anchor YFW05 \ref YFW05
167 * J. S. Yedidia and W. T. Freeman and Y. Weiss (2005):
168 * "Constructing Free-Energy Approximations and Generalized Belief Propagation Algorithms",
169 * <em>IEEE Transactions on Information Theory</em>
170 * 51(7):2282-2312.
171 * http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1459044
172 *
173 * \anchor HAK03 \ref HAK03
174 * T. Heskes and C. A. Albers and H. J. Kappen (2003):
175 * "Approximate Inference and Constrained Optimization",
176 * <em>Proceedings of the 19th Annual Conference on Uncertainty in Artificial Intelligence (UAI-03)</em> pp. 313-320.
177 * http://www.snn.ru.nl/reports/Heskes.uai2003.ps.gz
178 *
179 * \anchor MoK07 \ref MoK07
180 * J. M. Mooij and H. J. Kappen (2007):
181 * "Loop Corrections for Approximate Inference on Factor Graphs",
182 * <em>Journal of Machine Learning Research</em> 8:1113-1143.
183 * http://www.jmlr.org/papers/volume8/mooij07a/mooij07a.pdf
184 *
185 * \anchor MoK07b \ref MoK07b
186 * J. M. Mooij and H. J. Kappen (2007):
187 * "Sufficient Conditions for Convergence of the Sum-Product Algorithm",
188 * <em>IEEE Transactions on Information Theory</em> 53(12):4422-4437.
189 * http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4385778
190 */
191
192
193 #endif