6d6dc84f7d04ab50894ea563adfa563723307950
[libdai.git] / matlab / matlab.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 #ifndef __defined_libdai_matlab_h
24 #define __defined_libdai_matlab_h
25
26
27 #include "mex.h"
28 #include <dai/factor.h>
29
30
31 namespace dai {
32
33
34 #ifdef SMALLMEM
35 typedef int mwSize;
36 typedef int mwIndex;
37 #endif
38
39
40 /// Convert vector<Factor> structure to a cell vector of CPTAB-like structs
41 mxArray *Factors2mx(const std::vector<Factor> &Ps);
42
43 /// Convert cell vector of CPTAB-like structs to vector<Factor>
44 std::vector<Factor> mx2Factors(const mxArray *psi, long verbose);
45
46 /// Convert CPTAB-like struct to Factor
47 Factor mx2Factor(const mxArray *psi);
48
49
50 } // end of namespace dai
51
52
53 #endif