<commit_before>package de.lmu.ifi.dbs.index.spatial;

import de.lmu.ifi.dbs.data.NumberVector;
import de.lmu.ifi.dbs.distance.Distance;
import de.lmu.ifi.dbs.distance.distancefunction.DistanceFunction;
import de.lmu.ifi.dbs.utilities.HyperBoundingBox;

/**
 * Defines the requirements for a distance function that can used in spatial index
 * to measure the dissimilarity between spatial data objects.
 *
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 */
public interface SpatialDistanceFunction<O extends NumberVector, D extends Distance> extends DistanceFunction<O, D> {

  /**
   * Computes the minimum distance between the given MBR and the NumberVector object
   * according to this distance function.
   *
   * @param mbr the MBR object
   * @param o   the NumberVector object
   * @return the minimum distance between the given MBR and the SpatialData object
   *         according to this distance function
   */
  D minDist(HyperBoundingBox mbr, O o);

   /**
   * Computes the minimum distance between the given MBR and the NumberVector object
   * with the given id according to this distance function.
   *
   * @param mbr the MBR object
   * @param id   the id of the NumberVector object
   * @return the minimum distance between the given MBR and the SpatialData object
   *         according to this distance function
   */
  D minDist(HyperBoundingBox mbr, Integer id);

  /**
   * Computes the distance between the two given MBRs
   * according to this distance function.
   *
   * @param mbr1 the first MBR object
   * @param mbr2 the second MBR object
   * @return the distance between the two given MBRs according to this distance function
   */
  D distance(HyperBoundingBox mbr1, HyperBoundingBox mbr2);

  /**
   * Computes the distance between the centroids of the two given MBRs
   * according to this distance function.
   *
   * @param mbr1 the first MBR object
   * @param mbr2 the second MBR object
   * @return the distance between the centroids of the two given MBRs
   *         according to this distance function<commit_msg>generifying<commit_after>package de.lmu.ifi.dbs.index.spatial;

import de.lmu.ifi.dbs.data.FeatureVector;
import de.lmu.ifi.dbs.distance.Distance;
import de.lmu.ifi.dbs.distance.distancefunction.DistanceFunction;
import de.lmu.ifi.dbs.utilities.HyperBoundingBox;

/**
 * Defines the requirements for a distance function that can used in spatial index
 * to measure the dissimilarity between spatial data objects.
 *
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 */
public interface SpatialDistanceFunction<O extends FeatureVector, D extends Distance> extends DistanceFunction<O, D> {

  /**
   * Computes the minimum distance between the given MBR and the NumberVector object
   * according to this distance function.
   *
   * @param mbr the MBR object
   * @param o   the NumberVector object
   * @return the minimum distance between the given MBR and the SpatialData object
   *         according to this distance function
   */
  D minDist(HyperBoundingBox mbr, O o);

  /**
   * Computes the minimum distance between the given MBR and the NumberVector object
   * with the given id according to this distance function.
   *
   * @param mbr the MBR object
   * @param id  the id of the NumberVector object
   * @return the minimum distance between the given MBR and the SpatialData object
   *         according to this distance function
   */
  D minDist(HyperBoundingBox mbr, Integer id);

  /**
   * Computes the distance between the two given MBRs
   * according to this distance function.
   *
   * @param mbr1 the first MBR object
   * @param mbr2 the second MBR object
   * @return the distance between the two given MBRs according to this distance function
   */
  D distance(HyperBoundingBox mbr1, HyperBoundingBox mbr2);

  /**
   * Computes the distance between the centroids of the two given MBRs
   * according to this distance function.
   *
   * @param mbr1 the first MBR object
   * @param mbr2 the second MBR object
   * @return the distance between the centroids of the two given MBRs
   *         according to this distance function
{'fraction_non_alphanumeric': 0.06866537717601548, 'fraction_numerical': 0.0029013539651837525, 'mean_word_length': 3.4724324324324325, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461598', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1161, 'n_words': 475}