Changed license from GPL v2+ to FreeBSD (aka BSD 2-clause) license
[libdai.git] / include / dai / matlab / matlab.h
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
9 /// \file
10 /// \brief Defines some utility functions for interfacing with MatLab
11
12
13 #ifndef __defined_libdai_matlab_h
14 #define __defined_libdai_matlab_h
15
16
17 #include "mex.h"
18 #include <dai/factor.h>
19
20
21 namespace dai {
22
23
24 #ifdef SMALLMEM
25 typedef int mwSize;
26 typedef int mwIndex;
27 #endif
28
29
30 /// Convert vector<Factor> structure to a cell vector of CPTAB-like structs
31 mxArray *Factors2mx(const std::vector<Factor> &Ps);
32
33 /// Convert cell vector of CPTAB-like structs to vector<Factor>
34 std::vector<Factor> mx2Factors(const mxArray *psi, long verbose);
35
36 /// Convert CPTAB-like struct to Factor
37 Factor mx2Factor(const mxArray *psi);
38
39
40 } // end of namespace dai
41
42
43 #endif