Measures. More...

#include <gmeasure.h>

Inheritance diagram for GMeasure:
[legend]

Public Member Functions

 GMeasure (GSession *session, GPlugInFactory *fac)
 
virtual void Measure (size_t measure,...)=0
 
virtual void Info (size_t info,...)
 
virtual ~GMeasure (void)
 
- Public Member Functions inherited from GPlugIn
 GPlugIn (GSession *session, GPlugInFactory *fac)
 
virtual void ApplyConfig (void)
 
void InsertParam (R::RParam *param)
 
template<class T >
T * FindParam (const R::RString &name)
 
R::RCursor< R::RParamGetParams (const R::RString &cat=R::RString::Null)
 
void GetCategories (R::RContainer< R::RString, true, false > &cats)
 
virtual void Init (void)
 
virtual void CreateConfig (void)
 
virtual void Reset (void)
 
GPlugInFactoryGetFactory (void) const
 
int Compare (const GPlugIn &plugin) const
 
int Compare (const R::RString &plugin) const
 
R::RString GetName (void) const
 
R::RString GetDesc (void) const
 
GSessionGetSession (void) const
 
virtual void Done (void)
 
virtual ~GPlugIn (void)
 

Additional Inherited Members

- Protected Attributes inherited from GPlugIn
GPlugInFactoryFactory
 
GSessionSession
 
size_t Id
 

Detailed Description

Measures.

The GMeasure class provides a representation for a specific measure (ex: Similarities between profiles, similarities between documents and groups, agreement ratios between profiles, ...).

See the documentation related to GPlugIn for more general information.

Constructor & Destructor Documentation

GMeasure ( GSession session,
GPlugInFactory fac 
)

Constructor of a measure.

Parameters
sessionSession.
facPlug-in factory.
virtual ~GMeasure ( void  )
virtual

Destruct the measure.

Member Function Documentation

virtual void Measure ( size_t  measure,
  ... 
)
pure virtual

Get a measure. Each plug-in can handle several types of measure (first parameter of the method). The other parameters (including eventually the result of the measure) depend of the particular plug-in. This means that the caller must exactly know which parameters are requested by a particular plug-in. This method is intended to be called in an intensive way (in contrary of Info)

Parameters
measureType of the measure.

Suppose that the method takes two int arguments and should return a double that represents the product (measure=1) or the sum (measure=2). This method should be written:

void Measure(int measure,...)
{
va_list ap;
va_start(ap,measure);
int i=va_arg(ap,int);
int j=va_arg(ap,int);
double* d=va_arg(ap,double*);
switch(measure)
{
case 1 : (*d)=i*j; break;
case 2 : (*d)=i+j; break;
}
va_end(ap);
}

The method should be call:

GMeasure* ptr;
double d;
...
ptr->Measure(1,3,4,&d);
cout<<d<<endl;

Implemented in GMatrixMeasure.

virtual void Info ( size_t  info,
  ... 
)
virtual

Exchange a particular information with the plug-in. The other parameters (including eventually the result of the measure) depend of the particular plug-in. This means that the caller must exactly know which parameters are requested by a particular plug-in. This method is not intended to be called in an intensive way (in contrary of Measure).

Parameters
infoInformation to get.

Suppose the function should simply return a double. This method should be written:

void Info(int info,...)
{
va_list ap;
double* d=va_arg(ap,double*);
switch(info)
{
case 1 : (*d)=2; break;
case 2 : (*d)=3; break;
}
va_end(ap);
}

The method should be call:

GMeasure* ptr;
double d;
...
ptr->Info(1,&d);
cout<<d<<endl;

Reimplemented in GMatrixMeasure.