GlobalVGPyramidMaker Class Reference

#include <global-vg-pyramid-maker.h>

Inheritance diagram for GlobalVGPyramidMaker:

VGPyramidMaker PyramidMaker List of all members.

Detailed Description

Makes pyramids with bin sizes determined by a particular set of points.


Public Member Functions

 GlobalVGPyramidMaker (const HierarchicalClusterer &clusterer, const DistanceComputer &distance_computer)
 ~GlobalVGPyramidMaker ()
void Preprocess (const PointSetList &point_sets)
 Initialize the global bin sizes.
virtual MultiResolutionHistogramMakePyramid (const PointSet &point_set)
 Turn a single PointSet into a MultiResolutionHistogram.
void ReadFromStream (istream &input_stream)
 Initialize the global bin sizes.
void ReadFromFile (const char *filename)
 Initialize the global bin sizes.
void WriteToStream (ostream &output_stream) const
 Write the global bin sizes to a stream.
void WriteToFile (const char *filename) const
 Write the global bin sizes to a file.
vector< MultiResolutionHistogram * > MakePyramids (const PointSetList &psl)
 Turn a list of PointSets into a bunch of MultiResolutionHistograms.

Protected Member Functions

virtual bool GetMembershipPath (const Point &f, LargeIndex *out_path, vector< double > *out_distances)
 Get the membership data relative to the global pyramid data.

Protected Attributes

const HierarchicalClustererclusterer_
const Tree< PointTreeNode > & centers_
 The centers extracted from clusterer_.
const DistanceComputerdistance_computer_


Constructor & Destructor Documentation

GlobalVGPyramidMaker ( const HierarchicalClusterer clusterer,
const DistanceComputer distance_computer 
)

~GlobalVGPyramidMaker (  ) 


Member Function Documentation

void Preprocess ( const PointSetList point_sets  ) 

Initialize the global bin sizes.

This takes O(n^2) time, where n is the total number of points in <point_sets>. This is because at the top level bin, it computes the furthest pair between any of the two points to set the bin size.

Rather than doing this every single time, you may also call ReadFromStream() which will read already-preprocessed data.

MultiResolutionHistogram * MakePyramid ( const PointSet point_set  )  [virtual]

Turn a single PointSet into a MultiResolutionHistogram.

This function allocates memory on its own. It is up to the caller to free it.

Implements VGPyramidMaker.

void ReadFromStream ( istream &  input_stream  ) 

Initialize the global bin sizes.

Can be called in lieu of Preprocess(). Aborts if the stream is bad.

void ReadFromFile ( const char *  filename  ) 

Initialize the global bin sizes.

See also:
ReadFromStream

void WriteToStream ( ostream &  output_stream  )  const

Write the global bin sizes to a stream.

This output file format is not compatible with that of libpmk-1.x.

Stream format:

Requires Preprocess() or ReadFromStream() to be called first. Aborts if the stream is bad.

void WriteToFile ( const char *  filename  )  const

Write the global bin sizes to a file.

See also:
WriteToStream

bool GetMembershipPath ( const Point f,
LargeIndex out_path,
vector< double > *  out_distances 
) [protected, virtual]

Get the membership data relative to the global pyramid data.

This function is overridden so that only paths that were present in the point sets that this was constructed with can appear. Otherwise, this function does the same thing as its parent VGPyramidMaker::GetMembershipPath().

See also:
VGPyramidMaker::GetMembershipPath()

Reimplemented from VGPyramidMaker.

vector< MultiResolutionHistogram * > MakePyramids ( const PointSetList psl  )  [inherited]

Turn a list of PointSets into a bunch of MultiResolutionHistograms.

It is up to the caller to free the memory.


Member Data Documentation

const HierarchicalClusterer& clusterer_ [protected, inherited]

const Tree<PointTreeNode>& centers_ [protected, inherited]

The centers extracted from clusterer_.

const DistanceComputer& distance_computer_ [protected, inherited]


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