de.lmu.ifi.dbs.elki.distance.distancefunction.geo
Class DimensionSelectingLatLngDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.geo.DimensionSelectingLatLngDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable

public class DimensionSelectingLatLngDistanceFunction
extends AbstractVectorDoubleDistanceFunction

Distance function for 2D vectors in Latitude, Longitude form.


Nested Class Summary
static class DimensionSelectingLatLngDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
(package private)  int dimlat
          Latitude dimension
(package private)  int dimlng
          Longitude dimension
 
Constructor Summary
DimensionSelectingLatLngDistanceFunction(int dimlat, int dimlng)
          Constructor.
 
Method Summary
 double doubleDistance(NumberVector<?,?> o1, NumberVector<?,?> o2)
          Computes the distance between two given Objects according to this distance function.
 SimpleTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
          Get the input data type of the function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isMetric, isSymmetric
 
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
instantiate, isMetric, isSymmetric
 

Field Detail

dimlat

final int dimlat
Latitude dimension


dimlng

final int dimlng
Longitude dimension

Constructor Detail

DimensionSelectingLatLngDistanceFunction

public DimensionSelectingLatLngDistanceFunction(int dimlat,
                                                int dimlng)
Constructor.

Parameters:
dimlat - Dimension storing the latitude
dimlng - Dimension storing the longitude
Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> o1,
                             NumberVector<?,?> o2)
Description copied from interface: PrimitiveDoubleDistanceFunction
Computes the distance between two given Objects according to this distance function.

Parameters:
o1 - first Object
o2 - second Object
Returns:
the distance between two given Objects according to this distance function

getInputTypeRestriction

public SimpleTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
Description copied from interface: DistanceFunction
Get the input data type of the function.

Specified by:
getInputTypeRestriction in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
Specified by:
getInputTypeRestriction in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
Overrides:
getInputTypeRestriction in class AbstractVectorDoubleDistanceFunction
Returns:
Type restriction

Release 0.4.0 (2011-09-20_1324)