public String getLeastErrorLine(PKBean line1, PKBean line2) { if (line1 == null && line2 == null) return null; if (line1 == null) return line2.getName(); if (line2 == null) return line1.getName(); // System.err.println(line1.getErrorPercent() + " " + line2.getErrorPercent()); if (Math.abs(line1.getErrorPercent()) < Math.abs(line2.getErrorPercent())) return line1.getName(); return line2.getName(); }
public List<Polygon> getIntersections() throws InvalidBoundsException { intersectionList.clear(); circlePoints.clear(); MMLine line = mmLinesMap.get(leastErrorPKName); PKBean refPKBean = pkBeanMap.get(leastErrorPKName); // inp.setNumPts(10); Bounds bounds = new Bounds( refPKBean.getBounds().getMassMin(), refPKBean.getBounds().getMassMax(), intersectionNumPts, false); PKBean reference = new PKBean(refPKBean.getName(), refPKBean.getValue(), refPKBean.getError(), bounds); findIntersections(reference, line.getSigma()); return intersectionList; }