Updated copyrights
[libdai.git] / src / alldai.cpp
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 #include <string>
24 #include <dai/alldai.h>
25 #include <dai/properties.h>
26 #include <dai/exceptions.h>
27
28
29 namespace dai {
30
31
32 using namespace std;
33
34
35 InfAlg *newInfAlg( const string &name, const FactorGraph &fg, const PropertySet &opts ) {
36 if( name == ExactInf::Name )
37 return new ExactInf (fg, opts);
38 #ifdef WITH_BP
39 if( name == BP::Name )
40 return new BP (fg, opts);
41 #endif
42 #ifdef WITH_MF
43 if( name == MF::Name )
44 return new MF (fg, opts);
45 #endif
46 #ifdef WITH_HAK
47 if( name == HAK::Name )
48 return new HAK (fg, opts);
49 #endif
50 #ifdef WITH_LC
51 if( name == LC::Name )
52 return new LC (fg, opts);
53 #endif
54 #ifdef WITH_TREEEP
55 if( name == TreeEP::Name )
56 return new TreeEP (fg, opts);
57 #endif
58 #ifdef WITH_JTREE
59 if( name == JTree::Name )
60 return new JTree (fg, opts);
61 #endif
62 #ifdef WITH_MR
63 if( name == MR::Name )
64 return new MR (fg, opts);
65 #endif
66 DAI_THROW(UNKNOWN_DAI_ALGORITHM);
67 }
68
69
70 } // end of namespace dai