code: private void linearScan(Relation<? extends O> relation, DBIDIter iter, O obj, double range, ModifiableDoubleDBIDList result) {
      while(iter.valid()) {
        final double similarity = rawsim.similarity(obj, relation.get(iter));
        if(similarity >= range) {
          result.add(similarity, iter);
        }
        iter.advance();
      }
    }
docs: Main loop for linear scan,
  
  @param relation Data relation
  @param iter Iterator
  @param obj Query object
  @param range Query radius
  @param result Output data structure