Go to the source code of this file.
|
| double | do_stats (long long *array, long long *min, long long *max, double *average) |
| |
| void | do_std_dev (long long *a, int *s, double std, double ave) |
| |
| void | do_dist (long long *a, long long min, long long max, int bins, int *d) |
| |
| static int | cmpfunc (const void *a, const void *b) |
| |
| int | do_percentile (long long *a, long long *percent25, long long *percent50, long long *percent75, long long *percent99) |
| |
◆ NUM_ITERS
| #define NUM_ITERS 1000000 |
◆ cmpfunc()
| static int cmpfunc |
( |
const void * |
a, |
|
|
const void * |
b |
|
) |
| |
|
static |
Definition at line 82 of file cost_utils.c.
84 if ( *(
long long *)
a - *(
long long *)
b < 0 ) {
88 if ( *(
long long int*)
a - *(
long long int*)
b > 0 ) {
static double b[MATRIX_SIZE][MATRIX_SIZE]
static double a[MATRIX_SIZE][MATRIX_SIZE]
◆ do_dist()
| void do_dist |
( |
long long * |
a, |
|
|
long long |
min, |
|
|
long long |
max, |
|
|
int |
bins, |
|
|
int * |
d |
|
) |
| |
Definition at line 56 of file cost_utils.c.
60 int range = ( int ) ( max -
min + 1 );
63 for (
i = 0;
i < bins;
i++ ) {
71 if ( j && ( dmax < d[j] ) )
76 for (
i = 1;
i < bins;
i++ ) {
77 d[
i] = ( d[
i] * 100 ) / dmax;
static double a[MATRIX_SIZE][MATRIX_SIZE]
◆ do_percentile()
| int do_percentile |
( |
long long * |
a, |
|
|
long long * |
percent25, |
|
|
long long * |
percent50, |
|
|
long long * |
percent75, |
|
|
long long * |
percent99 |
|
) |
| |
Definition at line 96 of file cost_utils.c.
103 int i_25,i_50,i_75,i_99;
106 a_sort = calloc(
num_iters,
sizeof(
long long));
108 fprintf(stderr,
"Memory allocation error!\n");
125 *percent25=a_sort[i_25];
126 *percent50=a_sort[i_50];
127 *percent75=a_sort[i_75];
128 *percent99=a_sort[i_99];
static int cmpfunc(const void *a, const void *b)
static double a[MATRIX_SIZE][MATRIX_SIZE]
◆ do_stats()
| double do_stats |
( |
long long * |
array, |
|
|
long long * |
min, |
|
|
long long * |
max, |
|
|
double * |
average |
|
) |
| |
Definition at line 12 of file cost_utils.c.
20 *average += ( double )
array[
i];
26 *average = *average / ( double )
num_iters;
static double array[ARRAYSIZE]
◆ do_std_dev()
| void do_std_dev |
( |
long long * |
a, |
|
|
int * |
s, |
|
|
double |
std, |
|
|
double |
ave |
|
) |
| |
Definition at line 37 of file cost_utils.c.
42 for (
i = 0;
i < 10;
i++ ) {
43 dev[
i] = std * (
i + 1 );
48 for ( j = 0; j < 10; j++ ) {
49 if ( ( (
double )
a[
i] - dev[j] ) > ave )
static double a[MATRIX_SIZE][MATRIX_SIZE]
◆ num_iters