diff options
Diffstat (limited to 'src/statwrapper.cc')
| -rw-r--r-- | src/statwrapper.cc | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/src/statwrapper.cc b/src/statwrapper.cc index e273e78..cda25b6 100644 --- a/src/statwrapper.cc +++ b/src/statwrapper.cc @@ -1,48 +1,33 @@ -//a Wraper function for stats class -#include "intersim2/stats.hpp" +// a Wraper function for stats class #include <stdio.h> +#include "intersim2/stats.hpp" -Stats* StatCreate (const char * name, double bin_size, int num_bins) { - Stats* newstat = new Stats(NULL,name,bin_size,num_bins); - newstat->Clear (); - return newstat; +Stats *StatCreate(const char *name, double bin_size, int num_bins) { + Stats *newstat = new Stats(NULL, name, bin_size, num_bins); + newstat->Clear(); + return newstat; } -void StatClear(void * st) -{ - ((Stats *)st)->Clear(); -} +void StatClear(void *st) { ((Stats *)st)->Clear(); } -void StatAddSample (void * st, int val) -{ - ((Stats *)st)->AddSample(val); -} +void StatAddSample(void *st, int val) { ((Stats *)st)->AddSample(val); } -double StatAverage(void * st) -{ - return((Stats *)st)->Average(); -} +double StatAverage(void *st) { return ((Stats *)st)->Average(); } -double StatMax(void * st) -{ - return((Stats *)st)->Max(); -} +double StatMax(void *st) { return ((Stats *)st)->Max(); } -double StatMin(void * st) -{ - return((Stats *)st)->Min(); -} +double StatMin(void *st) { return ((Stats *)st)->Min(); } -void StatDisp (void * st) -{ - printf ("Stats for "); - ((Stats *)st)->DisplayHierarchy(); -// if (((Stats *)st)->NeverUsed()) { -// printf (" was never updated!\n"); -// } else { - printf("Min %f Max %f Average %f \n",((Stats *)st)->Min(),((Stats *)st)->Max(),StatAverage(st)); - ((Stats *)st)->Display(); -// } +void StatDisp(void *st) { + printf("Stats for "); + ((Stats *)st)->DisplayHierarchy(); + // if (((Stats *)st)->NeverUsed()) { + // printf (" was never updated!\n"); + // } else { + printf("Min %f Max %f Average %f \n", ((Stats *)st)->Min(), + ((Stats *)st)->Max(), StatAverage(st)); + ((Stats *)st)->Display(); + // } } #if 0 @@ -55,5 +40,3 @@ int main () StatDisp(mytest); } #endif - - |
