Returns the knn distance of the object with the specified id.

@param object the query object
@return the knn distance of the object with the specified id
184769
private double[] knnDistances(O object) {
    KNNList knns = knnq.getKNNForObject(object, getKmax() - 1);
    double[] distances = new double[getKmax()];
    int i = 0;
    for(DoubleDBIDListIter iter = knns.iter(); iter.valid() && i < getKmax(); iter.advance(), i++) {
      distances[i] = iter.doubleValue();
    }
    return distances;
  }
986725
private boolean kNNABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) {
    DistanceQuery<V> dq = db.getDistanceQuery(relation, SquaredEuclideanDistanceFunction.STATIC);
    KNNQuery<V> knnq = db.getKNNQuery(dq, DatabaseQuery.HINT_OPTIMIZED_ONLY);
    boolean squared = true;
    if(knnq == null) {
      dq = db.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC);
      knnq = db.getKNNQuery(dq, DatabaseQuery.HINT_OPTIMIZED_ONLY);
      if(knnq == null) {
        return false;
      }
      squared = false;
    }
    SimilarityQuery<V> lk = db.getSimilarityQuery(relation, LinearKernelFunction.STATIC);
    int k1 = k + 1; // We will get the query point back by the knnq.

    MeanVariance s = new MeanVariance();
    for(DBIDIter pA = ids.iter(); pA.valid(); pA.advance()) {
      KNNList nl = knnq.getKNNForDBID(pA, k1);
      double simAA = lk.similarity(pA, pA);

      s.reset();
      DoubleDBIDListIter iB = nl.iter(), iC = nl.iter();
      for(; iB.valid(); iB.advance()) {
        double dAB = iB.doubleValue();
        double simAB = lk.similarity(pA, iB);
        if(!(dAB > 0.)) {
          continue;
        }
        for(iC.seek(iB.getOffset() + 1); iC.valid(); iC.advance()) {
          double dAC = iC.doubleValue();
          double simAC = lk.similarity(pA, iC);
          if(!(dAC > 0.)) {
            continue;
          }
          // Exploit bilinearity of scalar product:
          // <B-A, C-A> = <B, C-A> - <A,C-A>
          // = <B,C> - <B,A> - <A,C> + <A,A>
          double simBC = lk.similarity(iB, iC);
          double numerator = simBC - simAB - simAC + simAA;
          if(squared) {
            double div = 1. / (dAB * dAC);
            s.put(numerator * div, FastMath.sqrt(div));
          }
          else {
            double sqrtdiv = 1. / (dAB * dAC);
            s.put(numerator * sqrtdiv * sqrtdiv, sqrtdiv);
          }
        }
      }
      final double abof = s.getNaiveVariance();
      minmaxabod.put(abof);
      abodvalues.putDouble(pA, abof);
    }
    return true;
  }
19599
public static int find(Array array, Object object) {
	int len = array.size();
	for (int i = 1; i <= len; i++) {
	    Object tmp = array.get(i, null);
	    try {
		if (tmp != null && Operator.compare(object, tmp) == 0) return i;
	    }
	    catch (PageException e) {}
	}
	return 0;
    }
827249
@Override
    public IDocumentQuery<T> withinRadiusOf(String fieldName, double radius, double latitude, double longitude) {
        return withinRadiusOf(fieldName, radius, latitude, longitude, null, Constants.Documents.Indexing.Spatial.DEFAULT_DISTANCE_ERROR_PCT);
    }
1222766
public static String objectId(Object object) {
        if (object == null) {
            return "?";
        }
        if (object instanceof IdInfoProvider) {
            return getId(((IdInfoProvider) object).idScope(),
                ((IdInfoProvider) object).idObject());
        } else {
            return getId(object.getClass(), object);
        }
    }
996228
public static final Function<Integer,Boolean> eq(final Integer object) {
        return (Function<Integer,Boolean>)((Function)FnObject.eq(object));
    }
119158
@Override
	@Pure
	public double getDistance(Point2D<?, ?> point) {
		double dist = super.getDistance(point);
		dist -= this.radius;
		return dist;
	}
794076
public List<Pair<Double, Integer>> queryWithDistances(INDArray query, int numResults) {
            return RPUtils.queryAllWithDistances(query,X,Arrays.asList(this),numResults,similarityFunction);
    }
573656
private Integer getUniqueId(Object object) {
    Integer id = idCache.get(object);
    if (id == null) {
      id = uidGenerator.incrementAndGet();
      Integer existing = idCache.putIfAbsent(object, id);
      if (existing != null) {
        return existing;
      }
    }
    return id;
  }
1123184
public double[] get(T object) {
    double[] v = map.get(object);
    if(v == null) {
      return null;
    }
    return v.clone();
  }
445511
@SuppressWarnings("unchecked")
public int compareTo(Object object)
   {
      if(!(object instanceof Subject))
         return -1;
      
      Subject<T> subject = (Subject<T>)object;
      
      return this.name.compareTo(subject.getName());
   }
313792
public int compareTo(Object object) {
        if (image != null)
            return 0;
        if (object == null) {
            return -1;
        }
        PdfFont pdfFont;
        try {
            pdfFont = (PdfFont) object;
            if (font != pdfFont.font) {
                return 1;
            }
            if (this.size() != pdfFont.size()) {
                return 2;
            }
            return 0;
        }
        catch(ClassCastException cce) {
            return -2;
        }
    }
1118040
public PropertyIdValue copy(PropertyIdValue object) {
		return dataObjectFactory.getPropertyIdValue(object.getId(), object.getSiteIri());
	}
165677
public static String getIdString(Object object) {
		if (object == null) {
			throw new NullPointerException();
		}
		return String.valueOf(getId(object));
	}
935309
public static NameSpace getThisNS(Object object) {
        if (null == object)
            return null;
        Class<?> type = object.getClass();
        if (!isGeneratedClass(type))
            return null;
        try {
            return getClassInstanceThis(object, type.getSimpleName()).namespace;
        } catch (Exception e) {
            return null;
        }
    }
954749
public static <T> int deleteObject(T object)
    {
        return SqlClosure.sqlExecute(c ->  OrmElf.deleteObject(c, object));
    }
1296465
protected double distance(DBIDRef a, DBIDRef b) {
    ++distComputations;
    return distanceQuery.distance(a, b);
  }