#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
Include dependency graph for cdf.h:
Go to the source code of this file.
Compounds | |
struct | Cdfrec_ |
Cdfrec_ : this structure holds the variables for estimating a CDF. More... | |
Functions | |
int | init_cdf (int Binno, double Low, double Up, Cdfrec_ *Cdf) |
init_cdf(Binno, Low, Up, Cdf): initialises Cdf to collect data between Low and Up into Binno bins. More... | |
int | add_cdf (double Value, Cdfrec_ *Cdf) |
add_cdf(Value, Cdf): enters the value Value into Cdf. More... | |
int | eval_cdf (Cdfrec_ *Cdf) |
eval_cdf(Cdf): calculates the CDF and puts the estimated values in Cdf->Y[] (a normalisation). More... | |
void | remove_cdf (Cdfrec_ *Cdf) |
remove_cdf(Cdf): frees up the 3 arrays in Cdfrec_ and resets all variables to 0. More... |
Definition in file cdf.h.
|
init_cdf(Binno, Low, Up, Cdf): initialises Cdf to collect data between Low and Up into Binno bins. X[] is initialised to uniform sampling but the user can overwrite it after the call to init_cdf(), the only rule being that if i<j then X[i]<=X[j]. If Low>Up, they are silently swapped. In C++ this would be a constructor. Return value: 0 if OK, -1 if some of the parameters were silly, -2 if no more memory could be allocated. Referenced by Cdfrec_::N(). |
|
add_cdf(Value, Cdf): enters the value Value into Cdf. The bin which is the first that is higher than Value is incremented by 1. Return value: 0 if OK, 1 if it is too large. Referenced by Cdfrec_::N(). |
|
eval_cdf(Cdf): calculates the CDF and puts the estimated values in Cdf->Y[] (a normalisation). Leaves the original Cdf->Yint[] intact. Return value: 0 if OK, -1 if no data were in Cdf. Referenced by Cdfrec_::N(). |
|
remove_cdf(Cdf): frees up the 3 arrays in Cdfrec_ and resets all variables to 0. Does not remove Cdf itself! This would be a C++ destructor. Referenced by Cdfrec_::N(). |