net.obsearch.pivots.rf03
Class AbstractIncrementalRF03<O extends OB>

java.lang.Object
  extended by net.obsearch.pivots.AbstractIncrementalPivotSelector<O>
      extended by net.obsearch.pivots.rf03.AbstractIncrementalRF03<O>
Type Parameters:
O -
N -
All Implemented Interfaces:
IncrementalPairPivotSelector<O>
Direct Known Subclasses:
RF03PivotSelectorFloat, RF03PivotSelectorLong, RF03PivotSelectorShort

public abstract class AbstractIncrementalRF03<O extends OB>
extends AbstractIncrementalPivotSelector<O>
implements IncrementalPairPivotSelector<O>

Select pairs of pivots.

Author:
amuller

Nested Class Summary
protected  class AbstractIncrementalRF03.Score
          a good pivot selection strategy should follow certain rules, but in general those pivot selection strategies that perform well (find the k-nn in the least number of iterations).
 
Field Summary
 
Fields inherited from class net.obsearch.pivots.AbstractIncrementalPivotSelector
pivotable, r
 
Constructor Summary
protected AbstractIncrementalRF03(Pivotable<O> pivotable)
           
 
Method Summary
protected abstract  double distance(O a, O b)
           
 PivotPairResult<O> generatePivotsPair(int pairCount, Index<O> index)
          Generates pivots from all the elements found in the DB.
 PivotPairResult<O> generatePivotsPair(int pairCount, cern.colt.list.LongArrayList elements, Index<O> index)
          Generates pivots from the elements (object ids) given in the array elements.
 int getDataSample()
           
 double getDesiredDistortion()
           
 double getDesiredSpread()
           
 int getRepetitions()
           
 void setDataSample(int dataSample)
           
 void setDesiredDistortion(double desiredDistortion)
           
 void setDesiredSpread(double desiredSpread)
           
 void setRepetitions(int repetitions)
           
 
Methods inherited from class net.obsearch.pivots.AbstractIncrementalPivotSelector
enableAcceptRepeated, generatePivots, generatePivots, getObject, mapId, max, select, selectO, selectUnique
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIncrementalRF03

protected AbstractIncrementalRF03(Pivotable<O> pivotable)
Method Detail

generatePivotsPair

public PivotPairResult<O> generatePivotsPair(int pairCount,
                                             Index<O> index)
                                                 throws OBException,
                                                        IllegalAccessException,
                                                        InstantiationException,
                                                        OBStorageException,
                                                        PivotsUnavailableException
Description copied from interface: IncrementalPairPivotSelector
Generates pivots from all the elements found in the DB.

Specified by:
generatePivotsPair in interface IncrementalPairPivotSelector<O extends OB>
Returns:
A list of the ids of the pivots.
Throws:
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
PivotsUnavailableException - If not all the pivots requested were found.

getRepetitions

public int getRepetitions()

setRepetitions

public void setRepetitions(int repetitions)

getDataSample

public int getDataSample()

setDataSample

public void setDataSample(int dataSample)

getDesiredSpread

public double getDesiredSpread()

setDesiredSpread

public void setDesiredSpread(double desiredSpread)

getDesiredDistortion

public double getDesiredDistortion()

setDesiredDistortion

public void setDesiredDistortion(double desiredDistortion)

generatePivotsPair

public PivotPairResult<O> generatePivotsPair(int pairCount,
                                             cern.colt.list.LongArrayList elements,
                                             Index<O> index)
                                                 throws OBException,
                                                        IllegalAccessException,
                                                        InstantiationException,
                                                        OBStorageException,
                                                        PivotsUnavailableException
Description copied from interface: IncrementalPairPivotSelector
Generates pivots from the elements (object ids) given in the array elements. Generates pivotsCount pivots.

Specified by:
generatePivotsPair in interface IncrementalPairPivotSelector<O extends OB>
Returns:
A list of the ids of the pivots.
Throws:
OBException
IllegalAccessException
InstantiationException
OBStorageException
PivotsUnavailableException

distance

protected abstract double distance(O a,
                                   O b)
                            throws OBException
Throws:
OBException


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.