Observation Class Reference
[Spaces]

Position features, a vector of PosiFeature (position feature) sorted by x and with null PosiFeature. More...

#include <R2.h>

Inheritance diagram for Observation:

PosiFeatures

List of all members.

Public Member Functions

 Observation ()
 Default constructor.
 Observation (int ID)
 id constructor.
 Observation (const PosiFeatures &p, int ID)
 Complete constructor.
 Observation (const Observation &f)
 Copy constructor.
 Observation (stringstream &ss)
 Stringstream constructor.
Observationoperator= (const Observation &f)
 Assignment operator =.
string print () const
 print the PosiFeature on a string.
int insertion (const PosiFeature &p)
 Insert a PosiFeature.
bool find (const PosiFeature &p, int &position)
 Find PosiFeature p in the vector. If not present.
bool find (const int id, int &position)
 Find PosiFeature with id p in the vector. If not present.
void init ()
 init function.
string exportAsString ()
 export the Observation as a fromatted stringstream

Public Attributes

int nullFeature
 Contains the index of the PosiFeature with Position [0.0, 0.0].
int id
 Contains the id of the owner of the Observation.


Detailed Description

Position features, a vector of PosiFeature (position feature) sorted by x and with null PosiFeature.

Author:
Paolo Stegagno

Constructor & Destructor Documentation

Observation::Observation (  ) 

Default constructor.

Produce an Observation with no owner (id =-1) and only the null feature [0.0 0.0] with id -1.

Observation::Observation ( int  ID  ) 

id constructor.

Parameters:
ID integer to which the id is associated Produce an Observation with given owner (id = ID) and only the null feature [0.0 0.0] with id -1.

Observation::Observation ( const PosiFeatures p,
int  ID 
)

Complete constructor.

Parameters:
ID integer to which the id is associated
p PosiFeatures to be inserted in the vector Produce an Observation with given owner (id = ID) and only the given vector list of PosiFeature null feature [0.0 0.0] with id ID. The features are ordered by increasing x.

Observation::Observation ( const Observation f  ) 

Copy constructor.

Observation::Observation ( stringstream &  ss  ) 

Stringstream constructor.

Build an Observation from a stringstream containing a formatted string, as the one created by the method exportAsString. Format is "numFeatures id nullFeature feature1 ..."


Member Function Documentation

Observation & Observation::operator= ( const Observation f  ) 

Assignment operator =.

string Observation::print (  )  const

print the PosiFeature on a string.

int Observation::insertion ( const PosiFeature p  ) 

Insert a PosiFeature.

Insert the given PosiFeature in order of incereasing x value.

bool Observation::find ( const PosiFeature p,
int &  position 
)

Find PosiFeature p in the vector. If not present.

bool Observation::find ( const int  id,
int &  position 
)

Find PosiFeature with id p in the vector. If not present.

void Observation::init (  ) 

init function.

Note:
it is automatically set as NOT associated

string Observation::exportAsString (  ) 

export the Observation as a fromatted stringstream

format is "numFeatures id nullFeature feature1 ..."


Member Data Documentation

Contains the index of the PosiFeature with Position [0.0, 0.0].

Contains the id of the owner of the Observation.


The documentation for this class was generated from the following files:

Generated on Mon Feb 20 07:01:10 2017 for MIP by  doxygen 1.5.6