Histogram Support
[libbu (utility functions)]

Collaboration diagram for Histogram Support:


Files

file  hist.c
 General purpose histogram handling routines.

Data Structures

struct  bu_hist
 histogram support More...
struct  bu_hist
 histogram support More...

Defines

#define BU_HIST_MAGIC   0x48697374
#define BU_CK_HIST(_p)   BU_CKMAG(_p, BU_HIST_MAGIC, "struct bu_hist")
#define BU_HIST_TALLY(_hp, _val)
#define BU_HIST_TALLY_MULTIPLE(_hp, _val, _count)

Functions

void bu_hist_free (struct bu_hist *histp)
void bu_hist_init (struct bu_hist *histp, fastf_t min, fastf_t max, unsigned int nbins)
void bu_hist_range (struct bu_hist *hp, fastf_t low, fastf_t high)
void bu_hist_pr (const struct bu_hist *histp, const char *title)
void bu_hist_range (register struct bu_hist *hp, fastf_t low, fastf_t high)
void bu_hist_pr_suppress (register const struct bu_hist *histp, const char *title, int zero_suppress)
void bu_hist_pr (register const struct bu_hist *histp, const char *title)

Define Documentation

#define BU_HIST_MAGIC   0x48697374
 

Definition at line 961 of file bu.h.

Referenced by bu_hist_init(), and bu_identify_magic().

#define BU_CK_HIST _p   )     BU_CKMAG(_p, BU_HIST_MAGIC, "struct bu_hist")
 

Definition at line 962 of file bu.h.

Referenced by bu_hist_free(), bu_hist_pr_suppress(), and bu_hist_range().

#define BU_HIST_TALLY _hp,
_val   ) 
 

Value:

{ \
        if( (_val) <= (_hp)->hg_min )  { \
                (_hp)->hg_bins[0]++; \
        } else if( (_val) >= (_hp)->hg_max )  { \
                (_hp)->hg_bins[(_hp)->hg_nbins]++; \
        } else { \
                (_hp)->hg_bins[(int)(((_val)-(_hp)->hg_min)/(_hp)->hg_clumpsize)]++; \
        } \
        (_hp)->hg_nsamples++;  }

Definition at line 964 of file bu.h.

Referenced by rt_ct_measure().

#define BU_HIST_TALLY_MULTIPLE _hp,
_val,
_count   ) 
 

Value:

{ \
        register int    __count = (_count); \
        if( (_val) <= (_hp)->hg_min )  { \
                (_hp)->hg_bins[0] += __count; \
        } else if( (_val) >= (_hp)->hg_max )  { \
                (_hp)->hg_bins[(_hp)->hg_nbins] += __count; \
        } else { \
                (_hp)->hg_bins[(int)(((_val)-(_hp)->hg_min)/(_hp)->hg_clumpsize)] += __count; \
        } \
        (_hp)->hg_nsamples += __count;  }

Definition at line 974 of file bu.h.


Function Documentation

void bu_hist_free struct bu_hist histp  ) 
 

B U _ H I S T _ F R E E

Definition at line 62 of file hist.c.

References BU_CK_HIST, bu_free(), hg_bins, hg_nbins, and magic.

Here is the call graph for this function:

void bu_hist_init struct bu_hist histp,
fastf_t  min,
fastf_t  max,
unsigned int  nbins
 

B U _ H I S T _ I N I T

Initialize a bu_hist structure. It is expected that the structure is junk upon entry.

Definition at line 81 of file hist.c.

References bu_calloc(), BU_HIST_MAGIC, hg_bins, hg_clumpsize, hg_max, hg_min, hg_nbins, hg_nsamples, and magic.

Referenced by rt_nugrid_cut().

Here is the call graph for this function:

void bu_hist_range struct bu_hist hp,
fastf_t  low,
fastf_t  high
 

void bu_hist_pr const struct bu_hist histp,
const char *  title
 

Referenced by rt_pr_cut_info().

void bu_hist_range register struct bu_hist hp,
fastf_t  low,
fastf_t  high
 

B U _ H I S T _ R A N G E

Definition at line 107 of file hist.c.

References BU_CK_HIST.

void bu_hist_pr_suppress register const struct bu_hist histp,
const char *  title,
int  zero_suppress
 

B U _ H I S T _ P R _ S U P P R E S S

Allows caller control over zero-suppression feature.

Definition at line 136 of file hist.c.

References BU_CK_HIST, and val.

Referenced by bu_hist_pr().

void bu_hist_pr register const struct bu_hist histp,
const char *  title
 

B U _ H I S T _ P R

The original interface.

Definition at line 209 of file hist.c.

References bu_hist_pr_suppress().

Here is the call graph for this function:


Generated on Mon Sep 18 01:25:19 2006 for BRL-CAD by  doxygen 1.4.6