Bin Class Reference

#include <bin.h>

Inheritance diagram for Bin:

SparseTreeNode List of all members.

Detailed Description

Encapsulates a histogram bin.

A Bin is implemented as a SparseTreeNode with two data members: a size and a count.


Public Member Functions

 Bin ()
 Bin (const LargeIndex &index)
virtual ~Bin ()
void set_size (double size)
 Sets the size of the bin.
double size () const
 Get the size of the bin.
void set_count (double count)
 Set the count.
double count () const
 Get the current count.
virtual void ReadData (istream &input_stream)
 Read the data, excluding the index, from a stream.
virtual void WriteData (ostream &output_stream) const
 Write the data, excluding the index, to a stream.
virtual void Combine (const SparseTreeNode &other)
 Combine data from two Bins.
const LargeIndexindex () const
SparseTreeNodeparent ()
SparseTreeNodeprev_sibling ()
SparseTreeNodenext_sibling ()
SparseTreeNodefirst_child ()
SparseTreeNodelast_child ()
void set_parent (SparseTreeNode *parent)
void set_prev_sibling (SparseTreeNode *sibling)
void set_next_sibling (SparseTreeNode *sibling)
void set_first_child (SparseTreeNode *child)
void set_last_child (SparseTreeNode *child)
void set_index (const LargeIndex &index)
bool has_parent () const
bool has_prev_sibling () const
bool has_next_sibling () const
bool has_child () const
void ReadFromStream (istream &input_stream)
 Read the data, including the index, from a stream.
void WriteToStream (ostream &output_stream) const
 Write the data, including the index, to a stream.
bool operator< (const SparseTreeNode &other) const
 Returns true if this node's index is smaller than that of <other>.

Static Public Member Functions

static bool CompareNodes (const SparseTreeNode *one, const SparseTreeNode *two)
 Returns true if <one>'s index is smaller than that of <two>.


Constructor & Destructor Documentation

Bin (  ) 

Bin ( const LargeIndex index  ) 

virtual ~Bin (  )  [inline, virtual]


Member Function Documentation

void set_size ( double  size  )  [inline]

Sets the size of the bin.

double size (  )  const [inline]

Get the size of the bin.

void set_count ( double  count  )  [inline]

Set the count.

double count (  )  const [inline]

Get the current count.

void ReadData ( istream &  input_stream  )  [virtual]

Read the data, excluding the index, from a stream.

Implements SparseTreeNode.

void WriteData ( ostream &  output_stream  )  const [virtual]

Write the data, excluding the index, to a stream.

Implements SparseTreeNode.

void Combine ( const SparseTreeNode other  )  [virtual]

Combine data from two Bins.

To combine bins, we take the max of the sizes, and add the counts.

Implements SparseTreeNode.

const LargeIndex& index (  )  const [inline, inherited]

SparseTreeNode* parent (  )  [inline, inherited]

SparseTreeNode* prev_sibling (  )  [inline, inherited]

SparseTreeNode* next_sibling (  )  [inline, inherited]

SparseTreeNode* first_child (  )  [inline, inherited]

SparseTreeNode* last_child (  )  [inline, inherited]

void set_parent ( SparseTreeNode parent  )  [inline, inherited]

void set_prev_sibling ( SparseTreeNode sibling  )  [inline, inherited]

void set_next_sibling ( SparseTreeNode sibling  )  [inline, inherited]

void set_first_child ( SparseTreeNode child  )  [inline, inherited]

void set_last_child ( SparseTreeNode child  )  [inline, inherited]

void set_index ( const LargeIndex index  )  [inline, inherited]

bool has_parent (  )  const [inline, inherited]

bool has_prev_sibling (  )  const [inline, inherited]

bool has_next_sibling (  )  const [inline, inherited]

bool has_child (  )  const [inline, inherited]

void ReadFromStream ( istream &  input_stream  )  [inherited]

Read the data, including the index, from a stream.

Calling this will override the node's current index. The format is:

It will then call ReadData().
See also:
ReadData()

void WriteToStream ( ostream &  output_stream  )  const [inherited]

Write the data, including the index, to a stream.

This will simply write the index to the stream, followed by WriteData().

See also:
WriteData().

bool operator< ( const SparseTreeNode other  )  const [inherited]

Returns true if this node's index is smaller than that of <other>.

bool CompareNodes ( const SparseTreeNode one,
const SparseTreeNode two 
) [static, inherited]

Returns true if <one>'s index is smaller than that of <two>.


The documentation for this class was generated from the following files:
Generated on Fri Sep 21 11:39:05 2007 for libpmk2 by  doxygen 1.5.1