damina::Point Class Reference

Encapsulates a Point for feature vector representaion of data. More...

#include <Point.h>

Collaboration diagram for damina::Point:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void add (Feature *)
 Append a feature to the point.
virtual Featurefirst ()
 Returns the first feature of the point.
virtual Featureget (int)
 Returns the specified feature of the point.
virtual double getLabel ()
 Returns the label currently assigned to the point.
virtual unsigned long int getSize ()
 Returns the number of the elements in the point.
virtual Featurelast ()
 Returns the last feature of the point.
virtual Featurenext ()
 Increments the point iterator and return the corresponding feature.
 Point (double)
 Point ()
 Constructor.
virtual Featureprevious ()
 Decrements the point iterator and return the corresponding feature.
virtual void setLabel (double)
 Set the label (class) for the point.
virtual ~Point ()
 Destructor.

Private Attributes

vector< Feature * >::iterator it
 An iterator over the point.
double label
 Label indicates the class the point belong to.
vector< Feature * > point
 The point representation.

Detailed Description

Encapsulates a Point for feature vector representaion of data.

We use the Vector Document Model, in which each object is represented by a point in a vector space. So, a point is a features vector.

Author:
Vincenzo Russo - vincenzo.russo@neminis.org

Definition at line 21 of file Point.h.


Constructor & Destructor Documentation

damina::Point::Point (  ) 

Constructor.

Definition at line 9 of file Point.cpp.

00009                      {
00010         }

damina::Point::Point ( double   ) 

damina::Point::~Point (  )  [virtual]

Destructor.

Before destroy a point we have to destroy its features first.

Definition at line 17 of file Point.cpp.

References point.

00017                       {
00018                 vector<Feature *>::iterator dataIterator;
00019                 
00020                 /* iterating over the features to destory them  */
00021                 for (dataIterator == point.begin(); dataIterator < point.end(); dataIterator++) {
00022                         delete *dataIterator;
00023                 }
00024         }


Member Function Documentation

void damina::Point::add ( Feature f  )  [virtual]

Append a feature to the point.

Parameters:
f The feature to add

Definition at line 31 of file Point.cpp.

References point.

00031                                   {
00032                 point.push_back(f);
00033         }

Feature * damina::Point::first (  )  [virtual]

Returns the first feature of the point.

Returns:
The reference to the first feature of the point

Definition at line 60 of file Point.cpp.

References it, and point.

00060                               {
00061                 it = point.begin();
00062                 return *it;
00063         }

Feature * damina::Point::get ( int  index  )  [virtual]

Returns the specified feature of the point.

Parameters:
index The position occupied in the point of the feature to get
Returns:
The feature in the "index" position of the point

Definition at line 112 of file Point.cpp.

References point.

Referenced by damina::OneClassSVM::trainingSetToProblem().

00112                                      {
00113                 return this->point[index];
00114         } 

Here is the caller graph for this function:

double damina::Point::getLabel (  )  [virtual]

Returns the label currently assigned to the point.

Returns:
A double precision floating point value representing the label

Definition at line 50 of file Point.cpp.

References label.

Referenced by damina::OneClassSVM::trainingSetToProblem().

00050                                {
00051                 return label;
00052         }

Here is the caller graph for this function:

unsigned long int damina::Point::getSize (  )  [virtual]

Returns the number of the elements in the point.

Returns:
The number of features representing the point

Definition at line 101 of file Point.cpp.

References point.

Referenced by damina::OneClassSVM::trainingSetToProblem().

00101                                          {
00102                 return this->point.size();
00103         }

Here is the caller graph for this function:

Feature * damina::Point::last (  )  [virtual]

Returns the last feature of the point.

Returns:
The reference to the last feature of the point

Definition at line 70 of file Point.cpp.

References it, and point.

00070                              {
00071                 it = point.end();
00072                 return *it;
00073         }

Feature * damina::Point::next (  )  [virtual]

Increments the point iterator and return the corresponding feature.

Returns:
The reference to the next feature of the point

Definition at line 80 of file Point.cpp.

References it.

00080                              {
00081                 it++;
00082                 return *it;
00083         }

Feature * damina::Point::previous (  )  [virtual]

Decrements the point iterator and return the corresponding feature.

Returns:
The reference to the previous feature of the point

Definition at line 90 of file Point.cpp.

References it.

00090                                  {
00091                 it--;
00092                 return *it;
00093         }

void damina::Point::setLabel ( double  l  )  [virtual]

Set the label (class) for the point.

Parameters:
l The label to set

Definition at line 41 of file Point.cpp.

References label.

00041                                      {
00042                 label = l;
00043         }


Member Data Documentation

vector<Feature *>::iterator damina::Point::it [private]

An iterator over the point.

Definition at line 32 of file Point.h.

Referenced by first(), last(), next(), and previous().

double damina::Point::label [private]

Label indicates the class the point belong to.

Definition at line 37 of file Point.h.

Referenced by getLabel(), and setLabel().

vector<Feature *> damina::Point::point [private]

The point representation.

Definition at line 27 of file Point.h.

Referenced by add(), first(), get(), getSize(), last(), and ~Point().


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 22:27:02 2007 for SVClustering by  doxygen 1.5.2