Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

stats.c File Reference


Detailed Description

Statistics routines.

Author:
Raphael Manfredi
Date:
2004

#include "common.h"
#include "stats.h"
#include "walloc.h"
#include "override.h"

Data Structures

struct  statx
 A one-dimension container (x). More...

Typedefs

typedef enum op stats_op_t

Enumerations

enum  op { STATS_OP_REMOVE = -1, STATS_OP_ADD = +1 }

Functions

gpointer statx_make (void)
 Create one-dimension container.
void statx_free (gpointer ox)
 Destroy one-dimension container.
void statx_clear (gpointer ox)
 Clear container.
void statx_opx (struct statx *sx, gdouble val, stats_op_t op)
 Add/substract one data point.
void statx_add (gpointer ox, gdouble val)
 Add data point to container.
void statx_remove (gpointer ox, gdouble val)
 Remove data point from container.
gint statx_n (gpointer ox)
gdouble statx_avg (gpointer ox)
gdouble statx_sdev (gpointer ox)
gdouble statx_var (gpointer ox)
gdouble * statx_data (gpointer ox)


Typedef Documentation

typedef enum op stats_op_t
 


Enumeration Type Documentation

enum op
 

Enumeration values:
STATS_OP_REMOVE 
STATS_OP_ADD 


Function Documentation

void statx_add gpointer  ox,
gdouble  val
 

Add data point to container.

gdouble statx_avg gpointer  ox  ) 
 

Returns:
average of data points.

void statx_clear gpointer  ox  ) 
 

Clear container.

gdouble* statx_data gpointer  ox  ) 
 

Returns:
an array of datapoints which can be freed when done.

void statx_free gpointer  ox  ) 
 

Destroy one-dimension container.

gpointer statx_make void   ) 
 

Create one-dimension container.

gint statx_n gpointer  ox  ) 
 

Returns:
amount of data points.

void statx_opx struct statx sx,
gdouble  val,
stats_op_t  op
[static]
 

Add/substract one data point.

Parameters:
sx the container
val the value to add/remove
op the operation: STATS_OP_ADD or STATS_OP_REMOVE

void statx_remove gpointer  ox,
gdouble  val
 

Remove data point from container.

gdouble statx_sdev gpointer  ox  ) 
 

Returns:
the standard deviation of the data points.

gdouble statx_var gpointer  ox  ) 
 

Returns:
the variance of the data points.


Generated on Sat Jun 30 17:53:31 2007 for gtk-gnutella by  doxygen 1.3.9.1