functions to calculate standard deviation More...
Go to the source code of this file.
Data Structures | |
struct | SDEntry |
An entry to hold data which will be used to calculate SD. More... | |
struct | SDHandle |
Opaque handle for calculating SD. More... | |
Functions | |
struct SDHandle * | GNUNET_TESTBED_SD_init_ (unsigned int max_cnt) |
Initialize standard deviation calculation handle. More... | |
void | GNUNET_TESTBED_SD_destroy_ (struct SDHandle *h) |
Frees the memory allocated to the SD handle. More... | |
void | GNUNET_TESTBED_SD_add_data_ (struct SDHandle *h, unsigned int amount) |
Add a reading to SD. More... | |
int | GNUNET_TESTBED_SD_deviation_factor_ (struct SDHandle *h, unsigned int amount, int *factor) |
Calculates the factor by which the given amount differs. More... | |
functions to calculate standard deviation
Definition in file testbed_api_sd.c.
struct SDHandle* GNUNET_TESTBED_SD_init_ | ( | unsigned int | max_cnt | ) |
Initialize standard deviation calculation handle.
max_cnt | the maximum number of readings to keep |
Definition at line 107 of file testbed_api_sd.c.
References GNUNET_assert, GNUNET_new, h, and SDHandle::max_cnt.
Referenced by GNUNET_TESTBED_operation_queue_create_().
void GNUNET_TESTBED_SD_destroy_ | ( | struct SDHandle * | h | ) |
Frees the memory allocated to the SD handle.
h | the SD handle |
Definition at line 124 of file testbed_api_sd.c.
References GNUNET_CONTAINER_DLL_remove, GNUNET_free, and h.
Referenced by queue_destroy().
void GNUNET_TESTBED_SD_add_data_ | ( | struct SDHandle * | h, |
unsigned int | amount | ||
) |
Add a reading to SD.
h | the SD handle |
amount | the reading value |
Definition at line 144 of file testbed_api_sd.c.
References SDEntry::amount, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_new, and h.
Referenced by adapt_parallelism().
int GNUNET_TESTBED_SD_deviation_factor_ | ( | struct SDHandle * | h, |
unsigned int | amount, | ||
int * | factor | ||
) |
Calculates the factor by which the given amount differs.
Returns the factor by which the given amount differs from the standard deviation.
h | the SDhandle |
amount | the value for which the deviation is returned |
factor | the factor by which the given amont differs |
Definition at line 185 of file testbed_api_sd.c.
References SDEntry::amount, removetrailingwhitespace::f, GNUNET_OK, GNUNET_SYSERR, and h.
Referenced by adapt_parallelism().