libDAI
alldai.h
Go to the documentation of this file.
1 /* This file is part of libDAI - http://www.libdai.org/
2  *
3  * Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
4  *
5  * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
6  */
7 
8 
18 #ifndef __defined_libdai_alldai_h
19 #define __defined_libdai_alldai_h
20 
21 
22 #include <dai/dai_config.h>
23 #include <string>
24 #include <dai/daialg.h>
25 #include <dai/properties.h>
26 #include <dai/exactinf.h>
27 #include <dai/evidence.h>
28 #include <dai/emalg.h>
29 #ifdef DAI_WITH_BP
30  #include <dai/bp.h>
31 #endif
32 #ifdef DAI_WITH_FBP
33  #include <dai/fbp.h>
34 #endif
35 #ifdef DAI_WITH_TRWBP
36  #include <dai/trwbp.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 #ifdef DAI_WITH_GIBBS
57  #include <dai/gibbs.h>
58 #endif
59 #ifdef DAI_WITH_CBP
60  #include <dai/cbp.h>
61 #endif
62 #ifdef DAI_WITH_DECMAP
63  #include <dai/decmap.h>
64 #endif
65 #ifdef DAI_WITH_GLC
66  #include <dai/glc.h>
67 #endif
68 
69 
71 namespace dai {
72 
73 
75 
77 std::map<std::string, InfAlg *>& builtinInfAlgs();
78 
79 
81 /* These are the names of the algorithms that were compiled in and can be
82  * given to \ref newInfAlg and \ref newInfAlgFromString.
83  * \return A set of strings, each one corresponding with the name of an available inference algorithm.
84  * \note The set is returned by value because it will be reasonably small
85  * enough and this function is expected to be called infrequently.
86  */
87 std::set<std::string> builtinInfAlgNames();
88 
89 
91 
97 InfAlg *newInfAlg( const std::string &name, const FactorGraph &fg, const PropertySet &opts );
98 
99 
101 
106 InfAlg *newInfAlgFromString( const std::string &nameOpts, const FactorGraph &fg );
107 
108 
110 
116 InfAlg *newInfAlgFromString( const std::string &nameOpts, const FactorGraph &fg, const std::map<std::string,std::string> &aliases );
117 
118 
120 std::pair<std::string, PropertySet> parseNameProperties( const std::string &s );
121 
122 
124 
128 std::pair<std::string, PropertySet> parseNameProperties( const std::string &s, const std::map<std::string,std::string> &aliases );
129 
130 
132 
136 std::map<std::string,std::string> readAliasesFile( const std::string &filename );
137 
138 
139 } // end of namespace dai
140 
141 
167 #endif
Defines class Evidence, which stores multiple observations of joint states of variables.
Defines class BP, which implements (Loopy) Belief Propagation.
std::pair< std::string, PropertySet > parseNameProperties(const std::string &s)
Extracts the name and property set from a string s in the format "name[key1=val1,key2=val2,...]" or "name".
Definition: alldai.cpp:112
Defines class LC, which implements loop corrections for approximate inference.
std::map< std::string, std::string > readAliasesFile(const std::string &filename)
Reads aliases from file named filename.
Definition: alldai.cpp:152
Defines class HAK, which implements a variant of Generalized Belief Propagation.
InfAlg * newInfAlgFromString(const std::string &nameOpts, const FactorGraph &fg)
Constructs a new inference algorithm.
Definition: alldai.cpp:100
Defines class MR, which implements loop corrections as proposed by Montanari and Rizzo.
Defines class CBP, which implements Conditioned Belief Propagation.
Defines classes related to Expectation Maximization (EMAlg, ParameterEstimation, CondProbEstimation a...
Defines class JTree, which implements the junction tree algorithm.
Defines classes GLC and Cobweb, which implement the "Generalized Loop Correction method".
std::set< std::string > builtinInfAlgNames()
Returns a set of names of all available inference algorithms.
Definition: alldai.cpp:83
Defines class DecMAP, which constructs a MAP state by decimation.
std::map< std::string, InfAlg * > & builtinInfAlgs()
Returns a map that contains for each built-in inference algorithm its name and a pointer to an object...
Definition: alldai.cpp:78
Defines the Property and PropertySet classes, which are mainly used for managing parameters of infere...
Defines class Gibbs, which implements Gibbs sampling.
Namespace for libDAI.
Definition: alldai.cpp:16
Defines the general interface for inference methods in libDAI (classes InfAlg, DaiAlg<>, DaiAlgFG and DaiAlgRG).
Defines class FBP, which implements Fractional Belief Propagation.
Allows the user to specify which algorithms will be built into libDAI.
Defines class MF which implements the Mean Field algorithm.
Defines class TRWBP, which implements Tree-Reweighted Belief Propagation.
InfAlg * newInfAlg(const std::string &name, const FactorGraph &fg, const PropertySet &opts)
Constructs a new inference algorithm.
Definition: alldai.cpp:91
Defines ExactInf class, which can be used for exact inference on small factor graphs.
Defines class TreeEP, which implements Tree Expectation Propagation.