code: public double optFmeasure(int recall) {
      double max = 0;
      for (int i = 0; i < (recall + 1); i++) {
        double f = fmeasure(i, recall - i);
        if (f > max) {
          max = f;
        }
      }
      return max;
    }
docs: what is the optimal f-measure we can achieve given recall guesses
  using the optimal monotonic function