private static int[] flatten(Set<Integer>[] algn){
  int[] flatArr=new int[algn.length];
  for (int i=0; i < flatArr.length; ++i) {
    if (algn[i] == null)     continue;
    List<Integer> points=new ArrayList<>(algn[i]);
    int al=0;
    for (int j=0, sz=Math.min(MAX_FERTILITY,points.size()); j < sz; ++j) {
      int pos=(points.get(j) + 1) << (j * 8);
      al|=pos;
    }
    flatArr[i]=al;
  }
  return flatArr;
}

private static int [ ] flatten ( Set < Integer > [ ] algn ) { int [ ] flatArr = new int [ algn . length ] ; for ( int i = 0 ; i < flatArr . length ; ++ i ) { if ( algn [ i ] == null ) continue ; List < Integer > points = new ArrayList < > ( algn [ i ] ) ; int al = 0 ; for ( int j = 0 , sz = Math . min ( MAX_FERTILITY , points . size ( ) ) ; j < sz ; ++ j ) { int pos = ( points . get ( j ) + 1 ) << ( j * 8 ) ; al |= pos ; } flatArr [ i ] = al ; } return flatArr ; }
compress a set of alignment links into an integer array . links are stored as 1 - indexed 8 - bit integers so that 0 indicates an unaligned word .
