@@ -0,0 +1,1887 @@
+package tutorial.distancefunction;%0A%0Aimport de.lmu.ifi.dbs.elki.data.NumberVector;%0Aimport de.lmu.ifi.dbs.elki.data.type.SimpleTypeInformation;%0Aimport de.lmu.ifi.dbs.elki.data.type.VectorFieldTypeInformation;%0Aimport de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction;%0A%0A/*%0A This file is part of ELKI:%0A Environment for Developing KDD-Applications Supported by Index-Structures%0A%0A Copyright (C) 2011%0A Ludwig-Maximilians-Universit%C3%A4t M%C3%BCnchen%0A Lehr- und Forschungseinheit f%C3%BCr Datenbanksysteme%0A ELKI Development Team%0A%0A This program is free software: you can redistribute it and/or modify%0A it under the terms of the GNU Affero General Public License as published by%0A the Free Software Foundation, either version 3 of the License, or%0A (at your option) any later version.%0A%0A This program is distributed in the hope that it will be useful,%0A but WITHOUT ANY WARRANTY; without even the implied warranty of%0A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A GNU Affero General Public License for more details.%0A%0A You should have received a copy of the GNU Affero General Public License%0A along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0A/**%0A * Tutorial example for ELKI.%0A * %0A * See %3Ca href=%22http://elki.dbs.ifi.lmu.de/wiki/Tutorial/DistanceFunctions%22%3EDistance function tutorial%3C/a%3E%0A * %0A * @author Erich Schubert%0A */%0Apublic class TutorialDistanceFunction extends AbstractVectorDoubleDistanceFunction %7B%0A  @Override%0A  public double doubleDistance(NumberVector%3C?, ?%3E o1, NumberVector%3C?, ?%3E o2) %7B%0A    double dx = (o1.doubleValue(1) - o2.doubleValue(1));%0A    double dy = (o1.doubleValue(2) - o2.doubleValue(2));%0A    return dx * dx + Math.abs(dy);%0A  %7D%0A%0A  @Override%0A  public SimpleTypeInformation%3C? super NumberVector%3C?, ?%3E%3E getInputTypeRestriction() %7B%0A    return new VectorFieldTypeInformation%3CNumberVector%3C?, ?%3E%3E(NumberVector.class, 2);%0A  %7D%0A%7D

Add tutorial