Mercurial > cgi-bin > hgwebdir.cgi > PR > PR_Implementations > PR__Univ > PR__includes > PR__include
comparison prhistogram.h @ 4:10986666560d
Changes on copy on D:
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sun, 15 Sep 2013 07:18:46 -0700 |
| parents | |
| children | 14241f07f742 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:5ea88b964117 |
|---|---|
| 1 /* | |
| 2 * Copyright 2010 OpenSourceResearchInstitute.org | |
| 3 * Licensed under GNU General Public License version 2 | |
| 4 * | |
| 5 * Author: seanhalle@yahoo.com | |
| 6 * | |
| 7 */ | |
| 8 | |
| 9 | |
| 10 #ifndef _PRHISTOGRAM_H | |
| 11 #define _PRHISTOGRAM_H | |
| 12 | |
| 13 #include <PR__include/prmalloc.h> | |
| 14 #include <PR__include/PR__primitive_data_types.h> | |
| 15 | |
| 16 | |
| 17 typedef struct | |
| 18 { | |
| 19 char *name; | |
| 20 int32 startOfRange; | |
| 21 int32 endOfRange; | |
| 22 int32 numBins; | |
| 23 int32 binWidth; | |
| 24 int32 *bins; | |
| 25 } | |
| 26 Histogram; | |
| 27 | |
| 28 typedef struct | |
| 29 { | |
| 30 float32 startOfRange; | |
| 31 float32 endOfRange; | |
| 32 int32 numBins; | |
| 33 float32 binWidth; | |
| 34 int32 *bins; | |
| 35 } | |
| 36 FloatHist; | |
| 37 | |
| 38 typedef struct | |
| 39 { | |
| 40 float64 startOfRange; | |
| 41 float64 endOfRange; | |
| 42 int32 numBins; | |
| 43 float64 binWidth; | |
| 44 int32 *bins; | |
| 45 } | |
| 46 DblHist; | |
| 47 | |
| 48 Histogram * | |
| 49 makeHistogram( int32 numBins, int32 startOfRange, int32 endOfRange ); | |
| 50 | |
| 51 Histogram * | |
| 52 makeFixedBinHist( int32 numBins, int32 startOfRange, int32 binWidth, | |
| 53 char *name ); | |
| 54 | |
| 55 Histogram * | |
| 56 makeFixedBinHistExt( int32 numBins, int32 startOfRange, int32 binWidth, | |
| 57 char *name ); | |
| 58 | |
| 59 void inline | |
| 60 addToHist( int32 value, Histogram *hist ); | |
| 61 | |
| 62 void inline | |
| 63 addIntervalToHist( uint32 startIntvl, uint32 endIntvl, Histogram *hist ); | |
| 64 | |
| 65 void inline | |
| 66 subIntervalFromHist( int32 startIntvl, int32 endIntvl, Histogram *hist ); | |
| 67 | |
| 68 void | |
| 69 saveHistToFile(Histogram *hist); | |
| 70 | |
| 71 void | |
| 72 printHist( Histogram *hist ); | |
| 73 | |
| 74 FloatHist * | |
| 75 makeFloatHistogram( int numBins, float32 startOfRange, float32 binWidth ); | |
| 76 | |
| 77 void | |
| 78 addToFloatHist( float32 value, FloatHist *hist ); | |
| 79 | |
| 80 void | |
| 81 printFloatHist( FloatHist *hist ); | |
| 82 | |
| 83 void | |
| 84 freeHistExt( Histogram *hist ); | |
| 85 | |
| 86 void | |
| 87 freeHist( Histogram *hist ); | |
| 88 | |
| 89 DblHist * | |
| 90 makeDblHistogram( int numBins, float64 startOfRange, float64 binWidth ); | |
| 91 | |
| 92 void | |
| 93 addToDblHist( float64 value, DblHist *hist ); | |
| 94 | |
| 95 void | |
| 96 printDblHist( DblHist *hist ); | |
| 97 | |
| 98 void | |
| 99 freeDblHist( DblHist *hist ); | |
| 100 | |
| 101 #endif /* _HISTOGRAM_H */ | |
| 102 |
