Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::matlab Namespace Reference

Classes

class  MatlabWorkspace
 
class  MexStream
 

Functions

IGL_INLINE void mlinit (Engine **engine)
 
IGL_INLINE void mlclose (Engine **engine)
 
IGL_INLINE void mlsetmatrix (Engine **engine, std::string name, const Eigen::MatrixXd &M)
 
IGL_INLINE void mlsetmatrix (Engine **engine, std::string name, const Eigen::MatrixXf &M)
 
IGL_INLINE void mlsetmatrix (Engine **engine, std::string name, const Eigen::MatrixXi &M)
 
IGL_INLINE void mlsetmatrix (Engine **mlengine, std::string name, const Eigen::Matrix< unsigned int, Eigen::Dynamic, Eigen::Dynamic > &M)
 
IGL_INLINE void mlgetmatrix (Engine **engine, std::string name, Eigen::MatrixXd &M)
 
IGL_INLINE void mlgetmatrix (Engine **engine, std::string name, Eigen::MatrixXf &M)
 
IGL_INLINE void mlgetmatrix (Engine **engine, std::string name, Eigen::MatrixXi &M)
 
IGL_INLINE void mlgetmatrix (Engine **mlengine, std::string name, Eigen::Matrix< unsigned int, Eigen::Dynamic, Eigen::Dynamic > &M)
 
IGL_INLINE void mlsetscalar (Engine **engine, std::string name, double s)
 
IGL_INLINE double mlgetscalar (Engine **engine, std::string name)
 
IGL_INLINE std::string mleval (Engine **engine, std::string code)
 
IGL_INLINE void mlsetmatrix (Engine **mlengine, std::string name, const Eigen::SparseMatrix< double > &M)
 
IGL_INLINE void mexErrMsgTxt (bool test, const char *message)
 
template<typename DerivedV >
IGL_INLINE void parse_rhs_double (const mxArray *prhs[], Eigen::PlainObjectBase< DerivedV > &V)
 
template<typename DerivedV >
IGL_INLINE void parse_rhs_index (const mxArray *prhs[], Eigen::PlainObjectBase< DerivedV > &V)
 
template<typename VType >
IGL_INLINE void parse_rhs (const mxArray *prhs[], Eigen::SparseMatrix< VType > &M)
 
template<typename DerivedV >
IGL_INLINE void prepare_lhs_double (const Eigen::PlainObjectBase< DerivedV > &V, mxArray *plhs[])
 
template<typename DerivedV >
IGL_INLINE void prepare_lhs_logical (const Eigen::PlainObjectBase< DerivedV > &V, mxArray *plhs[])
 
template<typename DerivedV >
IGL_INLINE void prepare_lhs_index (const Eigen::PlainObjectBase< DerivedV > &V, mxArray *plhs[])
 
template<typename Vtype >
IGL_INLINE void prepare_lhs_double (const Eigen::SparseMatrix< Vtype > &V, mxArray *plhs[])
 
IGL_INLINE void requires_arg (const int i, const int nrhs, const char *name)
 
IGL_INLINE void validate_arg_scalar (const int i, const int nrhs, const mxArray *prhs[], const char *name)
 
IGL_INLINE void validate_arg_logical (const int i, const int nrhs, const mxArray *prhs[], const char *name)
 
IGL_INLINE void validate_arg_char (const int i, const int nrhs, const mxArray *prhs[], const char *name)
 
IGL_INLINE void validate_arg_double (const int i, const int nrhs, const mxArray *prhs[], const char *name)
 
IGL_INLINE void validate_arg_function_handle (const int i, const int nrhs, const mxArray *prhs[], const char *name)
 

Function Documentation

◆ mexErrMsgTxt()

IGL_INLINE void igl::matlab::mexErrMsgTxt ( bool  test,
const char *  message 
)
11{
12 if(!assertion)
13 {
14 ::mexErrMsgTxt(text);
15 }
16}

Referenced by requires_arg(), validate_arg_char(), validate_arg_double(), validate_arg_function_handle(), validate_arg_logical(), and validate_arg_scalar().

+ Here is the caller graph for this function:

◆ mlclose()

IGL_INLINE void igl::matlab::mlclose ( Engine **  engine)
21{
22 engClose(*mlengine);
23 *mlengine = 0;
24}

◆ mleval()

IGL_INLINE std::string igl::matlab::mleval ( Engine **  engine,
std::string  code 
)
258{
259 if (*mlengine == 0)
260 mlinit(mlengine);
261
262 const char *matlab_code = code.c_str();
263 const int BUF_SIZE = 4096*4096;
264 // allocate on the heap to avoid running out of stack
265 std::string bufauto(BUF_SIZE+1, '\0');
266 char *buf = &bufauto[0];
267
268 assert(matlab_code != NULL);
269
270 // Use RAII ensure that on leaving this scope, the output buffer is
271 // always nullified (to prevent Matlab from accessing memory that might
272 // have already been deallocated).
273 struct cleanup {
274 Engine *m_ep;
275 cleanup(Engine *ep) : m_ep(ep) { }
276 ~cleanup() { engOutputBuffer(m_ep, NULL, 0); }
277 } cleanup_obj(*mlengine);
278
279 if (buf != NULL)
280 engOutputBuffer(*mlengine, buf, BUF_SIZE);
281
282 int res = engEvalString(*mlengine, matlab_code);
283
284 if (res != 0) {
285 std::ostringstream oss;
286 oss << "ERROR: Matlab command failed with error code " << res << ".\n";
287 return oss.str();
288 }
289
290 if (buf[0] == '>' && buf[1] == '>' && buf[2] == ' ')
291 buf += 3;
292 if (buf[0] == '\n') ++buf;
293
294 return std::string(buf);
295}
IGL_INLINE void mlinit(Engine **engine)
Definition matlabinterface.cpp:14

References mlinit().

Referenced by mlsetmatrix().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mlgetmatrix() [1/4]

IGL_INLINE void igl::matlab::mlgetmatrix ( Engine **  engine,
std::string  name,
Eigen::MatrixXd &  M 
)
100{
101 if (*mlengine == 0)
102 mlinit(mlengine);
103
104 unsigned long m = 0;
105 unsigned long n = 0;
106 std::vector<double> t;
107
108 mxArray *ary = engGetVariable(*mlengine, name.c_str());
109 if (ary == NULL)
110 {
111 m = 0;
112 n = 0;
113 M = Eigen::MatrixXd(0,0);
114 }
115 else
116 {
117 m = mxGetM(ary);
118 n = mxGetN(ary);
119 M = Eigen::MatrixXd(m,n);
120
121 double *pM = mxGetPr(ary);
122
123 int c = 0;
124 for(int j=0; j<M.cols();++j)
125 for(int i=0; i<M.rows();++i)
126 M(i,j) = pM[c++];
127 }
128
129 mxDestroyArray(ary);
130}

References mlinit().

Referenced by mlgetscalar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mlgetmatrix() [2/4]

IGL_INLINE void igl::matlab::mlgetmatrix ( Engine **  engine,
std::string  name,
Eigen::MatrixXf &  M 
)
133{
134 if (*mlengine == 0)
135 mlinit(mlengine);
136
137 unsigned long m = 0;
138 unsigned long n = 0;
139 std::vector<double> t;
140
141 mxArray *ary = engGetVariable(*mlengine, name.c_str());
142 if (ary == NULL)
143 {
144 m = 0;
145 n = 0;
146 M = Eigen::MatrixXf(0,0);
147 }
148 else
149 {
150 m = mxGetM(ary);
151 n = mxGetN(ary);
152 M = Eigen::MatrixXf(m,n);
153
154 double *pM = mxGetPr(ary);
155
156 int c = 0;
157 for(int j=0; j<M.cols();++j)
158 for(int i=0; i<M.rows();++i)
159 M(i,j) = pM[c++];
160 }
161
162 mxDestroyArray(ary);
163}

References mlinit().

+ Here is the call graph for this function:

◆ mlgetmatrix() [3/4]

IGL_INLINE void igl::matlab::mlgetmatrix ( Engine **  engine,
std::string  name,
Eigen::MatrixXi &  M 
)
167{
168 if (*mlengine == 0)
169 mlinit(mlengine);
170
171 unsigned long m = 0;
172 unsigned long n = 0;
173 std::vector<double> t;
174
175 mxArray *ary = engGetVariable(*mlengine, name.c_str());
176 if (ary == NULL)
177 {
178 m = 0;
179 n = 0;
180 M = Eigen::MatrixXi(0,0);
181 }
182 else
183 {
184 m = mxGetM(ary);
185 n = mxGetN(ary);
186 M = Eigen::MatrixXi(m,n);
187
188 double *pM = mxGetPr(ary);
189
190 int c = 0;
191 for(int j=0; j<M.cols();++j)
192 for(int i=0; i<M.rows();++i)
193 M(i,j) = int(pM[c++])-1;
194 }
195
196 mxDestroyArray(ary);
197}

References mlinit().

+ Here is the call graph for this function:

◆ mlgetmatrix() [4/4]

IGL_INLINE void igl::matlab::mlgetmatrix ( Engine **  mlengine,
std::string  name,
Eigen::Matrix< unsigned int, Eigen::Dynamic, Eigen::Dynamic > &  M 
)
201{
202 if (*mlengine == 0)
203 mlinit(mlengine);
204
205 unsigned long m = 0;
206 unsigned long n = 0;
207 std::vector<double> t;
208
209 mxArray *ary = engGetVariable(*mlengine, name.c_str());
210 if (ary == NULL)
211 {
212 m = 0;
213 n = 0;
215 }
216 else
217 {
218 m = mxGetM(ary);
219 n = mxGetN(ary);
221
222 double *pM = mxGetPr(ary);
223
224 int c = 0;
225 for(int j=0; j<M.cols();++j)
226 for(int i=0; i<M.rows();++i)
227 M(i,j) = (unsigned int)(pM[c++])-1;
228 }
229
230 mxDestroyArray(ary);
231}
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Definition PlainObjectBase.h:153
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151

References Eigen::PlainObjectBase< Derived >::cols(), mlinit(), and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ mlgetscalar()

IGL_INLINE double igl::matlab::mlgetscalar ( Engine **  engine,
std::string  name 
)
247{
248 if (*mlengine == 0)
249 mlinit(mlengine);
250
251 Eigen::MatrixXd M;
252 mlgetmatrix(mlengine, name,M);
253 return M(0,0);
254}
IGL_INLINE void mlgetmatrix(Engine **engine, std::string name, Eigen::MatrixXd &M)
Definition matlabinterface.cpp:99

References mlgetmatrix(), and mlinit().

+ Here is the call graph for this function:

◆ mlinit()

IGL_INLINE void igl::matlab::mlinit ( Engine **  engine)
15{
16 *mlengine = engOpen("\0");
17}

Referenced by mleval(), mlgetmatrix(), mlgetmatrix(), mlgetmatrix(), mlgetmatrix(), mlgetscalar(), mlsetmatrix(), mlsetmatrix(), mlsetmatrix(), mlsetmatrix(), and mlsetscalar().

+ Here is the caller graph for this function:

◆ mlsetmatrix() [1/5]

IGL_INLINE void igl::matlab::mlsetmatrix ( Engine **  engine,
std::string  name,
const Eigen::MatrixXd &  M 
)
28{
29 if (*mlengine == 0)
30 mlinit(mlengine);
31
32 mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL);
33 double *pM = mxGetPr(A);
34
35 int c = 0;
36 for(int j=0; j<M.cols();++j)
37 for(int i=0; i<M.rows();++i)
38 pM[c++] = double(M(i,j));
39
40 engPutVariable(*mlengine, name.c_str(), A);
41 mxDestroyArray(A);
42}

References mlinit().

Referenced by mlsetmatrix(), and mlsetscalar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mlsetmatrix() [2/5]

IGL_INLINE void igl::matlab::mlsetmatrix ( Engine **  engine,
std::string  name,
const Eigen::MatrixXf &  M 
)
46{
47 if (*mlengine == 0)
48 mlinit(mlengine);
49
50 mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL);
51 double *pM = mxGetPr(A);
52
53 int c = 0;
54 for(int j=0; j<M.cols();++j)
55 for(int i=0; i<M.rows();++i)
56 pM[c++] = double(M(i,j));
57
58 engPutVariable(*mlengine, name.c_str(), A);
59 mxDestroyArray(A);
60}

References mlinit().

+ Here is the call graph for this function:

◆ mlsetmatrix() [3/5]

IGL_INLINE void igl::matlab::mlsetmatrix ( Engine **  engine,
std::string  name,
const Eigen::MatrixXi &  M 
)
64{
65 if (*mlengine == 0)
66 mlinit(mlengine);
67
68 mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL);
69 double *pM = mxGetPr(A);
70
71 int c = 0;
72 for(int j=0; j<M.cols();++j)
73 for(int i=0; i<M.rows();++i)
74 pM[c++] = double(M(i,j))+1;
75
76 engPutVariable(*mlengine, name.c_str(), A);
77 mxDestroyArray(A);
78}

References mlinit().

+ Here is the call graph for this function:

◆ mlsetmatrix() [4/5]

IGL_INLINE void igl::matlab::mlsetmatrix ( Engine **  mlengine,
std::string  name,
const Eigen::Matrix< unsigned int, Eigen::Dynamic, Eigen::Dynamic > &  M 
)
82{
83 if (*mlengine == 0)
84 mlinit(mlengine);
85
86 mxArray *A = mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL);
87 double *pM = mxGetPr(A);
88
89 int c = 0;
90 for(int j=0; j<M.cols();++j)
91 for(int i=0; i<M.rows();++i)
92 pM[c++] = double(M(i,j))+1;
93
94 engPutVariable(*mlengine, name.c_str(), A);
95 mxDestroyArray(A);
96}

References Eigen::PlainObjectBase< Derived >::cols(), mlinit(), and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ mlsetmatrix() [5/5]

IGL_INLINE void igl::matlab::mlsetmatrix ( Engine **  mlengine,
std::string  name,
const Eigen::SparseMatrix< double > &  M 
)
299{
300 int count = 0;
301// // Count non-zero
302// for (unsigned k=0; k<M.outerSize(); ++k)
303// for (Eigen::SparseMatrix<double>::InnerIterator it(M,k); it; ++it)
304// if (it.value() != 0)
305// ++count;
306
307 Eigen::MatrixXd T(M.nonZeros(),3);
308 for (unsigned k=0; k<(unsigned)M.outerSize(); ++k)
309 {
310 for (Eigen::SparseMatrix<double>::InnerIterator it(M,k); it; ++it)
311 {
312 T(count,0) = it.row();
313 T(count,1) = it.col();
314 T(count,2) = it.value();
315 ++count;
316 }
317 }
318
319 T.col(0) = T.col(0).array()+1;
320 T.col(1) = T.col(1).array()+1;
321
322 mlsetmatrix(mlengine,"temp93765",T);
323
324 std::string temp = name + " = sparse(temp93765(:,1),temp93765(:,2),temp93765(:,3),"
325 + std::to_string(M.rows()) + ","
326 + std::to_string(M.cols()) + ");";
327
328 mleval(mlengine,temp);
329 mleval(mlengine,"clear temp93765");
330}
Definition SparseCompressedBase.h:137
Index nonZeros() const
Definition SparseCompressedBase.h:56
Index outerSize() const
Definition SparseMatrix.h:143
Index rows() const
Definition SparseMatrix.h:136
Index cols() const
Definition SparseMatrix.h:138
IGL_INLINE void count(const Eigen::SparseMatrix< XType > &X, const int dim, Eigen::SparseVector< SType > &S)
Definition count.cpp:12

References Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::cols(), igl::count(), mleval(), mlsetmatrix(), Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::nonZeros(), Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::outerSize(), and Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::rows().

+ Here is the call graph for this function:

◆ mlsetscalar()

IGL_INLINE void igl::matlab::mlsetscalar ( Engine **  engine,
std::string  name,
double  s 
)
236{
237 if (*mlengine == 0)
238 mlinit(mlengine);
239
240 Eigen::MatrixXd M(1,1);
241 M(0,0) = s;
242 mlsetmatrix(mlengine, name, M);
243}
IGL_INLINE void mlsetmatrix(Engine **engine, std::string name, const Eigen::MatrixXd &M)
Definition matlabinterface.cpp:27

References mlinit(), and mlsetmatrix().

+ Here is the call graph for this function:

◆ parse_rhs()

template<typename VType >
IGL_INLINE void igl::matlab::parse_rhs ( const mxArray *  prhs[],
Eigen::SparseMatrix< VType > &  M 
)

◆ parse_rhs_double()

template<typename DerivedV >
IGL_INLINE void igl::matlab::parse_rhs_double ( const mxArray *  prhs[],
Eigen::PlainObjectBase< DerivedV > &  V 
)
15{
16 using namespace Eigen;
17 // Use Eigen's map and cast to copy
19 (mxGetPr(prhs[0]),mxGetM(prhs[0]),mxGetN(prhs[0]))
20 .cast<typename DerivedV::Scalar>();
21}
A matrix or vector expression mapping an existing array of data.
Definition Map.h:96
Definition LDLT.h:16

Referenced by parse_rhs_index().

+ Here is the caller graph for this function:

◆ parse_rhs_index()

template<typename DerivedV >
IGL_INLINE void igl::matlab::parse_rhs_index ( const mxArray *  prhs[],
Eigen::PlainObjectBase< DerivedV > &  V 
)
27{
28 parse_rhs_double(prhs,V);
29 V.array() -= 1;
30}
IGL_INLINE void parse_rhs_double(const mxArray *prhs[], Eigen::PlainObjectBase< DerivedV > &V)
Definition parse_rhs.cpp:12

References parse_rhs_double().

+ Here is the call graph for this function:

◆ prepare_lhs_double() [1/2]

template<typename DerivedV >
IGL_INLINE void igl::matlab::prepare_lhs_double ( const Eigen::PlainObjectBase< DerivedV > &  V,
mxArray *  plhs[] 
)
14{
15 using namespace std;
16 using namespace Eigen;
17 const int m = V.rows();
18 const int n = V.cols();
19 plhs[0] = mxCreateDoubleMatrix(m,n, mxREAL);
21 map(mxGetPr(plhs[0]),m,n);
22 map = V.template cast<double>();
23}
STL namespace.

References Eigen::PlainObjectBase< Derived >::cols(), and Eigen::PlainObjectBase< Derived >::rows().

Referenced by prepare_lhs_index().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepare_lhs_double() [2/2]

template<typename Vtype >
IGL_INLINE void igl::matlab::prepare_lhs_double ( const Eigen::SparseMatrix< Vtype > &  V,
mxArray *  plhs[] 
)
55{
56 using namespace std;
57 const int m = M.rows();
58 const int n = M.cols();
59 // THIS WILL NOT WORK FOR ROW-MAJOR
60 assert(n==M.outerSize());
61 const int nzmax = M.nonZeros();
62 plhs[0] = mxCreateSparse(m, n, nzmax, mxREAL);
63 mxArray * mx_data = plhs[0];
64 // Copy data immediately
65 double * pr = mxGetPr(mx_data);
66 mwIndex * ir = mxGetIr(mx_data);
67 mwIndex * jc = mxGetJc(mx_data);
68
69 // Iterate over outside
70 int k = 0;
71 for(int j=0; j<M.outerSize();j++)
72 {
73 jc[j] = k;
74 // Iterate over inside
75 for(typename Eigen::SparseMatrix<Vtype>::InnerIterator it (M,j); it; ++it)
76 {
77 // copy (cast to double)
78 pr[k] = it.value();
79 ir[k] = it.row();
80 k++;
81 }
82 }
83 jc[M.outerSize()] = k;
84
85}

References Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::cols(), Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::nonZeros(), Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::outerSize(), and Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >::rows().

+ Here is the call graph for this function:

◆ prepare_lhs_index()

template<typename DerivedV >
IGL_INLINE void igl::matlab::prepare_lhs_index ( const Eigen::PlainObjectBase< DerivedV > &  V,
mxArray *  plhs[] 
)
45{
46 // Treat indices as reals
47 const auto Vd = (V.template cast<double>().array()+1).eval();
48 return prepare_lhs_double(Vd,plhs);
49}
IGL_INLINE void prepare_lhs_double(const Eigen::PlainObjectBase< DerivedV > &V, mxArray *plhs[])
Definition prepare_lhs.cpp:11

References prepare_lhs_double().

+ Here is the call graph for this function:

◆ prepare_lhs_logical()

template<typename DerivedV >
IGL_INLINE void igl::matlab::prepare_lhs_logical ( const Eigen::PlainObjectBase< DerivedV > &  V,
mxArray *  plhs[] 
)
29{
30 using namespace std;
31 using namespace Eigen;
32 const int m = V.rows();
33 const int n = V.cols();
34 plhs[0] = mxCreateLogicalMatrix(m,n);
35 mxLogical * Vp = static_cast<mxLogical*>(mxGetData(plhs[0]));
37 map(static_cast<mxLogical*>(mxGetData(plhs[0])),m,n);
38 map = V.template cast<mxLogical>();
39}

References Eigen::PlainObjectBase< Derived >::cols(), and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ requires_arg()

IGL_INLINE void igl::matlab::requires_arg ( const int  i,
const int  nrhs,
const char *  name 
)
13{
14 mexErrMsgTxt((i+1)<nrhs,
15 C_STR("Parameter '"<<name<<"' requires argument"));
16}
#define C_STR(X)
Definition C_STR.h:17
IGL_INLINE void mexErrMsgTxt(bool test, const char *message)
Definition mexErrMsgTxt.cpp:10

References C_STR, and mexErrMsgTxt().

Referenced by validate_arg_char(), validate_arg_double(), validate_arg_function_handle(), validate_arg_logical(), and validate_arg_scalar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate_arg_char()

IGL_INLINE void igl::matlab::validate_arg_char ( const int  i,
const int  nrhs,
const mxArray *  prhs[],
const char *  name 
)
31{
32 requires_arg(i,nrhs,name);
33 mexErrMsgTxt(mxIsChar(prhs[i+1]),
34 C_STR("Parameter '"<<name<<"' requires char argument"));
35}
IGL_INLINE void requires_arg(const int i, const int nrhs, const char *name)
Definition requires_arg.cpp:12

References C_STR, mexErrMsgTxt(), and requires_arg().

+ Here is the call graph for this function:

◆ validate_arg_double()

IGL_INLINE void igl::matlab::validate_arg_double ( const int  i,
const int  nrhs,
const mxArray *  prhs[],
const char *  name 
)
39{
40 requires_arg(i,nrhs,name);
41 mexErrMsgTxt(mxIsDouble(prhs[i+1]),
42 C_STR("Parameter '"<<name<<"' requires double argument"));
43}

References C_STR, mexErrMsgTxt(), and requires_arg().

+ Here is the call graph for this function:

◆ validate_arg_function_handle()

IGL_INLINE void igl::matlab::validate_arg_function_handle ( const int  i,
const int  nrhs,
const mxArray *  prhs[],
const char *  name 
)
46{
47 requires_arg(i,nrhs,name);
48 mexErrMsgTxt(mxIsClass(prhs[i+1],"function_handle"),
49 C_STR("Parameter '"<<name<<"' requires function handle argument"));
50}

References C_STR, mexErrMsgTxt(), and requires_arg().

+ Here is the call graph for this function:

◆ validate_arg_logical()

IGL_INLINE void igl::matlab::validate_arg_logical ( const int  i,
const int  nrhs,
const mxArray *  prhs[],
const char *  name 
)
23{
24 requires_arg(i,nrhs,name);
25 mexErrMsgTxt(mxIsLogical(prhs[i+1]),
26 C_STR("Parameter '"<<name<<"' requires Logical argument"));
27}

References C_STR, mexErrMsgTxt(), and requires_arg().

+ Here is the call graph for this function:

◆ validate_arg_scalar()

IGL_INLINE void igl::matlab::validate_arg_scalar ( const int  i,
const int  nrhs,
const mxArray *  prhs[],
const char *  name 
)
15{
16 requires_arg(i,nrhs,name);
17 mexErrMsgTxt(mxGetN(prhs[i+1])==1 && mxGetM(prhs[i+1])==1,
18 C_STR("Parameter '"<<name<<"' requires scalar argument"));
19}

References C_STR, mexErrMsgTxt(), and requires_arg().

+ Here is the call graph for this function: