00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _mexargcheck_h_
00010 #define _mexargcheck_h_
00011
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016
00017 #define IsFullRealArray(pm) (mxIsDouble(pm) && \
00018 !mxIsComplex(pm) && \
00019 !mxIsSparse(pm))
00020 #define IsFullRealMatrix(pm) (IsFullRealArray(pm) && \
00021 (mxGetNumberOfDimensions(pm) <= 2))
00022 #define IsRealVector(pm) (IsFullRealMatrix(pm) && \
00023 (mxGetM(pm) == 1 || \
00024 mxGetN(pm) == 1))
00025
00026 #define IsRealLooseVector(pm) (IsFullRealMatrix(pm) && \
00027 (mxGetM(pm) <= 1 || \
00028 mxGetN(pm) <= 1))
00029 #define IsLooseVector(pm) (mxGetM(pm) <= 1 || \
00030 mxGetN(pm) <= 1)
00031 #define IsRealScalar(pm) (IsFullRealMatrix(pm) && \
00032 mxGetNumberOfElements(pm) == 1)
00033
00034 #define IsRealLooseScalar(pm) (IsFullRealMatrix(pm) && \
00035 mxGetNumberOfElements(pm) <= 1)
00036 #define IsLooseScalar(pm) (mxGetNumberOfElements(pm) <= 1)
00037 #define IsEmpty(pm) (mxGetNumberOfElements(pm) == 0)
00038
00039
00040
00041
00042
00043 int
00044 mexargparse(int narg,
00045 const mxArray **args,
00046 const char **names, const char **specs, const char **msgs, const char *gen_msg);
00047 int start_sizechecking();
00048 int sizeinit(const mxArray *pm);
00049 int sizecheck(const char *msg, int num);
00050 int sizecheck_msg(const char *msg, const char **argnames, int num);
00051 int sizeagree(const mxArray *pm);
00052 int sizeagreeM(const mxArray *pm);
00053 int sizeagreeN(const mxArray *pm);
00054 int sizeagreeMN(const mxArray *pm);
00055 int sizesare(int *s, int d);
00056 int sizeis(int m, int n);
00057 int sizeis3(int m, int n, int p);
00058 int sizeisM(int m);
00059 int sizeisN(int n);
00060 int sizeisMN(int m, int n);
00061
00062 #ifdef __cplusplus
00063 }
00064 #endif
00065
00066 #endif