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

stats.c File Reference


Detailed Description

Statistics routines.

Author:
Raphael Manfredi
Date:
2004

#include "common.h"
#include <math.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

 RCSID ("$Id:stats.c, v 1.5 2005/06/25 01:37:43 daichik Exp $")
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

RCSID "$Id:stats.  c,
v 1.5 2005/06/25 01:37:43 daichik Exp $" 
 

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 Sun Feb 12 10:50:08 2006 for Gtk-Gnutella by doxygen 1.3.6