comparison Problems/private/mexutils.h @ 61:42fcbcfca132

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:21:31 +0000
parents 51b76c31c93d
children
comparison
equal deleted inserted replaced
60:ad36f80e2ccf 61:42fcbcfca132
1 /**************************************************************************
2 *
3 * File name: mexutils.h
4 *
5 * Ron Rubinstein
6 * Computer Science Department
7 * Technion, Haifa 32000 Israel
8 * ronrubin@cs
9 *
10 * Last Updated: 18.8.2009
11 *
12 * Utility functions for MEX files.
13 *
14 *************************************************************************/
15
16
17 #ifndef __MEX_UTILS_H__
18 #define __MEX_UTILS_H__
19
20 #include "mex.h"
21
22
23
24 /**************************************************************************
25 * Function checkmatrix:
26 *
27 * Verify that the specified mxArray is real, of type double, and has
28 * no more than two dimensions. If not, an error message is printed
29 * and the mex file terminates.
30 *
31 * Parameters:
32 * param - the mxArray to be checked
33 * fname - the name of the function where the error occured (15 characters or less)
34 * pname - the name of the parameter (25 characters or less)
35 *
36 **************************************************************************/
37 void checkmatrix(const mxArray *param, char *fname, char *pname);
38
39
40 /**************************************************************************
41 * Function checkvector:
42 *
43 * Verify that the specified mxArray is 1-D, real, and of type double. The
44 * vector may be a column or row vector. Otherwise, an error message is
45 * printed and the mex file terminates.
46 *
47 * Parameters:
48 * param - the mxArray to be checked
49 * fname - the name of the function where the error occured (15 characters or less)
50 * pname - the name of the parameter (25 characters or less)
51 *
52 **************************************************************************/
53 void checkvector(const mxArray *param, char *fname, char *pname);
54
55
56 /**************************************************************************
57 * Function checkscalar:
58 *
59 * Verify that the specified mxArray represents a real double scalar value.
60 * If not, an error message is printed and the mex file terminates.
61 *
62 * Parameters:
63 * param - the mxArray to be checked
64 * fname - the name of the function where the error occured (15 characters or less)
65 * pname - the name of the parameter (25 characters or less)
66 *
67 **************************************************************************/
68 void checkscalar(const mxArray *param, char *fname, char *pname);
69
70
71 /**************************************************************************
72 * Function checksparse:
73 *
74 * Verify that the specified mxArray contains a sparse matrix. If not,
75 * an error message is printed and the mex file terminates.
76 *
77 * Parameters:
78 * param - the mxArray to be checked
79 * fname - the name of the function where the error occured (15 characters or less)
80 * pname - the name of the parameter (25 characters or less)
81 *
82 **************************************************************************/
83 void checksparse(const mxArray *param, char *fname, char *pname);
84
85
86 /**************************************************************************
87 * Function checkcell_1d:
88 *
89 * Verify that the specified mxArray is a 1-D cell array. The cell array
90 * may be arranged as either a column or a row. If not, an error message
91 * is printed and the mex file terminates.
92 *
93 * Parameters:
94 * param - the mxArray to be checked
95 * fname - the name of the function where the error occured (15 characters or less)
96 * pname - the name of the parameter (25 characters or less)
97 *
98 **************************************************************************/
99 void checkcell_1d(const mxArray *param, char *fname, char *pname);
100
101
102 #endif
103