home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncsa.uiuc.edu / ftp.ncsa.uiuc.edu.zip / ftp.ncsa.uiuc.edu / DataScope / misc / DScope.h < prev    next >
Text File  |  2017-03-03  |  2KB  |  69 lines

  1. /**************************************************************************/
  2. /*  NCSA DataScope
  3. *   An experiment with real numbers.
  4. *   by Tim Krauskopf
  5. *   
  6. *   National Center for Supercomputing Applications
  7. *   University of Illinois at Urbana-Champaign
  8. *   605 E. Springfield Ave.
  9. *   Champaign, IL  61820
  10. *
  11. *   email:          softdev@ncsa.uiuc.edu
  12. *   bug reports:    bugs@ncsa.uiuc.edu
  13. *   server:         ftp.ncsa.uiuc.edu  (128.174.20.50)
  14. *
  15. *   version                      comments
  16. *   -----------                -------------
  17. *   1.0 TKK  December 1988
  18. *   1.1 TKK  May 1989       -- new polar, computations, interpolation
  19. *                            -- computational routines by Mark Stupar
  20. */
  21.  
  22. /*
  23.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24.     Data structure for external functions.
  25.     
  26.     The field "kind" determines whether the array contains a valid
  27.     cval or a valid set of ncols,nrows,rows,cols,vals.
  28.     
  29.     External functions are called as:
  30.     your_fn(lft,rgt,answer)
  31.     scope_array *lft,             left parameter 
  32.                 *rgt,             right parameter 
  33.                 *answer;         place to put the answer 
  34.                 
  35.     Answer will always contain pre-allocated space for an array of
  36.     resulting values, including the rows and cols arrays.  You may
  37.     change any value (and should) in the rows,cols and vals arrays.
  38.     Do not change any values in the lft or rgt storage.
  39.     
  40.     If your routine returns only a constant, set kind == DS_CONSTANT
  41.     and put the answer in cval.
  42.     
  43.     DON'T allocate anything you don't free yourself.
  44.     FREE everything you allocate.
  45.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  46. */
  47.  
  48. #define DS_ERROR -1
  49. #define DS_CONSTANT 0
  50. #define DS_ARRAY 1
  51.  
  52. typedef struct 
  53.         {float    
  54.                 cval,    /* constant value when we are carrying a constant */
  55.                 *rows,    /* row labels, scale values:  count = ncols   */
  56.                 *cols,    /* col labels, scale values:  count = nrows   */
  57.                 *vals;    /* data values in the array, if there is an array 
  58.                             size = ncols*nrows                        */
  59.         
  60.          int    ncols,
  61.                 nrows;    /* dimensions of the array */
  62.     
  63.          char    
  64.                 kind;    /* ERROR, CONSTANT, ARRAY */
  65.         } 
  66.         
  67.         scope_array;
  68.  
  69.