Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel
Class ArbitraryKernelFunctionWrapper<O extends FeatureVector<O,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractKernelFunction<O,DoubleDistance>
                  extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.ArbitraryKernelFunctionWrapper<O>
Type Parameters:
O - object type
All Implemented Interfaces:
DistanceFunction<O,DoubleDistance>, MeasurementFunction<O,DoubleDistance>, KernelFunction<O,DoubleDistance>, SimilarityFunction<O,DoubleDistance>, Parameterizable

public class ArbitraryKernelFunctionWrapper<O extends FeatureVector<O,?>>
extends AbstractKernelFunction<O,DoubleDistance>

Provides a wrapper for arbitrary kernel functions whose kernel matrix has been precomputed.

Author:
Simon Paradies

Field Summary
private  KernelMatrix<O> kernelMatrix
          The global kernel Matrix.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
distanceFactory
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
ArbitraryKernelFunctionWrapper()
          Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed.
 
Method Summary
 DoubleDistance distance(Integer id1, Integer id2)
          Returns the distance between the two objects specified by their object ids.
 DoubleDistance distance(O o1, O o2)
          Returns the distance between the two specified objects.
 void setDatabase(Database<O> database)
          Set the database that holds the associations for the DatabaseObject for which the measurements should be computed.
 DoubleDistance similarity(O o1, O o2)
          Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.kernel.AbstractKernelFunction
similarity, similarity
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance, valueOf
 

Field Detail

kernelMatrix

private KernelMatrix<O extends FeatureVector<O,?>> kernelMatrix
The global kernel Matrix.

Constructor Detail

ArbitraryKernelFunctionWrapper

public ArbitraryKernelFunctionWrapper()
Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed.

Method Detail

similarity

public DoubleDistance similarity(O o1,
                                 O o2)
Provides a wrapper for arbitrary kernel functions whose kernel matrix has already been precomputed. Returns the value that is stored in the kernel matrix which itself is stored in the database.

Parameters:
o1 - first vector
o2 - second vector
Returns:
the linear kernel similarity which is stored in the Global Database

distance

public DoubleDistance distance(O o1,
                               O o2)
Returns the distance between the two specified objects.

Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the distance between the two object specified by their object ids

distance

public DoubleDistance distance(Integer id1,
                               Integer id2)
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceFunction<O extends FeatureVector<O,?>,DoubleDistance>
Overrides:
distance in class AbstractDistanceFunction<O extends FeatureVector<O,?>,DoubleDistance>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

setDatabase

public void setDatabase(Database<O> database)
Description copied from interface: MeasurementFunction
Set the database that holds the associations for the DatabaseObject for which the measurements should be computed.

Specified by:
setDatabase in interface MeasurementFunction<O extends FeatureVector<O,?>,DoubleDistance>
Overrides:
setDatabase in class AbstractMeasurementFunction<O extends FeatureVector<O,?>,DoubleDistance>
Parameters:
database - Database

Release 0.3 (2010-03-31_1612)