Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ProximityAdder< T > Class Template Reference

#include <ProximityMeasure.h>

Inheritance diagram for prapi::ProximityAdder< T >:

prapi::ProximityMeasure< T > Object List of all members.

Detailed Description

template<class T>
class prapi::ProximityAdder< T >

Adder is a wrap-up measure that just adds a constant value to the value provided by another measure.

It may be used in scaling the measured values.

Example:

 //Memory autorelease mode - no need to store a pointer to the
 //new EuclideanDiscance object
 ProximityAdder<double> adder(new EuclideanDistance<double>, -1.0);

 //No memory autorelease
 EuclideanDistance<double> dist;
 ProximityAdder<double> adder(dist, -1.0);

 //Absolutely wrong! The local variable would be automatically
 //deleted. Your program will most likely dump core.
 EuclideanDistance<double> dist;
 ProximityAdder<double> adder(&dist, -1.0); //One extra '&'.
 
This measure comes in handy when you have multiple feature vectors in each sample and need to scale the proximities.

Deprecated:
Use ProximityModifier instead
See also:
ProximityModifier , ProximityMultiplier , ProximityMatrix


Public Methods

 ProximityAdder (ProximityMeasure< T > *measure, double value)
 Create a new Adder that uses the given proximity measure.

 ProximityAdder (ProximityMeasure< T > &measure, double value)
 Create a new Adder that uses the given proximity measure.

virtual ~ProximityAdder ()
double getProximity (const util::List< T > &sample, const util::List< T > &model, double stopAfter) const throw (ProximityException&)
 Proximity between two lists.


Constructor & Destructor Documentation

template<class T>
prapi::ProximityAdder< T >::ProximityAdder ProximityMeasure< T > *    measure,
double    value
[inline]
 

Create a new Adder that uses the given proximity measure.

Note that if you use this constructor, the memory pointed by measure is automatically released upon the deletion of the Adder.

Parameters:
measure  a pointer to the actual measure to be used
value  the value to be added to measured proximities

template<class T>
prapi::ProximityAdder< T >::ProximityAdder ProximityMeasure< T > &    measure,
double    value
[inline]
 

Create a new Adder that uses the given proximity measure.

Parameters:
measure  a reference to the actual measure to be used
value  the value to be added to measured proximities


Member Function Documentation

template<class T>
double prapi::ProximityAdder< T >::getProximity const util::List< T > &    sample,
const util::List< T > &    model,
double    stopAfter
const throw (ProximityException&) [inline, virtual]
 

Proximity between two lists.

Parameters:
sample  the list to be classified
model  the model
stopAfter  A value that can be used in optimizing the performance of a proximity measure. Classifiers may set this value to inform the proximity measure to stop if it notices the proximity will be over a certain value. For example, the kNN classifier sets this value to the kth smallest proximity so far. If a sample is not closer than that, then it makes no sense to inspect it any more.

Implements prapi::ProximityMeasure< T >.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.