view Histogram.h @ 16:f4d96eaf374a

updated for VMS name chgs from VMS__malloc to VMS_int__malloc
author Me@portablequad
date Sun, 12 Feb 2012 01:45:40 -0800
parents 1fbaedaac2c7
children cd8275f62ee1 4d9af65ad3df
line source
1 /*
2 * Copyright 2010 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #include "../../VMS_Implementations/VMS_impl/VMS.h"
10 #include "../../VMS_Implementations/VMS_impl/vmalloc.h"
11 #include "../../VMS_Implementations/VMS_impl/vutilities.h"
13 #ifndef _HISTOGRAM_H
14 #define _HISTOGRAM_H
16 typedef struct
17 {
18 char *name;
19 int32 startOfRange;
20 int32 endOfRange;
21 int32 numBins;
22 int32 binWidth;
23 int32 *bins;
24 }
25 Histogram;
27 typedef struct
28 {
29 float32 startOfRange;
30 float32 endOfRange;
31 int32 numBins;
32 float32 binWidth;
33 int32 *bins;
34 }
35 FloatHist;
37 typedef struct
38 {
39 float64 startOfRange;
40 float64 endOfRange;
41 int32 numBins;
42 float64 binWidth;
43 int32 *bins;
44 }
45 DblHist;
47 Histogram *
48 makeHistogram( int32 numBins, int32 startOfRange, int32 endOfRange );
50 Histogram *
51 makeFixedBinHist( int32 numBins, int32 startOfRange, int32 binWidth,
52 char *name );
54 Histogram *
55 makeFixedBinHistExt( int32 numBins, int32 startOfRange, int32 binWidth,
56 char *name );
58 void inline
59 addToHist( int32 value, Histogram *hist );
61 void inline
62 addIntervalToHist( uint32 startIntvl, uint32 endIntvl, Histogram *hist );
64 void inline
65 subIntervalFromHist( int32 startIntvl, int32 endIntvl, Histogram *hist );
67 void
68 saveHistToFile(Histogram *hist);
70 void
71 printHist( Histogram *hist );
73 FloatHist *
74 makeFloatHistogram( int numBins, float32 startOfRange, float32 binWidth );
76 void
77 addToFloatHist( float32 value, FloatHist *hist );
79 void
80 printFloatHist( FloatHist *hist );
82 void
83 freeHistExt( Histogram *hist );
85 void
86 freeHist( Histogram *hist );
88 DblHist *
89 makeDblHistogram( int numBins, float64 startOfRange, float64 binWidth );
91 void
92 addToDblHist( float64 value, DblHist *hist );
94 void
95 printDblHist( DblHist *hist );
97 void
98 freeDblHist( DblHist *hist );
100 #endif /* _HISTOGRAM_H */