mex.h File Reference

#include "stack-c.h"
#include "sciprint.h"

Include dependency graph for mex.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  table_struct

Defines

#define mxLOGICAL   int
#define mxLogical   int
#define REAL   0
#define COMPLEX   1
#define NULL   0
#define mxCreateFull   mxCreateDoubleMatrix
#define bool   int
#define mexGetMatrixPtr(name)   mexGetArrayPtr(name, "caller")
#define mexGetArrayPtr(name, type)   mexGetArray(name,type)
#define mexPutFull(name, m, n, ptrM, tag)
#define INT8_T   char
#define UINT8_T   unsigned char
#define INT16_T   short
#define UINT16_T   unsigned short
#define INT32_T   int
#define UINT32_T   unsigned int
#define REAL32_T   float

Typedefs

typedef int Matrix
typedef unsigned long int vraiptrst
typedef int mxArray
typedef int GatefuncH __PARAMS ((int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]))
typedef int GatefuncS __PARAMS ((char *fname, int l))
typedef int Myinterfun __PARAMS ((char *, GatefuncH F))
typedef int(*) GT ()
typedef table_struct GenericTable
typedef unsigned short mxChar
typedef INT8_T int8_T
typedef UINT8_T uint8_T
typedef INT16_T int16_T
typedef UINT16_T uint16_T
typedef INT32_T int32_T
typedef UINT32_T uint32_T
typedef REAL32_T real32_T

Enumerations

enum  mxClassID {
  mxCELL_CLASS = 1, mxSTRUCT_CLASS, mxOBJECT_CLASS, mxCHAR_CLASS,
  mxSPARSE_CLASS, mxDOUBLE_CLASS, mxSINGLE_CLASS, mxINT8_CLASS,
  mxUINT8_CLASS, mxINT16_CLASS, mxUINT16_CLASS, mxINT32_CLASS,
  mxUINT32_CLASS, mxUNKNOWN_CLASS = 0
}
enum  mxComplexity { mxREAL, mxCOMPLEX }

Functions

void mexPrintf __PARAMS ((char *fmt,...))
void mexInfo __PARAMS ((char *))
int mexCheck __PARAMS ((char *, int))
mxArray *mxCreateCharMatrixFromStrings __PARAMS ((int m, const char **str))
mxArray *mxCreateString __PARAMS ((const char *string))
mxArrayC2F (mxcreatestring) __PARAMS((char *string
mxArrayC2F (mxcreatefull) __PARAMS((int *m
mxArray *mxCreateCharArray __PARAMS ((int ND, const int *size))
mxArray *mxCreateCellMatrix __PARAMS ((int m, int n))
mxArray *mxCreateStructArray __PARAMS ((int ndim, const int *dims, int nfields, const char **field_names))
mxArray *mxCreateStructMatrix __PARAMS ((int m, int n, int nfields, const char **field_names))
mxArray *mxGetCell __PARAMS ((const mxArray *ptr, int index))
double C2F (mxgetscalar) __PARAMS((mxArray *ptr))
double * C2F (mxgetpi) __PARAMS((mxArray *ptr))
double * C2F (mxgetpr) __PARAMS((mxArray *ptr))
double *mxGetPi __PARAMS ((const mxArray *ptr))
double mxGetInf __PARAMS ((void))
bool mxIsNaN __PARAMS ((double x))
int mxCalcSingleSubscript __PARAMS ((const mxArray *ptr, int nsubs, const int *subs))
void diary_nnl __PARAMS ((char *str, int *n))
int getdiary __PARAMS (())
void clear_mex (integer nlhs, mxArray **plhs, integer nrhs, mxArray **prhs)
int C2F (mxgetm) __PARAMS((mxArray *ptr))
int C2F (mxgetn) __PARAMS((mxArray *ptr))
int C2F (mxgetstring) __PARAMS((mxArray *ptr
int C2F (mxiscomplex) __PARAMS((mxArray *ptr))
int C2F (mxisfull) __PARAMS((mxArray *ptr))
int C2F (mxisnumeric) __PARAMS((mxArray *ptr))
int C2F (mxissparse) __PARAMS((mxArray *ptr))
int C2F (mxisstring) __PARAMS((mxArray *ptr))
int C2F (createptr) __PARAMS((char *type
int C2F (createstkptr) __PARAMS((integer *m
int C2F (endmex) __PARAMS((integer *nlhs
int C2F (initmex) __PARAMS((integer *nlhs
int C2F (mexcallscilab) __PARAMS((integer *nlhs
int C2F (mxcopyptrtoreal8) __PARAMS((mxArray *ptr
int C2F (mxcopyreal8toptr) __PARAMS((double *y
int fortran_mex_gateway __PARAMS ((char *fname, FGatefuncH F))
int mexAtExit __PARAMS ((mxArray *ptr))
int mexCallSCILAB __PARAMS ((int nlhs, mxArray **plhs, int nrhs, mxArray **prhs, const char *name))
int mex_gateway __PARAMS ((char *fname, GatefuncH F))
int mxGetString __PARAMS ((const mxArray *ptr, char *str, int strl))
char *mxArrayToString __PARAMS ((const mxArray *array_ptr))
bool mxIsClass __PARAMS ((const mxArray *ptr, const char *name))
void mxSetM __PARAMS ((mxArray *ptr, int m))
void mxSetN __PARAMS ((mxArray *ptr, int n))
void mxSetJc __PARAMS ((mxArray *array_ptr, int *jc_data))
void mxSetIr __PARAMS ((mxArray *array_ptr, int *ir_data))
void mxSetNzmax __PARAMS ((mxArray *array_ptr, int nzmax))
void mxSetCell __PARAMS ((mxArray *pa, int i, mxArray *value))
int sci_gateway __PARAMS ((char *fname, GatefuncS F))
mxArray *mexGetArray __PARAMS ((char *name, char *workspace))
mxArray *mexGetVariable __PARAMS ((const char *workspace, const char *name))
unsigned long int C2F (mxcalloc) __PARAMS((unsigned int *n
void C2F (mexprintf) __PARAMS((char *error_msg
void *mxCalloc __PARAMS ((size_t n, size_t size))
void *mxMalloc __PARAMS ((size_t nsize))
void *mxCalloc_m __PARAMS ((unsigned int n, unsigned int size))
void *mxMalloc_m __PARAMS ((unsigned int nsize))
void mxFree_m __PARAMS ((void *))
void C2F (mexerrmsgtxt) __PARAMS((char *error_msg
void C2F (mxfreematrix) __PARAMS((mxArray *ptr))
void mexErrMsgTxt __PARAMS ((char *error_msg))
int mexEvalString __PARAMS ((char *name))
void mxFree __PARAMS ((void *ptr))
int mxGetFieldNumber __PARAMS ((const mxArray *ptr, const char *string))
mxArray *mxGetField __PARAMS ((const mxArray *pa, int i, const char *fieldname))
void mxSetFieldByNumber __PARAMS ((mxArray *array_ptr, int index, int field_number, mxArray *value))
void mxSetField __PARAMS ((mxArray *pa, int i, const char *fieldname, mxArray *value))
mxArray *mxGetFieldByNumber __PARAMS ((const mxArray *ptr, int index, int field_number))
const char *mxGetFieldNameByNumber __PARAMS ((const mxArray *array_ptr, int field_number))
mxLOGICAL *mxGetLogicals __PARAMS ((mxArray *array_ptr))
vraiptrst C2F (locptr) __PARAMS((void *x))
void mxSetName __PARAMS ((mxArray *pa, const char *s))
void mxSetPr __PARAMS ((mxArray *array_ptr, double *pr))
void mxSetPi __PARAMS ((mxArray *array_ptr, double *pi))
void mxSetData __PARAMS ((mxArray *array_ptr, void *pr))
mxArray *mxCreateNumericArray __PARAMS ((int ndim, const int *dims, mxClassID classid, mxComplexity flag))
mxArray *mxCreateNumericMatrix __PARAMS ((int m, int n, mxClassID classid, int cmplx_flag))
int mxSetDimensions __PARAMS ((mxArray *array_ptr, const int *dims, int ndim))
mxArray *mxCreateDoubleMatrix __PARAMS ((int m, int n, mxComplexity it))
mxArray *mxCreateDoubleScalar __PARAMS ((double value))
mxArray *mxCreateSparse __PARAMS ((int m, int n, int nzmax, mxComplexity cmplx))

Variables

mxArray *long int l
mxArray *intn
mxArray *int intit
int char * str
int char intstrl
int intm
int int intn
int int int intit
int int int int intlr
int int int int int intptr
int int int int int int long
int 
type_len
int vraiptrstptr
int mxArray ** plhs
int mxArray integernrhs
int mxArray integer mxArray ** prhs
int mxArray ** plhs
int mxArray integernrhs
int mxArray integer mxArray ** prhs
int mxArray ** plhs
int mxArray integernrhs
int mxArray integer mxArray ** prhs
int mxArray integer mxArray
char * 
name
int mxArray integer mxArray
char int 
namelen
int double * y
int double integern
int mxArrayptr
int mxArray integern
unsigned long int unsigned
int
size
void int len
void int len


Define Documentation

#define bool   int

Definition at line 54 of file mex.h.

#define COMPLEX   1

Definition at line 47 of file mex.h.

#define INT16_T   short

Definition at line 302 of file mex.h.

#define INT32_T   int

Definition at line 304 of file mex.h.

#define INT8_T   char

Definition at line 300 of file mex.h.

#define mexGetArrayPtr ( name,
type   )     mexGetArray(name,type)

XXXX A finir

Definition at line 58 of file mex.h.

#define mexGetMatrixPtr ( name   )     mexGetArrayPtr(name, "caller")

Definition at line 56 of file mex.h.

#define mexPutFull ( name,
m,
n,
ptrM,
tag   ) 

Value:

if ( ! C2F(cwritemat)(name,(c_local=m,&c_local),(c1_local=n,&c1_local),ptrM,strlen(name))) {    \
      mexErrMsgTxt("mexPutFull failed\r\n");return; }
Put a matrix in Scilab Workspace

Definition at line 68 of file mex.h.

#define mxCreateFull   mxCreateDoubleMatrix

Definition at line 53 of file mex.h.

#define mxLogical   int

Definition at line 44 of file mex.h.

#define mxLOGICAL   int

Definition at line 43 of file mex.h.

Referenced by mxGetLogicals().

#define NULL   0

Definition at line 50 of file mex.h.

#define REAL   0

Definition at line 46 of file mex.h.

#define REAL32_T   float

Definition at line 306 of file mex.h.

#define UINT16_T   unsigned short

Definition at line 303 of file mex.h.

#define UINT32_T   unsigned int

Definition at line 305 of file mex.h.

#define UINT8_T   unsigned char

Definition at line 301 of file mex.h.


Typedef Documentation

typedef int Myinterfun __PARAMS((char *, GatefuncH F))

Definition at line 33 of file mex.h.

typedef int GatefuncS __PARAMS((char *fname, int l))

Definition at line 32 of file mex.h.

typedef int Gatefunc __PARAMS((int nlhs, mxArray *plhs[], int nrhs,mxArray *prhs[]))

Definition at line 24 of file mex.h.

typedef struct table_struct GenericTable

typedef int(*) GT()

Definition at line 35 of file mex.h.

typedef INT16_T int16_T

Definition at line 311 of file mex.h.

typedef INT32_T int32_T

Definition at line 313 of file mex.h.

typedef INT8_T int8_T

Definition at line 309 of file mex.h.

typedef int Matrix

Definition at line 20 of file mex.h.

typedef int mxArray

Definition at line 22 of file mex.h.

typedef unsigned short mxChar

Definition at line 298 of file mex.h.

typedef REAL32_T real32_T

Definition at line 315 of file mex.h.

typedef UINT16_T uint16_T

Definition at line 312 of file mex.h.

typedef UINT32_T uint32_T

Definition at line 314 of file mex.h.

typedef UINT8_T uint8_T

Definition at line 310 of file mex.h.

typedef unsigned long int vraiptrst

Definition at line 21 of file mex.h.


Enumeration Type Documentation

enum mxClassID

Enumerator:
mxCELL_CLASS 
mxSTRUCT_CLASS 
mxOBJECT_CLASS 
mxCHAR_CLASS 
mxSPARSE_CLASS 
mxDOUBLE_CLASS 
mxSINGLE_CLASS 
mxINT8_CLASS 
mxUINT8_CLASS 
mxINT16_CLASS 
mxUINT16_CLASS 
mxINT32_CLASS 
mxUINT32_CLASS 
mxUNKNOWN_CLASS 

Definition at line 260 of file mex.h.

00260              {
00261         mxCELL_CLASS = 1,
00262         mxSTRUCT_CLASS,
00263         mxOBJECT_CLASS,
00264         mxCHAR_CLASS,
00265         mxSPARSE_CLASS,
00266         mxDOUBLE_CLASS,
00267         mxSINGLE_CLASS,
00268         mxINT8_CLASS,
00269         mxUINT8_CLASS,
00270         mxINT16_CLASS,
00271         mxUINT16_CLASS,
00272         mxINT32_CLASS,
00273         mxUINT32_CLASS,
00274         mxUNKNOWN_CLASS = 0
00275 } mxClassID;

enum mxComplexity

Enumerator:
mxREAL 
mxCOMPLEX 

Definition at line 277 of file mex.h.


Function Documentation

mxArray* mxCreateSparse __PARAMS ( (int m, int n, int nzmax, mxComplexity cmplx)   ) 

mxArray* mxCreateDoubleScalar __PARAMS ( (double value  ) 

mxArray* mxCreateDoubleMatrix __PARAMS ( (int m, int n, mxComplexity it  ) 

Definition at line 924 of file mexlib.c.

References C2F, createcvar(), L, lc, lr, lstk, mexErrMsgTxt(), Nbvars, Rhs, stk, and Top.

00925 {
00926   static int lw, lr, lc;
00927   int k;
00928   lw = Nbvars + 1;
00929   if (! C2F(createcvar)(&lw, "d", (int *) &it, &m, &n, &lr, &lc, 1L)) {
00930     mexErrMsgTxt("No more memory available: increase stacksize");
00931   }
00932   for ( k=0; k<m*n*(it+1); k++ ) {
00933    *stk(lr+k)=0;
00934   }
00935    return (mxArray *) C2F(vstk).lstk[lw + Top - Rhs - 1];  /* C2F(intersci).iwhere[lw-1]);  */
00936 }

Here is the call graph for this function:

int mxSetDimensions __PARAMS ( (mxArray *array_ptr, const int *dims, int ndim  ) 

mxArray* mxCreateNumericMatrix __PARAMS ( (int m, int n, mxClassID classid, int cmplx_flag)   ) 

mxArray* mxCreateNumericArray __PARAMS ( (int ndim, const int *dims, mxClassID classid, mxComplexity flag  ) 

void mxSetData __PARAMS ( (mxArray *array_ptr, void *pr  ) 

void mxSetPi __PARAMS ( (mxArray *array_ptr, double *pi  ) 

void mxSetPr __PARAMS ( (mxArray *array_ptr, double *pr  ) 

void mxSetName __PARAMS ( (mxArray *pa, const char *s  ) 

mxLOGICAL* mxGetLogicals __PARAMS ( (mxArray *array_ptr)   ) 

const char* mxGetFieldNameByNumber __PARAMS ( (const mxArray *array_ptr, int field_number)   ) 

mxArray* mxGetFieldByNumber __PARAMS ( (const mxArray *ptr, int index, int field_number)   ) 

void mxSetField __PARAMS ( (mxArray *pa, int i, const char *fieldname, mxArray *value  ) 

void mxSetFieldByNumber __PARAMS ( (mxArray *array_ptr, int index, int field_number, mxArray *value  ) 

mxArray* mxGetField __PARAMS ( (const mxArray *pa, int i, const char *fieldname)   ) 

int mxGetFieldNumber __PARAMS ( (const mxArray *ptr, const char *string  ) 

void mxFree __PARAMS ( (void *ptr  ) 

int mexEvalString __PARAMS ( (char *name  ) 

void mexErrMsgTxt __PARAMS ( (char *error_msg)   ) 

void mxFree_m __PARAMS ( (void *)   ) 

void* mxMalloc_m __PARAMS ( (unsigned int nsize)   ) 

void* mxCalloc_m __PARAMS ( (unsigned int n, unsigned int size  ) 

void* mxMalloc __PARAMS ( (size_t nsize)   ) 

void* mxCalloc __PARAMS ( (size_t n, size_t size  ) 

mxArray* mexGetVariable __PARAMS ( (const char *workspace, const char *name  ) 

mxArray* mexGetArray __PARAMS ( (char *name, char *workspace)   ) 

int sci_gateway __PARAMS ( (char *fname, GatefuncS F  ) 

void mxSetCell __PARAMS ( (mxArray *pa, int i, mxArray *value  ) 

void mxSetNzmax __PARAMS ( (mxArray *array_ptr, int nzmax  ) 

void mxSetIr __PARAMS ( (mxArray *array_ptr, int *ir_data)   ) 

void mxSetJc __PARAMS ( (mxArray *array_ptr, int *jc_data)   ) 

void mxSetN __PARAMS ( (mxArray *ptr, int n  ) 

void mxSetM __PARAMS ( (mxArray *ptr, int m  ) 

bool mxIsClass __PARAMS ( (const mxArray *ptr, const char *name  ) 

char* mxArrayToString __PARAMS ( (const mxArray *array_ptr)   ) 

int mxGetString __PARAMS ( (const mxArray *ptr, char *str, int strl  ) 

int mex_gateway __PARAMS ( (char *fname, GatefuncH F  ) 

int mexCallSCILAB __PARAMS ( (int nlhs, mxArray **plhs, int nrhs, mxArray **prhs, const char *name  ) 

int mexAtExit __PARAMS ( (mxArray *ptr  ) 

int fortran_mex_gateway __PARAMS ( (char *fname, FGatefuncH F  ) 

int getdiary __PARAMS ( ()   ) 

void diary_nnl __PARAMS ( (char *str, int *n  ) 

int mxCalcSingleSubscript __PARAMS ( (const mxArray *ptr, int nsubs, const int *subs)   ) 

bool mxIsNaN __PARAMS ( (double x  ) 

double mxGetInf __PARAMS ( (void)   ) 

double* mxGetPi __PARAMS ( (const mxArray *ptr  ) 

mxArray* mxGetCell __PARAMS ( (const mxArray *ptr, int index  ) 

mxArray* mxCreateStructMatrix __PARAMS ( (int m, int n, int nfields, const char **field_names)   ) 

mxArray* mxCreateStructArray __PARAMS ( (int ndim, const int *dims, int nfields, const char **field_names)   ) 

mxArray* mxCreateCellMatrix __PARAMS ( (int m, int n  ) 

mxArray* mxCreateCharArray __PARAMS ( (int ND, const int *size  ) 

mxArray* mxCreateString __PARAMS ( (const char *string  ) 

mxArray* mxCreateCharMatrixFromStrings __PARAMS ( (int m, const char **str  ) 

int mexCheck __PARAMS ( (char *, int  ) 

void mexInfo __PARAMS ( (char *)   ) 

void mexPrintf __PARAMS ( (char *fmt,...)   ) 

vraiptrst C2F ( locptr   ) 

TODO : comment

Parameters:
x 
Returns:

void C2F ( mxfreematrix   ) 

void C2F ( mexerrmsgtxt   ) 

void C2F ( mexprintf   ) 

unsigned long int C2F ( mxcalloc   ) 

int C2F ( mxcopyreal8toptr   ) 

int C2F ( mxcopyptrtoreal8   ) 

int C2F ( mexcallscilab   ) 

int C2F ( initmex   ) 

TODO : comment

Parameters:
nlhs 
plhs 
nrhs 
prhs 
Returns:

int C2F ( endmex   ) 

TODO : comment

Parameters:
nlhs 
plhs 
nrhs 
prhs 
Returns:

int C2F ( createstkptr   ) 

TODO : comment

Parameters:
m 
ptr 
Returns:

int C2F ( createptr   ) 

TODO : comment

Parameters:
type 
m 
n 
it 
lr 
ptr 
type_len 
Returns:

int C2F ( mxisstring   ) 

int C2F ( mxissparse   ) 

int C2F ( mxisnumeric   ) 

int C2F ( mxisfull   ) 

int C2F ( mxiscomplex   ) 

int C2F ( mxgetstring   ) 

int C2F ( mxgetn   ) 

int C2F ( mxgetm   ) 

double* C2F ( mxgetpr   ) 

double* C2F ( mxgetpi   ) 

double C2F ( mxgetscalar   ) 

mxArray* C2F ( mxcreatefull   ) 

mxArray* C2F ( mxcreatestring   ) 

void clear_mex ( integer  nlhs,
mxArray **  plhs,
integer  nrhs,
mxArray **  prhs 
)

Definition at line 2610 of file mexlib.c.

References C2F, lstk, max, Nbvars, nv, Rhs, and Top.

02611 {
02612   int nv=Nbvars ,k; 
02613   int max = (int) plhs[0] ; 
02614   for (k = 1; k <= nlhs; k++)
02615     if (  (int)plhs[k-1] > max ) max =  (int)plhs[k-1];
02616   for (k = 1; k <= nrhs; k++)
02617     if ( (int)  prhs[k-1] > max ) max =  (int) prhs[k-1];
02618   for (k = 1; k <= nv; k++)
02619     if ( max <  C2F(vstk).lstk[k + Top - Rhs -1]) Nbvars--;
02620 }


Variable Documentation

int int int int* it

Definition at line 139 of file mex.h.

mxArray* int int* it

Definition at line 79 of file mex.h.

mxArray* long int l

Definition at line 78 of file mex.h.

void int len

Definition at line 233 of file mex.h.

void int len

Definition at line 224 of file mex.h.

int int int int int* lr

Definition at line 139 of file mex.h.

int int* m

Definition at line 139 of file mex.h.

int mxArray integer* n

Definition at line 173 of file mex.h.

int double integer* n

Definition at line 172 of file mex.h.

int int int* n

Definition at line 139 of file mex.h.

mxArray* int* n

Definition at line 79 of file mex.h.

int mxArray integer mxArray char* name

Definition at line 171 of file mex.h.

int mxArray integer mxArray char int namelen

Definition at line 171 of file mex.h.

Referenced by XmuWnInitializeNodes().

int mxArray integer* nrhs

Definition at line 171 of file mex.h.

int mxArray integer* nrhs

Definition at line 169 of file mex.h.

int mxArray integer* nrhs

Definition at line 158 of file mex.h.

Referenced by GetFuncPtr().

int mxArray** plhs

Definition at line 171 of file mex.h.

int mxArray** plhs

Definition at line 169 of file mex.h.

int mxArray** plhs

Definition at line 158 of file mex.h.

int mxArray integer mxArray** prhs

Definition at line 171 of file mex.h.

int mxArray integer mxArray** prhs

Definition at line 169 of file mex.h.

int mxArray integer mxArray** prhs

Definition at line 158 of file mex.h.

int mxArray* ptr

Definition at line 173 of file mex.h.

int vraiptrst* ptr

Definition at line 147 of file mex.h.

int int int int int int* ptr

Definition at line 139 of file mex.h.

unsigned long int unsigned int* size

Definition at line 222 of file mex.h.

int char* str

Definition at line 119 of file mex.h.

int char int* strl

Definition at line 119 of file mex.h.

Referenced by ext7c(), intex15c(), intex16c(), Matrix2String(), mexFunction(), and mxgetstring().

int int int int int int long int type_len

Definition at line 139 of file mex.h.

int double* y

Definition at line 172 of file mex.h.


Generated on Sun Mar 4 16:10:31 2007 for Scilab [trunk] by  doxygen 1.5.1