PointSet Class Reference

#include <point-set.h>

List of all members.


Detailed Description

A data structure representing a list of Feature vectors.

All features in the set must have the same dimension, and this is determined when the PointSet is constructed. Features may be added, removed, and replaced by index. Bounds checking is done automatically, as is checking that any new Features added to the PointSet have the same dimension.


Public Member Functions

 PointSet (int feature_dim)
 Creates an initially empty set (such that GetNumFeatures() == 0).
int GetNumFeatures () const
int GetFeatureDim () const
Feature GetFeature (int index) const
 Returns a copy of the feature at <index>.
Featureoperator[] (int index)
 Returns a reference to the feature at <index>.
const Featureoperator[] (int index) const
 Returns a const reference to the feature at <index>.
void AddFeature (const Feature &feature)
 Adds a copy of the feature to the end of the list.
void RemoveFeature (int index)
 Removes the feature at <index>.
void SetFeature (int index, const Feature &feature)
 Replaces the Feature at <index> with a copy of <feature>.
void WriteToStream (ostream &output_stream) const
 Writes the point set to a stream.
void ReadFromStream (istream &input_stream)
 Reads the point set from a stream.


Constructor & Destructor Documentation

PointSet ( int  feature_dim  ) 

Creates an initially empty set (such that GetNumFeatures() == 0).


Member Function Documentation

int GetNumFeatures (  )  const

int GetFeatureDim (  )  const

Feature GetFeature ( int  index  )  const

Returns a copy of the feature at <index>.

Feature & operator[] ( int  index  ) 

Returns a reference to the feature at <index>.

const Feature & operator[] ( int  index  )  const

Returns a const reference to the feature at <index>.

void AddFeature ( const Feature feature  ) 

Adds a copy of the feature to the end of the list.

void RemoveFeature ( int  index  ) 

Removes the feature at <index>.

void SetFeature ( int  index,
const Feature feature 
)

Replaces the Feature at <index> with a copy of <feature>.

void WriteToStream ( ostream &  output_stream  )  const

Writes the point set to a stream.

The format is as follows:

void ReadFromStream ( istream &  input_stream  ) 

Reads the point set from a stream.

This function will clear any Features present currently. It will also assume that the incoming PointSet has the proper feature dim (observe that a serialized PointSet doesn't actually record feature dim-- that is up to PointSetList to remember).


The documentation for this class was generated from the following files:
Generated on Wed May 2 11:17:13 2007 for libpmk by  doxygen 1.5.1