Public Member Functions | Protected Attributes
vifa_incr_var Class Reference

Compute the mean & variance measures of a data set. More...

#include <vifa_incr_var.h>

Inheritance diagram for vifa_incr_var:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vifa_incr_var ()
 Default constructor.
 vifa_incr_var (vifa_incr_var const &v)
double get_mean () const
 Fetch the current mean.
double get_var () const
 Fetch the current variance.
int get_n () const
 Fetch the number of samples received so far.
double get_min () const
 Fetch the minimum-value sample of the data set.
double get_max () const
 Fetch the maximum-value sample of the data set.
void add_sample (double data_point)
 Update the mean & variance measures with a new sample.
void add_sample (double data_point, double prev_factor, double curr_factor)
 Update the mean & variance measures with a new sample.
void touch ()
unsigned long get_time_stamp () const
bool older (vul_timestamp const &t) const
bool older (vul_timestamp const *t) const
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Protected Attributes

double data_mean_
 The current mean of the data set.
double data_var_
 The current variance of the data set.
int n_
 The number of samples in the data set.
vbl_bounding_box< double, 1 > min_max_
 The minimum-value and maximum-value sample of the data set.
unsigned long timestamp_

Detailed Description

Compute the mean & variance measures of a data set.

The vifa_incr_var class is used to accumulate the mean & variance of a data set incrementally, one data sample at a time.

Definition at line 30 of file vifa_incr_var.h.


Constructor & Destructor Documentation

vifa_incr_var::vifa_incr_var ( ) [inline]

Default constructor.

Definition at line 47 of file vifa_incr_var.h.

vifa_incr_var::vifa_incr_var ( vifa_incr_var const &  v) [inline]

Definition at line 50 of file vifa_incr_var.h.


Member Function Documentation

void vifa_incr_var::add_sample ( double  data_point)

Update the mean & variance measures with a new sample.

This method is a convenience front-end for add_sample() (see below)

Definition at line 28 of file vifa_incr_var.cxx.

void vifa_incr_var::add_sample ( double  data_point,
double  prev_factor,
double  curr_factor 
)

Update the mean & variance measures with a new sample.

Definition at line 6 of file vifa_incr_var.cxx.

double vifa_incr_var::get_max ( ) const [inline]

Fetch the maximum-value sample of the data set.

Definition at line 68 of file vifa_incr_var.h.

double vifa_incr_var::get_mean ( ) const [inline]

Fetch the current mean.

Definition at line 56 of file vifa_incr_var.h.

double vifa_incr_var::get_min ( ) const [inline]

Fetch the minimum-value sample of the data set.

Definition at line 65 of file vifa_incr_var.h.

int vifa_incr_var::get_n ( ) const [inline]

Fetch the number of samples received so far.

Definition at line 62 of file vifa_incr_var.h.

double vifa_incr_var::get_var ( ) const [inline]

Fetch the current variance.

Definition at line 59 of file vifa_incr_var.h.


Member Data Documentation

double vifa_incr_var::data_mean_ [protected]

The current mean of the data set.

Definition at line 34 of file vifa_incr_var.h.

double vifa_incr_var::data_var_ [protected]

The current variance of the data set.

Definition at line 37 of file vifa_incr_var.h.

The minimum-value and maximum-value sample of the data set.

Definition at line 43 of file vifa_incr_var.h.

int vifa_incr_var::n_ [protected]

The number of samples in the data set.

Definition at line 40 of file vifa_incr_var.h.


The documentation for this class was generated from the following files: