Source file: /~heha/messtech/matdde.zip/source/header/dllmatrx.h

/*
 * @(#)dllmatrx.h    generated by: makeheader    Fri Mar 18 15:53:50 1994
 *
 *		built from:	matdll.c
 *				cmexmain.c
 */

#ifndef dllmatrx_h
#define dllmatrx_h

typedef double Real;


#if defined(__WATCOMC__)
// define a four byte integer for Watcom 32bit compiler
#define FOUR_BYTE_INT int
#define HUGE
#else
// define a four byte integer for 16bit compilers
#define FOUR_BYTE_INT long
#define HUGE huge
#endif 

/*
 * Enumerate matrix structures
 */
typedef FOUR_BYTE_INT mxMatrixStructure;
#define	mxFULL			0	/* full matrix */
#define	mxSPARSE		1	/* sparse matrix */
#define	mxCOLON			2	/* colon operator */
#define	mxGLOBAL		3	/* global (internal parse only) */
#define	mxUNASSIGNED	4	/* unassigned variable flag */
#define	mxCLEARMAT		5	/* cleared variable flag */
#define	mxUNASSARG		6	/* unassigned M-file arg */
#define	mxRHSUNASSIGNED	7	/* undefined symbol */
#define	mxASSIGNED		8	/* assigned variable flag */
#define	mxSPAM			9	/* spam format matrix */

/*
 * Enumerate matrix types
 */
typedef FOUR_BYTE_INT mxMatrixType;
#define	mxDOUBLE		0	/* double precision */
#define	mxFLOAT			1	/* single precision */
#define	mxLONGINT		2	/* 32 bit signed int */
#define	mxSHORTINT		3	/* 16 bit signed int */
#define	mxUSHORTINT		4	/* 16 bit unsigned int */
#define	mxUCHAR			5	/* 8 bit unsigned char/int */

/*
 * Enumerate display modes
 */
typedef FOUR_BYTE_INT mxDisplayMode;
#define	mxNUMBER 		0	/* Display as a number */
#define	mxSTRING 		1	/* Display as a string */

/*
 * The Matrix typedef
 */
#define mxMAXNAM	20	/* maximum name length */
#define mxMAXTAG	4	/* maximum tag length */
#define	mxMAXDIM	2	/* maximum array dimension */

struct matrix{
	char			name[mxMAXNAM];
	FOUR_BYTE_INT 	struc;
	FOUR_BYTE_INT 	type;
	FOUR_BYTE_INT 	dmode;
	char			tag[mxMAXTAG];
	FOUR_BYTE_INT	dim[mxMAXDIM];	/* array of dimensions */
	double  		HUGE *pr;		/* pointer to real part */
	double  		HUGE *pi;		/* pointer to imag part */
	FOUR_BYTE_INT	nzmax;			/* number of nonzero sparse entries */
	FOUR_BYTE_INT	HUGE *jc;		/* sparse indices */
	FOUR_BYTE_INT	HUGE *ir;		/* sparse indices */
};

typedef struct matrix	Matrix;



/* 
 * Get pointer to matrix name.
 */
extern	char  *mxGetName(
	const Matrix *pm					/* pointer to matrix */
	);


/* 
 * Set matrix name.  This routine copies the string pointed to by s
 * into the mxMAXNAM length character name field.
 */
extern	void  mxSetName(
	Matrix *pm,					/* pointer to matrix */
	const char *s				/* string to copy into name */
	);			


/* 
 * Get matrix structure
 */
extern	mxMatrixStructure mxGetStruc(	
	const Matrix *pm	/* pointer to matrix */
	);


/* 
 * Set matrix structure
 */
extern	void mxSetStruc(			
	Matrix *pm,			/* pointer to matrix */
	mxMatrixStructure k	/* matrix structure type */
	);


/* 
 * Get matrix type
 */
extern	mxMatrixType mxGetType(	
	const Matrix *pm	/* pointer to matrix */
	);


/* 
 * Set matrix type
 */
extern	void mxSetType(			
	Matrix *pm,			/* pointer to matrix */
	mxMatrixType k		/* matrix structure type */
	);


/* 
 * Get matrix display mode
 */
extern	mxDisplayMode mxGetDispMode(	
	const Matrix *pm	/* pointer to matrix */
	);


/* 
 * Set matrix display mode
 */
extern	void mxSetDispMode(		
	Matrix *pm,			/* pointer to matrix */
	mxDisplayMode k		/* display mode */
	);


/* 
 * Set matrix display mode to STRING
 */
extern	void mxSetString(
	Matrix *pm					/* pointer to matrix */
	);


/* 
 * Get pointer to matrix tag.
 */
extern	char *mxGetTag(
	const Matrix *pm					/* pointer to matrix */
	);

 
/* 
 * Set matrix tag.  This routine copies the string pointed to by s
 * into the mxMAXTAG character tag field.
 */
extern	void mxSetTag(
	Matrix *pm,					/* pointer to matrix */
	const char *s);					/* string to copy into tag */

 
/* 
 * Get row dimension
 */
extern	FOUR_BYTE_INT  mxGetM(
	const Matrix *pm					/* pointer to matrix */
	);	

 
/* 
 * Set row dimension
 */
extern	void  mxSetM(
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT m						/* row dimension */
	);

 
/* 
 * Get column dimension
 */
extern	FOUR_BYTE_INT  mxGetN(
	const Matrix *pm					/* pointer to matrix */
	);

 
/* 
 * Set column dimension
 */
extern	void  mxSetN(
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT n						/* column dimension */
	);

 
/* 
 * Get pointer to real part
 */
extern	double  *mxGetPr(
	const Matrix *pm					/* pointer to matrix */
	);

 
/* 
 * Set pointer to real part
 */
extern	void  mxSetPr(		
	Matrix *pm,					/* pointer to matrix */	
	double *pr					/* pointer to real part */
	);

 
/* 
 * Get pointer to imag part
 */
extern	double  *mxGetPi(
	const Matrix *pm					/* pointer to matrix */	
	);	

 
/* 
 * Set pointer to imag part
 */
extern	void  mxSetPi(		
	Matrix *pm,					/* pointer to matrix */
	double *pi					/* pointer to imag part */
	);


/* 
 * Get pointer to dimension array.
 */
extern	FOUR_BYTE_INT *mxGetDim(
	const Matrix *pm					/* pointer to matrix */
	);


/* 
 * Set dimension array.  This routine copies the array pointed
 * to by pdim into the mxMAXDIM length dimension field.
 */
extern	void mxSetDim(
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT *pdim					/* dimension array */
	);

 
/* 
 * Get number of nonzero elements of sparse matrix
 */
extern	FOUR_BYTE_INT  mxGetNzmax(		
	const Matrix *pm					/* pointer to matrix */
	);

 
/* 
 * Set number of nonzero elements of sparse matrix
 */
extern	void  mxSetNzmax(
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT nzmax					/* number of nonzero elements */
	);

 
/* 
 * Get pointer to sparse ir array
 */
extern	FOUR_BYTE_INT  *mxGetIr(
	const Matrix *pm					/* pointer to matrix */
	);	

 
/* 
 * Set pointer to sparse ir array
 */
extern	void  mxSetIr(		
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT *ir						/* pointer to ir array */
	);

 
/* 
 * Get pointer to sparse jc array
 */
extern	FOUR_BYTE_INT  *mxGetJc(	
	const Matrix *pm					/* pointer to matrix */
	);	

 
/*
 * Set pointer to sparse jc array 
 */
extern	void  mxSetJc(		
	Matrix *pm,					/* pointer to matrix */
	FOUR_BYTE_INT *jc						/* pointer to sparse jc array */
	);

 
/*
 * Indicate if there is a complex part to the matrix
 */
extern	int  mxIsComplex(
	const Matrix	*pm						/* pointer to matrix */
	);

 
/*
 * Indicate if matrix argument is of type real
 */
extern	int  mxIsDouble(
	const Matrix *pm					/* pointer to matrix */
	);

 
/*
 * Indicate if matrix argument is full
 */
extern	int  mxIsFull(
	const Matrix *pm					/* pointer to matrix */
	);

 
/*
 * Indicate if data is to be represented as a string
 */
extern	int mxIsNumeric(
	const Matrix	*pm						/* pointer to matrix */
	);

 
/*
 * Indicate if matrix argument is sparse
 */
extern	int  mxIsSparse(
	const Matrix *pm					/* pointer to matrix */
	);

 
/* 
 * Return 1 if matrix contains a string, 0 otherwise
 */
extern	int  mxIsString(
	const Matrix *pm					/* pointer to matrix */
	);

 
/*
 * Convert MATLAB string to C string
 */
extern	int  mxGetString(
	Matrix	*pm,					/* pointer to matrix */
	char 	*str_ptr,				/* pointer to string holding results */
	FOUR_BYTE_INT str_len			/* length of string that holds results */
	);

 
/*
 * Return first value of double matrix
 */
extern	double  mxGetScalar(
	Matrix	*pm
	);



#define REAL    0
#define COMPLEX 1
#define IMAG    1



extern	Matrix  *mxCreateFull(long m, long n, long imag_flag);


extern	void    mxFreeMatrix(Matrix     *pmat);


extern	void *mxCalloc(unsigned int n, unsigned int size);


extern	void    mxFree(void *p);


extern	Matrix  *mxCreateSparse(
	long    m,
	long    n,
	long    nzmax,
	long    cmplx
	);


extern	Matrix  *mxCreateString(char *str_ptr);


#endif /* dllmatrx_h */
Detected encoding: ASCII (7 bit)2