Package gnu.trove.list.array

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


        boolean[][] matrix = HCP_Utils.generateKingTourInstance(40);
        int n = matrix.length;
    succ = new IntVar[n];
    TIntArrayList values = new TIntArrayList();
        for (int i = 0; i < n; i++) {
      values.clear();
            for (int j = 0; j < n; j++) {
                if (matrix[i][j]) {
          values.add(j);
                }
            }
View Full Code Here


                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());
                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

    // build model
    IntVar[] succ = new IntVar[n];
    int offset = -5;
    TIntArrayList l = new TIntArrayList();
    for (int i = 0; i < n-1; i++) {
      l.clear();
      for (int j = 0; j < n; j++) {
        if(matrix[i][j]){
          l.add(j+offset);
        }
      }
View Full Code Here

      int currentId = i.key();
      Rectangle currentRectangle = i.value();
      float distance = currentRectangle.distance(p);
      if (distance < nearestDistance) {
        nearestDistance = distance;
        ret.clear();        
      }
      if (distance <= nearestDistance) {
        ret.add(currentId)
      }
    }
View Full Code Here

    assertEquals( 3, list.size() );
    assertEquals( 2, list.get( 0 ) );
    assertEquals( 5, list.get( 1 ) );
    assertEquals( 6, list.get( 2 ) );

    list.clear();
    assertTrue( wrapped_list.isEmpty() );

    wrapped_list.add( Integer.valueOf( 7 ) );
    assertEquals( 1, list.size() );
    assertEquals( 7, list.get( 0 ) );
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.