home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / INCLUDE.DI$ / DLLMATRX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-18  |  5.1 KB  |  272 lines

  1. /*
  2.  * @(#)matrix16.h    generated by: makeheader    Thu Mar 18 19:30:36 1993
  3.  *
  4.  *        built from:    matdll.c
  5.  */
  6.  
  7. #ifndef matrix16_h
  8. #define matrix16_h
  9.  
  10.  
  11. /*
  12.  * Enumerate matrix structures
  13.  */
  14. typedef long mxMatrixStructures;
  15. #define    mxFULL            0    /* full matrix */
  16. #define    mxSPARSE        1    /* sparse matrix */
  17. #define    mxCOLON            2    /* colon operator */
  18. #define    mxGLOBAL        3    /* global (internal parse only) */
  19. #define    mxUNASSIGNED    4    /* unassigned variable flag */
  20. #define    mxCLEARMAT        5    /* cleared variable flag */
  21. #define    mxUNASSARG        6    /* unassigned M-file arg */
  22. #define    mxRHSUNASSIGNED    7    /* undefined symbol */
  23. #define    mxASSIGNED        8    /* assigned variable flag */
  24. #define    mxSPAM            9    /* spam format matrix */
  25.  
  26. /*
  27.  * Enumerate matrix types
  28.  */
  29. typedef long mxMatrixTypes;
  30. #define    mxDOUBLE        0    /* double precision */
  31. #define    mxFLOAT            1    /* single precision */
  32. #define    mxLONGINT        2    /* 32 bit signed int */
  33. #define    mxSHORTINT        3    /* 16 bit signed int */
  34. #define    mxUSHORTINT        4    /* 16 bit unsigned int */
  35. #define    mxUCHAR            5    /* 8 bit unsigned char/int */
  36.  
  37. /*
  38.  * Enumerate display modes
  39.  */
  40. typedef long mxDisplayModes;
  41. #define    mxNUMBER         0    /* Display as a number */
  42. #define    mxSTRING         1    /* Display as a string */
  43.  
  44. /*
  45.  * The Matrix typedef
  46.  */
  47. #define mxMAXNAM    20    /* maximum name length */
  48. #define mxMAXTAG    4    /* maximum tag length */
  49. #define    mxMAXDIM    2    /* maximum array dimension */
  50.  
  51. struct matrix{
  52.     char    name[mxMAXNAM];
  53.     long     struc;
  54.     long     type;
  55.     long     dmode;
  56.     char    tag[mxMAXTAG];
  57.     long    dim[mxMAXDIM];    /* array of dimensions */
  58.     double  huge *pr;        /* pointer to real part */
  59.     double  huge *pi;        /* pointer to imag part */
  60.     long    nzmax;            /* number of nonzero sparse entries */
  61.     long    huge *jc;        /* sparse indices */
  62.     long    huge *ir;        /* sparse indices */
  63. };
  64.  
  65. typedef struct matrix    Matrix;
  66.  
  67.  
  68.  
  69. /* 
  70.  * Get pointer to matrix name.
  71.  */
  72. extern    char  *mxGetName(
  73.     const Matrix *pm                    /* pointer to matrix */
  74.     );
  75.  
  76.  
  77. /* 
  78.  * Set matrix name.  This routine copies the string pointed to by s
  79.  * into the mxMAXNAM length character name field.
  80.  */
  81. extern    void  mxSetName(
  82.     Matrix *pm,                    /* pointer to matrix */
  83.     const char *s                /* string to copy into name */
  84.     );            
  85.  
  86.  
  87. /* 
  88.  * Get row dimension
  89.  */
  90. extern    long  mxGetM(
  91.     const Matrix *pm                    /* pointer to matrix */
  92.     );    
  93.  
  94.  
  95. /* 
  96.  * Set row dimension
  97.  */
  98. extern    void  mxSetM(
  99.     Matrix *pm,                    /* pointer to matrix */
  100.     long m                        /* row dimension */
  101.     );
  102.  
  103.  
  104. /* 
  105.  * Get column dimension
  106.  */
  107. extern    long  mxGetN(
  108.     const Matrix *pm                    /* pointer to matrix */
  109.     );
  110.  
  111.  
  112. /* 
  113.  * Set column dimension
  114.  */
  115. extern    void  mxSetN(
  116.     Matrix *pm,                    /* pointer to matrix */
  117.     long n                        /* column dimension */
  118.     );
  119.  
  120.  
  121. /* 
  122.  * Get pointer to real part
  123.  */
  124. extern    double  *mxGetPr(
  125.     const Matrix *pm                    /* pointer to matrix */
  126.     );
  127.  
  128.  
  129. /* 
  130.  * Set pointer to real part
  131.  */
  132. extern    void  mxSetPr(        
  133.     Matrix *pm,                    /* pointer to matrix */    
  134.     double *pr                    /* pointer to real part */
  135.     );
  136.  
  137.  
  138. /* 
  139.  * Get pointer to imag part
  140.  */
  141. extern    double  *mxGetPi(
  142.     const Matrix *pm                    /* pointer to matrix */    
  143.     );    
  144.  
  145.  
  146. /* 
  147.  * Set pointer to imag part
  148.  */
  149. extern    void  mxSetPi(        
  150.     Matrix *pm,                    /* pointer to matrix */
  151.     double *pi                    /* pointer to imag part */
  152.     );
  153.  
  154.  
  155. /* 
  156.  * Get number of nonzero elements of sparse matrix
  157.  */
  158. extern    long  mxGetNzmax(        
  159.     const Matrix *pm                    /* pointer to matrix */
  160.     );
  161.  
  162.  
  163. /* 
  164.  * Set number of nonzero elements of sparse matrix
  165.  */
  166. extern    void  mxSetNzmax(
  167.     Matrix *pm,                    /* pointer to matrix */
  168.     long nzmax                    /* number of nonzero elements */
  169.     );
  170.  
  171.  
  172. /* 
  173.  * Get pointer to sparse ir array
  174.  */
  175. extern    long  *mxGetIr(
  176.     const Matrix *pm                    /* pointer to matrix */
  177.     );    
  178.  
  179.  
  180. /* 
  181.  * Set pointer to sparse ir array
  182.  */
  183. extern    void  mxSetIr(        
  184.     Matrix *pm,                    /* pointer to matrix */
  185.     long *ir                        /* pointer to ir array */
  186.     );
  187.  
  188.  
  189. /* 
  190.  * Get pointer to sparse jc array
  191.  */
  192. extern    long  *mxGetJc(    
  193.     const Matrix *pm                    /* pointer to matrix */
  194.     );    
  195.  
  196.  
  197. /*
  198.  * Set pointer to sparse jc array 
  199.  */
  200. extern    void  mxSetJc(        
  201.     Matrix *pm,                    /* pointer to matrix */
  202.     long *jc                        /* pointer to sparse jc array */
  203.     );
  204.  
  205.  
  206. /*
  207.  * Indicate if there is a complex part to the matrix
  208.  */
  209. extern    int  mxIsComplex(
  210.     const Matrix    *pm                        /* pointer to matrix */
  211.     );
  212.  
  213.  
  214. /*
  215.  * Indicate if matrix argument is of type real
  216.  */
  217. extern    int  mxIsDouble(
  218.     const Matrix *pm                    /* pointer to matrix */
  219.     );
  220.  
  221.  
  222. /*
  223.  * Indicate if matrix argument is full
  224.  */
  225. extern    int  mxIsFull(
  226.     const Matrix *pm                    /* pointer to matrix */
  227.     );
  228.  
  229.  
  230. /*
  231.  * Indicate if data is to be represented as a string
  232.  */
  233. extern    int  mxIsNumeric(
  234.     const Matrix    *pm                        /* pointer to matrix */
  235.     );
  236.  
  237.  
  238. /*
  239.  * Indicate if matrix argument is sparse
  240.  */
  241. extern    int  mxIsSparse(
  242.     const Matrix *pm                    /* pointer to matrix */
  243.     );
  244.  
  245.  
  246. /* 
  247.  * Return 1 if matrix contains a string, 0 otherwise
  248.  */
  249. extern    int  mxIsString(
  250.     const Matrix *pm                    /* pointer to matrix */
  251.     );
  252.  
  253.  
  254. /*
  255.  * Convert MATLAB string to C string
  256.  */
  257. extern    int  mxGetString(
  258.     Matrix    *pm,                    /* pointer to matrix */
  259.     char     *str_ptr,                /* pointer to string holding results */
  260.     int     str_len                    /* length of string that holds results */
  261.     );
  262.  
  263.  
  264. /*
  265.  * Return first value of double matrix
  266.  */
  267. extern    double  mxGetScalar(
  268.     Matrix    *pm
  269.     );
  270.  
  271. #endif /* matrix16_h */
  272.