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 ; }
Select the best coordinates