/** * Select the best coordinates * * @param ps template points * @param coords best coordinates (updated by this method) * @param macrocycle the macrocycle * @param ringset rest of the ring system * @return offset into the coordinates */ private int selectCoords(Collection<Point2d[]> ps, Point2d[] coords, IRing macrocycle, IRingSet ringset) { assert ps.size() != 0; final int[] winding = new int[coords.length]; MacroScore best = null; for (Point2d[] p : ps) { final int wind = winding(p, winding); MacroScore score = bestScore(macrocycle, ringset, wind, winding); if (score.compareTo(best) < 0) { best = score; System.arraycopy(p, 0, coords, 0, p.length); } } // never null return best != null ? best.offset : 0; }
MacroScore score = new MacroScore(i, nConcaveHetero, nCorrectStereo, nRingClick); if (score.compareTo(best) < 0) { best = score;
MacroScore score = new MacroScore(i, nConcaveHetero, nCorrectStereo, nRingClick); if (score.compareTo(best) < 0) { best = score;
/** * Select the best coordinates * * @param ps template points * @param coords best coordinates (updated by this method) * @param macrocycle the macrocycle * @param ringset rest of the ring system * @return offset into the coordinates */ private int selectCoords(Collection<Point2d[]> ps, Point2d[] coords, IRing macrocycle, IRingSet ringset) { assert ps.size() != 0; final int[] winding = new int[coords.length]; MacroScore best = null; for (Point2d[] p : ps) { final int wind = winding(p, winding); MacroScore score = bestScore(macrocycle, ringset, wind, winding); if (score.compareTo(best) < 0) { best = score; System.arraycopy(p, 0, coords, 0, p.length); } } // never null return best != null ? best.offset : 0; }