Package gnu.trove.list.array

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


    }
    MaximalWeightedClique maximalWeightedClique = new MaximalWeightedClique();
    maximalWeightedClique.setGraph(graph);
    TIntArrayList ans = maximalWeightedClique
        .findMaximumWeightedClique(weights);
    ans.sort();
    int[] arr = ans.toArray();
    int[] expected = new int[nodes];
    for (int i = 0; i < expected.length; i++) {
      expected[i] = i;
    }
View Full Code Here


        29.6900534057617 };
    MaximalWeightedClique maximalWeightedClique = new MaximalWeightedClique();
    maximalWeightedClique.setGraph(graph);
    TIntArrayList ans = maximalWeightedClique
        .findMaximumWeightedClique(weights);
    ans.sort();
    int[] arr = ans.toArray();
    int[] expected = new int[] { 0, 5 };
    Assert.assertArrayEquals("Found the wrong clique", expected, arr);
  }
View Full Code Here

    MaximalWeightedClique maximalWeightedClique = new MaximalWeightedClique();
    maximalWeightedClique.setGraph(graph);

    TIntArrayList ans = maximalWeightedClique
        .findMaximumWeightedClique(weights);
    ans.sort();
    int[] arr = ans.toArray();
    int[] expected = new int[] { 1, 2, 3 };
    Assert.assertArrayEquals("Found the wrong clique", expected, arr);

    TIntArrayList ans2 = maximalWeightedClique.findMaximumWeightedClique(
View Full Code Here

    int[] expected = new int[] { 1, 2, 3 };
    Assert.assertArrayEquals("Found the wrong clique", expected, arr);

    TIntArrayList ans2 = maximalWeightedClique.findMaximumWeightedClique(
        weights, new TIntArrayList(new int[] { 6 }));
    ans2.sort();
    int[] arr2 = ans2.toArray();
    int[] expected2 = new int[] { 3, 4, 5, 6 };
    Assert.assertArrayEquals("Found the wrong clique", expected2, arr2);

    TIntArrayList ans3 = maximalWeightedClique.findMaximumWeightedClique(
View Full Code Here

    int[] expected2 = new int[] { 3, 4, 5, 6 };
    Assert.assertArrayEquals("Found the wrong clique", expected2, arr2);

    TIntArrayList ans3 = maximalWeightedClique.findMaximumWeightedClique(
        weights, new TIntArrayList(new int[] { 6, 3 }));
    ans3.sort();
    int[] arr3 = ans3.toArray();
    int[] expected3 = new int[] { 1, 2, 3 };
    Assert.assertArrayEquals(
        "Found the wrong clique " + Arrays.toString(arr3), expected3,
        arr3);
View Full Code Here

        "Found the wrong clique " + Arrays.toString(arr3), expected3,
        arr3);

    TIntArrayList ans4 = maximalWeightedClique.findMaximumWeightedClique(
        weights, new TIntArrayList(new int[] { 7 }));
    ans4.sort();
    int[] arr4 = ans4.toArray();
    int[] expected4 = new int[] { 7 };
    Assert.assertArrayEquals("Found the wrong clique", expected4, arr4);
  }
View Full Code Here

      for (Comparator<ArrayList<IntDoublePair>> comparator : comps) {
        maximalWeightedClique.setClassesComparator(comparator);
        TIntArrayList ansTemp = maximalWeightedClique
            .findMaximumWeightedClique(weightsArr, mandatoryList);
       
        ansTemp.sort();
        final int[] ansArray = ansTemp.toArray();
        double curWeight = evaluate(ansArray, weightsArr);
        if (curWeight > ansWeight) {
          ansWeight = curWeight;
          ans = ansTemp;
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.