Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

mmxavg.h

Go to the documentation of this file.
00001 #ifndef MMXAVG_H
00002 #define MMXAVG_H
00003 
00004 /*
00005   mmxavg.h
00006 
00007   Min-max-average code
00008 
00009 Modifications:
00010 
00011   13-Mar-2000 WPS added unused attribute to mmxavg_h to avoid 'defined but not used' compiler warning.
00012   */
00013 
00014 /* ident tag */
00015 #ifndef __GNUC__
00016 #ifndef __attribute__
00017 #define __attribute__(x)
00018 #endif
00019 #endif
00020 
00021 static char __attribute__((unused)) mmxavg_h[] = "$Id: mmxavg.h,v 1.2 2000/10/27 20:34:42 terrylr Exp $";
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 typedef struct
00028 {
00029   double sum;                   /* total */
00030   double *nums;                 /* array for stored values */
00031   int index;                    /* index into array for next spot */
00032   int in;                       /* how many in array */
00033   int size;                     /* size of array; 0 <= index < max */
00034   int inited;                   /* non-zero means at least one value in */
00035   double min, max;              /* saved min, max values */
00036 } MMXAVG_STRUCT;
00037 
00038 /* initializes vars */
00039 extern int mmxavgInit(MMXAVG_STRUCT *mmxavg, double *space, int size);
00040 
00041 /* re-initializes vars, leaves space alone */
00042 extern int mmxavgReset(MMXAVG_STRUCT *mmxavg);
00043 
00044 /* adds a point to the mmxavg structure */
00045 extern int mmxavgAdd(MMXAVG_STRUCT *mmxavg, double num);
00046 
00047 /* returns the min */
00048 extern double mmxavgMin(MMXAVG_STRUCT *mmxavg);
00049 
00050 /* returns the max */
00051 extern double mmxavgMax(MMXAVG_STRUCT *mmxavg);
00052 
00053 /* returns the average */
00054 extern double mmxavgAvg(MMXAVG_STRUCT *mmxavg);
00055 
00056 #ifdef __cplusplus
00057 }
00058 #endif
00059 
00060 #endif /* MMXAVG_H */

Generated on Sun Dec 2 15:27:41 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001