comparison Histogram.h @ 4:83a412f2ef98

Added stdio.h and copy-paste error on FreeDblHist to FreeFloatHist
author Me
date Tue, 02 Nov 2010 16:47:21 -0700
parents dbb58ebfd690
children a2388fae93ff
comparison
equal deleted inserted replaced
1:83252533e7dc 2:4c024559660a
4 * 4 *
5 * Author: seanhalle@yahoo.com 5 * Author: seanhalle@yahoo.com
6 * 6 *
7 */ 7 */
8 8
9 #include "../VMS_primitive_data_types.h"
9 10
10 #ifndef _HISTOGRAM_H 11 #ifndef _HISTOGRAM_H
11 #define _HISTOGRAM_H 12 #define _HISTOGRAM_H
12 13
13 typedef struct 14 typedef struct
18 int binWidth; 19 int binWidth;
19 int *bins; 20 int *bins;
20 } 21 }
21 Histogram; 22 Histogram;
22 23
24 typedef struct
25 {
26 float32 startOfRange;
27 float32 endOfRange;
28 int numBins;
29 float32 binWidth;
30 int *bins;
31 }
32 FloatHist;
33
34 typedef struct
35 {
36 float64 startOfRange;
37 float64 endOfRange;
38 int numBins;
39 float64 binWidth;
40 int *bins;
41 }
42 DblHist;
43
23 Histogram * 44 Histogram *
24 makeHistogram( int numBins, int startOfRange, int endOfRange ); 45 makeHistogram( int numBins, int startOfRange, int endOfRange );
25 46
26 void 47 void
27 addToHist( int value, Histogram *hist ); 48 addToHist( int value, Histogram *hist );
28 49
29 void 50 void
30 printHist( Histogram *hist ); 51 printHist( Histogram *hist );
31 52
53 FloatHist *
54 makeFloatHistogram( int numBins, float32 startOfRange, float32 binWidth );
55
56 void
57 addToFloatHist( float32 value, FloatHist *hist );
58
59 void
60 printFloatHist( FloatHist *hist );
61
62
63 DblHist *
64 makeDblHistogram( int numBins, float64 startOfRange, float64 binWidth );
65
66 void
67 addToDblHist( float64 value, DblHist *hist );
68
69 void
70 printDblHist( DblHist *hist );
71
32 #endif /* _HISTOGRAM_H */ 72 #endif /* _HISTOGRAM_H */
33 73