Package gnu.trove.list.array

Examples of gnu.trove.list.array.TIntArrayList.toArray()


            for (int j = 0; j < n; j++) {
                if (matrix[i][j]) {
          values.add(j);
                }
            }
      succ[i] = VF.enumerated("succ_"+i,values.toArray(),solver);
        }
        solver.post(ICF.circuit(succ,0));
    }

    @Override
View Full Code Here


            while ((line = r.readLine()) != null) {
                Scanner sc = new Scanner(line);
                while (sc.hasNextInt()) {
                    values.add(sc.nextInt());
                }
                ints.add(values.toArray());
                values.clear();
            }
            int[][] data = new int[ints.size()][];
            for (int i = 0; i < ints.size(); i++) {
                data[i] = ints.get(i);
View Full Code Here

                values.add(sc.nextInt());
                values.add(sc.nextInt());
                sc.next();
                values.add(sc.next().equals("=") ? 0 : 1);
                values.add(sc.nextInt());
                ints.add(values.toArray());
                values.clear();
            }
            int[][] data = new int[ints.size()][];
            for (int i = 0; i < ints.size(); i++) {
                data[i] = ints.get(i);
View Full Code Here

          l.add(j+offset);
        }
      }
      if(l.isEmpty())throw new UnsupportedOperationException();
      if(enumerated){
        succ[i] = VF.enumerated("suc",l.toArray(),solver);
      }else{
        succ[i] = VF.bounded("suc",offset,n+offset,solver);
        solver.post(ICF.member(succ[i],l.toArray()));
      }
    }
View Full Code Here

      if(l.isEmpty())throw new UnsupportedOperationException();
      if(enumerated){
        succ[i] = VF.enumerated("suc",l.toArray(),solver);
      }else{
        succ[i] = VF.bounded("suc",offset,n+offset,solver);
        solver.post(ICF.member(succ[i],l.toArray()));
      }
    }
    succ[n-1] = VF.fixed(n+offset,solver);
    solver.post(ICF.path(succ,VF.fixed(offset,solver),VF.fixed(n-1+offset,solver),offset));
    // configure solver
View Full Code Here

                resultList.add(itmp);
            }
            cursor++;
        }

        return resultList.toArray();
    }

    public void addListener(BasisListener listener) {
        this.listeners.add(listener);
    }
View Full Code Here

   
    System.out.println();
    TIntArrayList www = new TIntArrayList();
    for(int i=0;i<100;i++){
    www.add(1);
    w = www.toArray();
    e = MyArrays.entropy(w);   
    System.out.print(e + " ");
    System.out.println(e/w.length);
    }
    System.out.println();
View Full Code Here

    for(String s: str){
      int i = fa.lookupIndex(s,ysize);
      if(i!=-1)
        indices.add(i);
    }
    return indices.toArray();
  }

  private void doNext(String action,JointParsingState state){
    char act = action.charAt(0);
    String relation = action.substring(1);
View Full Code Here

      if (set.add(a)) {
        list.add(a);
      }
    }

    return list.toArray();
  }

  /**
   * Deduplicates an array in linear time, it does not change the order of the
   * elements. Note that equals and hashcode must be overridden for this to
View Full Code Here

      } else {
        i++;
      }
    }

    return lst.toArray();
  }

  /**
   * Computes the intersection of two <b>unsorted</b> arrays. Will deduplicate
   * the items, so the return is a set of integers.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.