home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#)matrix.h generated by: makeheader Fri Feb 12 12:06:46 1993
- *
- * built from: /rel/bld/matlab4/sun4/prod/sandbox4/src/include/mathwork.h
- * /rel/bld/matlab4/sun4/prod/sandbox4/src/cmex/cmxcbk.c
- */
-
- #ifndef matrix_h
- #define matrix_h
-
- typedef double Real;
-
-
- #ifdef OLDSTYLE
- /*
- * modified matrix definition for compatibility with pre v4 mex files
- */
-
- #ifdef THINK_C
- #define dummy unsigned char dummy1,dummy2,type,dummy3; int dummy4
- #else
- #ifdef applec
- #define dummy unsigned char dummy1,dummy2,type,dummy3; int dummy4
- #else
- #define dummy int dummy1,dummy2,type,dummy3
- #endif /* applec */
- #endif /* THINK_C */
-
- #define mxMAXNAM 20
- typedef struct matrix {
- char name[mxMAXNAM]; /* name is now an array */
- dummy; /* type: 0 - matrix, 1 - string */
- int m; /* row dimension */
- int n; /* column dimension */
- Real *pr; /* pointer to real part */
- Real *pi; /* pointer to imag part */
- int dummy6,dummy7,dummy8;
- } Matrix;
-
- #define TEXT 1 /* mat.type indicating text */
- #define MATRIX 0 /* mat.type indicating matrix */
- #define REAL 0
- #define COMPLEX 1
-
- #else
- /*
- * post v4 mex files use an incomplete matrix structure and access methods
- */
- #ifdef __STDC__
- /*
- * incomplete definition of Matrix
- */
- typedef struct matrix Matrix;
- #else
- #ifdef VMS
- typedef struct matrix Matrix;
- #else
- #ifdef MMACINTOSH
- typedef struct matrix Matrix;
- #else
- typedef char Matrix;
- #endif /* MMACINTOSH */
- #endif /* VMS */
- #endif /* __STDC__ */
-
- #define REAL (0)
- #define COMPLEX (1)
- #endif /* OLD_STYLE */
-
-
-
- #ifdef VMS
- #define sp2spam Csp2spam
- #define spam2sp Cspam2sp
- #define malloc VAXCmalloc
- #define calloc VAXCcalloc
- #define realloc VAXCrealloc
- #define free VAXCfree
- #define mxCreateFull CmxCreateFull
- #define mxFreeMatrix CmxFreeMatrix
- #define mxCalloc CmxCalloc
- #define mxFree CmxFree
- #define mxGetName CmxGetName
- #define mxSetName CmxSetName
- #define mxGetStruc CmxGetStruc
- #define mxSetStruc CmxSetStruc
- #define mxGetType CmxGetType
- #define mxSetType CmxSetType
- #define mxGetDispMode CmxGetDispMode
- #define mxSetDispMode CmxSetDispMode
- #define mxGetM CmxGetM
- #define mxSetM CmxSetM
- #define mxGetN CmxGetN
- #define mxSetN CmxSetN
- #define mxGetPr CmxGetPr
- #define mxSetPr CmxSetPr
- #define mxGetPi CmxGetPi
- #define mxSetPi CmxSetPi
- #define mxGetNzmax CmxGetNzmax
- #define mxSetNzmax CmxSetNzmax
- #define mxGetIr CmxGetIr
- #define mxSetIr CmxSetIr
- #define mxGetJc CmxGetJc
- #define mxSetJc CmxSetJc
- #define mxGetString CmxGetString
- #define mxCreateString CmxCreateString
- #define mxGetScalar CmxGetScalar
- #define mxIsFull CmxIsFull
- #define mxIsSparse CmxIsSparse
- #define mxIsDouble CmxIsDouble
- #define mxIsString CmxIsString
- #define mxIsNumeric CmxIsNumeric
- #define mxIsComplex CmxIsComplex
- #define mxCreateSparse CmxCreateSparse
- #define mxCreateNDArray CmxCreateNDArray
- #define mxSetTag CmxSetTag
- #define mxGetTag CmxGetTag
- #define mxGetDim CmxGetDim
- #define mxSetDim CmxSetDim
- #define mxIsNDArray CmxIsNDArray
- #define mxGetDimNum CmxGetDimNum
- #define mxIsSpam CmxIsSpam
- #define mxGetNumEl CmxGetNumEl
- #define mxSizeofMatrix CmxSizeofMatrix
- #define mxRemoveFromAllocList CmxRemoveFromAllocList
- #define mxIsFlint CmxIsFlint
- #endif /* VMS */
-
-
- /*
- * create matrix
- */
- #ifdef __STDC__
- extern Matrix *mxCreateFull(
- int m, /* number of rows in matrix */
- int n, /* number of columns */
- int cmplx_flg /* complex flag */
- );
- #else
- extern Matrix *mxCreateFull();
- #endif /* __STDC__ */
-
-
- /*
- * free matrix structure and its contents
- */
- #ifdef __STDC__
- extern void mxFreeMatrix(
- Matrix *pmat /* pointer to matrix */
- );
- #else
- extern mxFreeMatrix();
- #endif /* __STDC__ */
-
-
- /*
- * allocate memory on MATLAB's heap
- */
- #ifdef __STDC__
- extern void *mxCalloc(
- unsigned n, /* number of elements */
- unsigned size /* size of elements */
- );
- #else
- extern void *mxCalloc();
- #endif /* __STDC__ */
-
-
- /*
- * return allocated memory to MATLAB's heap
- */
- #ifdef __STDC__
- extern void mxFree(
- void *ptr /* pointer to allocated memory */
- );
- #else
- extern mxFree();
- #endif /* __STDC__ */
-
-
- /*
- * Get pointer to matrix name.
- */
- #ifdef __STDC__
- extern char *mxGetName(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern char *mxGetName();
- #endif /* __STDC__ */
-
-
- /*
- * Set matrix name. This routine copies the string pointed to by s
- * into the mxMAXNAM length character name field.
- */
- #ifdef __STDC__
- extern void mxSetName(
- Matrix *pm, /* pointer to matrix */
- const char *s /* string to copy into name */
- );
- #else
- extern mxSetName();
- #endif /* __STDC__ */
-
-
- /*
- * Get row dimension
- */
- #ifdef __STDC__
- extern int mxGetM(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxGetM();
- #endif /* __STDC__ */
-
-
- /*
- * Set row dimension
- */
- #ifdef __STDC__
- extern void mxSetM(
- Matrix *pm, /* pointer to matrix */
- int m /* row dimension */
- );
- #else
- extern mxSetM();
- #endif /* __STDC__ */
-
-
- /*
- * Get column dimension
- */
- #ifdef __STDC__
- extern int mxGetN(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxGetN();
- #endif /* __STDC__ */
-
-
- /*
- * Set column dimension
- */
- #ifdef __STDC__
- extern void mxSetN(
- Matrix *pm, /* pointer to matrix */
- int n /* column dimension */
- );
- #else
- extern mxSetN();
- #endif /* __STDC__ */
-
-
- /*
- * Get pointer to real part
- */
- #ifdef __STDC__
- extern Real *mxGetPr(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern Real *mxGetPr();
- #endif /* __STDC__ */
-
-
- /*
- * Set pointer to real part
- */
- #ifdef __STDC__
- extern void mxSetPr(
- Matrix *pm, /* pointer to matrix */
- Real *pr /* pointer to real part */
- );
- #else
- extern mxSetPr();
- #endif /* __STDC__ */
-
-
- /*
- * Get pointer to imag part
- */
- #ifdef __STDC__
- extern Real *mxGetPi(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern Real *mxGetPi();
- #endif /* __STDC__ */
-
-
- /*
- * Set pointer to imag part
- */
- #ifdef __STDC__
- extern void mxSetPi(
- Matrix *pm, /* pointer to matrix */
- Real *pi /* pointer to imag part */
- );
- #else
- extern mxSetPi();
- #endif /* __STDC__ */
-
-
- /*
- * Get number of nonzero elements of sparse matrix
- */
- #ifdef __STDC__
- extern int mxGetNzmax(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxGetNzmax();
- #endif /* __STDC__ */
-
-
- /*
- * Set number of nonzero elements of sparse matrix
- */
- #ifdef __STDC__
- extern void mxSetNzmax(
- Matrix *pm, /* pointer to matrix */
- int nzmax /* number of nonzero elements */
- );
- #else
- extern mxSetNzmax();
- #endif /* __STDC__ */
-
-
- /*
- * Get pointer to sparse ir array
- */
- #ifdef __STDC__
- extern int *mxGetIr(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int *mxGetIr();
- #endif /* __STDC__ */
-
-
- /*
- * Set pointer to sparse ir array
- */
- #ifdef __STDC__
- extern void mxSetIr(
- Matrix *pm, /* pointer to matrix */
- int *ir /* pointer to ir array */
- );
- #else
- extern mxSetIr();
- #endif /* __STDC__ */
-
-
- /*
- * Get pointer to sparse jc array
- */
- #ifdef __STDC__
- extern int *mxGetJc(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int *mxGetJc();
- #endif /* __STDC__ */
-
-
- /*
- * Set pointer to sparse jc array
- */
- #ifdef __STDC__
- extern void mxSetJc(
- Matrix *pm, /* pointer to matrix */
- int *jc /* pointer to sparse jc array */
- );
- #else
- extern mxSetJc();
- #endif /* __STDC__ */
-
-
- /*
- * Convert MATLAB string to C string
- */
- #ifdef __STDC__
- extern int mxGetString(
- const Matrix *pm, /* pointer to matrix */
- char *str_ptr, /* pointer to string holding results */
- int str_len /* length of string that holds results */
- );
- #else
- extern int mxGetString();
- #endif /* __STDC__ */
-
-
- /*
- * Put C string into MATLAB matrix
- */
- #ifdef __STDC__
- extern Matrix *mxCreateString(
- const char *str_ptr /* input C string */
- );
- #else
- extern Matrix *mxCreateString();
- #endif /* __STDC__ */
-
-
- /*
- * Return first number in matrix input (assumed to be real)
- */
- #ifdef __STDC__
- extern Real mxGetScalar(
- Matrix *pm /* pointer to matrix */
- );
- #else
- extern Real mxGetScalar();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix struc set to FULL
- */
- #ifdef __STDC__
- extern int mxIsFull(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsFull();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix struc set to SPARSE
- */
- #ifdef __STDC__
- extern int mxIsSparse(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsSparse();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix type DOUBLE
- */
- #ifdef __STDC__
- extern int mxIsDouble(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsDouble();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix display mode STRING
- */
- #ifdef __STDC__
- extern int mxIsString(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsString();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix display mode NUMBER
- */
- #ifdef __STDC__
- extern int mxIsNumeric(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsNumeric();
- #endif /* __STDC__ */
-
-
- /*
- * Is matrix of type double and does is have a complex part
- */
- #ifdef __STDC__
- extern int mxIsComplex(
- const Matrix *pm /* pointer to matrix */
- );
- #else
- extern int mxIsComplex();
- #endif /* __STDC__ */
-
-
- /*
- * Create a sparse matrix
- */
- #ifdef __STDC__
- extern Matrix *mxCreateSparse(
- int m, /* number of rows */
- int n, /* number of columns */
- int nzmax, /* initial number of non-zeros elements */
- int cmplx_flg /* complex data */
- );
- #else
- extern Matrix *mxCreateSparse();
- #endif /* __STDC__ */
-
- #endif /* matrix_h */
-