damina::DataSet Class Reference

A class which is useful for manage both Training Sets and Test Sets. More...

#include <DataSet.h>

Collaboration diagram for damina::DataSet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void add (Point *)
 Add a Point to the dataset.
 DataSet ()
 Constructor.
virtual Pointfirst ()
 Returns the first point in dataset.
virtual Pointget (int)
 Returns the specified point in the dataset.
virtual unsigned long int getSize ()
 Returns the Dataset Size.
virtual Pointlast ()
 Returns the last point in dataset.
virtual Pointnext ()
 Increments the Dataset iterator and return the corresponding point.
virtual Pointprevious ()
 Decrementes the Dataset iterator and return the corresponding point.
virtual ~DataSet ()
 Destructor.

Private Attributes

vector< Point * > data
 The data.
vector< Point * >::iterator it
 The iterator over the data.

Detailed Description

A class which is useful for manage both Training Sets and Test Sets.

Both Training Set and Test Set are data sets formed by points and them relative labels. So, this class is just implemented as a vector of Point, because each Point embeds its own label.

See also:
Point

Definition at line 24 of file DataSet.h.


Constructor & Destructor Documentation

damina::DataSet::DataSet (  ) 

Constructor.

Definition at line 9 of file DataSet.cpp.

00009                          {
00010                 
00011         }

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

Destructor.

We need to destroy all Points in dataset before destroy dataset itself

Definition at line 18 of file DataSet.cpp.

References data.

00018                           {
00019                 vector<Point *>::iterator dataIterator;
00020                 
00021                 for (dataIterator == data.begin(); dataIterator < data.end(); dataIterator++) {
00022                         delete *dataIterator;
00023                 }
00024         }


Member Function Documentation

void damina::DataSet::add ( Point p  )  [virtual]

Add a Point to the dataset.

Parameters:
p The point to add

Definition at line 31 of file DataSet.cpp.

References data.

00031                                   {
00032                 data.push_back(p);
00033         }

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

Returns the first point in dataset.

Returns:
The first point in dataset

Definition at line 41 of file DataSet.cpp.

References data, and it.

00041                               {
00042                 it = data.begin();
00043                 return *it;
00044         }

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

Returns the specified point in the dataset.

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

Definition at line 93 of file DataSet.cpp.

References data.

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

00093                                      {
00094                 return data[index];
00095         }

Here is the caller graph for this function:

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

Returns the Dataset Size.

Returns:
An integer value corresponding to the size

Definition at line 82 of file DataSet.cpp.

References data.

Referenced by damina::SVClustering::SVClustering(), and damina::OneClassSVM::trainingSetToProblem().

00082                                            {
00083                 return data.size();
00084         }

Here is the caller graph for this function:

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

Returns the last point in dataset.

Returns:
The last point in dataset

Definition at line 51 of file DataSet.cpp.

References data, and it.

00051                              {
00052                 it = data.end();
00053                 return *it;
00054         }

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

Increments the Dataset iterator and return the corresponding point.

Returns:
The reference to the next point in the dataset

Definition at line 61 of file DataSet.cpp.

References it.

00061                              {
00062                 it++;
00063                 return *it; 
00064         }

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

Decrementes the Dataset iterator and return the corresponding point.

Returns:
The reference to the previous point in the dataset

Definition at line 71 of file DataSet.cpp.

References it.

00071                                  {
00072                 it--;
00073                 return *it;
00074         }


Member Data Documentation

vector<Point *> damina::DataSet::data [private]

The data.

Definition at line 30 of file DataSet.h.

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

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

The iterator over the data.

Definition at line 35 of file DataSet.h.

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


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