comparison Histogram.h @ 6:a2388fae93ff

Merge addInterval version with VMS__malloc version
author SeanHalle
date Thu, 11 Nov 2010 05:45:08 -0800
parents 13b8591dd045 06128e387cfa
children fa6a281bd854
comparison
equal deleted inserted replaced
3:a9f4f0bee182 4:d5d00d725721
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( int32 numBins, int32 startOfRange, int32 endOfRange ); 45 makeHistogram( int32 numBins, int32 startOfRange, int32 endOfRange );
25 46
26 void inline 47 void inline
27 addToHist( int32 value, Histogram *hist ); 48 addToHist( int32 value, Histogram *hist );
30 addIntervalToHist( int32 startIntvl, int32 endIntvl, Histogram *hist ); 51 addIntervalToHist( int32 startIntvl, int32 endIntvl, Histogram *hist );
31 52
32 void 53 void
33 printHist( Histogram *hist ); 54 printHist( Histogram *hist );
34 55
56 FloatHist *
57 makeFloatHistogram( int numBins, float32 startOfRange, float32 binWidth );
58
59 void
60 addToFloatHist( float32 value, FloatHist *hist );
61
62 void
63 printFloatHist( FloatHist *hist );
64
65
66 DblHist *
67 makeDblHistogram( int numBins, float64 startOfRange, float64 binWidth );
68
69 void
70 addToDblHist( float64 value, DblHist *hist );
71
72 void
73 printDblHist( DblHist *hist );
74
35 #endif /* _HISTOGRAM_H */ 75 #endif /* _HISTOGRAM_H */
36 76