Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Histogram
diff Histogram.h @ 2:06128e387cfa
Added DblHist and FloatHist
| author | Me |
|---|---|
| date | Sat, 30 Oct 2010 22:13:09 -0700 |
| parents | dbb58ebfd690 |
| children | a2388fae93ff |
line diff
1.1 --- a/Histogram.h Sat Sep 11 04:46:29 2010 -0700 1.2 +++ b/Histogram.h Sat Oct 30 22:13:09 2010 -0700 1.3 @@ -6,6 +6,7 @@ 1.4 * 1.5 */ 1.6 1.7 +#include "../VMS_primitive_data_types.h" 1.8 1.9 #ifndef _HISTOGRAM_H 1.10 #define _HISTOGRAM_H 1.11 @@ -20,6 +21,26 @@ 1.12 } 1.13 Histogram; 1.14 1.15 +typedef struct 1.16 + { 1.17 + float32 startOfRange; 1.18 + float32 endOfRange; 1.19 + int numBins; 1.20 + float32 binWidth; 1.21 + int *bins; 1.22 + } 1.23 +FloatHist; 1.24 + 1.25 +typedef struct 1.26 + { 1.27 + float64 startOfRange; 1.28 + float64 endOfRange; 1.29 + int numBins; 1.30 + float64 binWidth; 1.31 + int *bins; 1.32 + } 1.33 +DblHist; 1.34 + 1.35 Histogram * 1.36 makeHistogram( int numBins, int startOfRange, int endOfRange ); 1.37 1.38 @@ -29,5 +50,24 @@ 1.39 void 1.40 printHist( Histogram *hist ); 1.41 1.42 +FloatHist * 1.43 +makeFloatHistogram( int numBins, float32 startOfRange, float32 binWidth ); 1.44 + 1.45 +void 1.46 +addToFloatHist( float32 value, FloatHist *hist ); 1.47 + 1.48 +void 1.49 +printFloatHist( FloatHist *hist ); 1.50 + 1.51 + 1.52 +DblHist * 1.53 +makeDblHistogram( int numBins, float64 startOfRange, float64 binWidth ); 1.54 + 1.55 +void 1.56 +addToDblHist( float64 value, DblHist *hist ); 1.57 + 1.58 +void 1.59 +printDblHist( DblHist *hist ); 1.60 + 1.61 #endif /* _HISTOGRAM_H */ 1.62
