private fun exactMinMax(relation: Relation<O>, distFunc: DistanceQuery<O>): DoubleMinMax? { val progress: FiniteProgress? = if (LOG.isVerbose()) FiniteProgress( "Exact fitting distance computations", relation.size(), LOG ) else null val minmax = DoubleMinMax() val iditer: DBIDIter = relation.iterDBIDs() while (iditer.valid()) { val iditer2: DBIDIter = relation.iterDBIDs() while (iditer2.valid()) { if (DBIDUtil.equal(iditer, iditer2)) { iditer2.advance() continue } val d: Double = distFunc.distance(iditer, iditer2) minmax.put(d) iditer2.advance() } LOG.incrementProcessed(progress) iditer.advance() } LOG.ensureCompleted(progress) return minmax }
Compute the exact maximum and minimum .