Examples of IntDoublePair


Examples of bgu.bio.adt.tuples.IntDoublePair

  }

  protected abstract void calcPotential(IntDoublePair node);

  public IntDoublePair removeLast() {
    IntDoublePair node = this.clique.remove(size - 1);
    size--;
    weight -= node.getSecond();

    return node;
  }
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

   */
  private String[] statsNames;
  private long type1, type2;

  public MaximalWeightedClique() {
    this.dummy = new IntDoublePair(-1, 0.0);
    this.classesComparator = new ClassesComparatorByDegree(false);
    this.nodeComparator = new NodeInformationComparator();
    coloring = new GraphColoring();
    nodeOrdering = new TIntArrayList();
    rand = new Random();
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

        positions[currentClass] = -1;
        currentClass--;
      } else {
        boolean notFound = true;
        while (notFound && currentPos < currentColorClass.size()) {
          final IntDoublePair candidate = currentColorClass
              .get(currentPos);

          if (!canJoin(clique, candidate)) {
            currentPos++;
          } else {
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

    for (int node = 0; node < graph.getNodeNum(); node++) {
      if (mandatory == null || mandatory.binarySearch(node) >= 0) {

        colorClassesMandatory.get(color1[node]).add(
            new IntDoublePair(node, weights[node]));
      } else {
        colorClassesRegular.get(color2[node]).add(
            new IntDoublePair(node, weights[node]));
      }
    }

  }
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

   * @param nodeValue
   *            the value of the node to be set
   * @return a {@link IntDoublePair} representing a node and its value
   */
  private IntDoublePair getFromPool(int nodeId, double nodeValue) {
    IntDoublePair ans = pool.dequeue();
    if (ans == null) {
      ans = new IntDoublePair();
    }
    ans.setFirst(nodeId);
    ans.setSecond(nodeValue);
    return ans;
  }
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

    potential[clique.size()] = nodePotential;
  }

  @Override
  public IntDoublePair removeLast() {
    IntDoublePair node = super.removeLast();
    final int u = node.getFirst();

    // update all the neighbors of the removed node
    final int deg = graph.deg(u);
    for (int i = 0; i < deg; i++) {
      lst[graph.getNeighbor(u, i)]--;
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

    WeightedCliqueTree clique = new WeightedCliqueTree();
    clique.setGraph(graph);
    double[] weights = new double[] { 1, 1, 1, 1, 1, 1, 1, 1 };
    IntDoublePair[] nodesAsPairs = new IntDoublePair[8];
    for (int i = 0; i < nodesAsPairs.length; i++) {
      nodesAsPairs[i] = new IntDoublePair(i, weights[i]);
    }

    Assert.assertEquals("Size of clique should be 0", 0, clique.clique()
        .size());
    clique.add(nodesAsPairs[1]);
View Full Code Here

Examples of bgu.bio.adt.tuples.IntDoublePair

    graph.addEdge(3, 6);
    double[] weights = new double[] { 1, 1, 10, 3.4, 1, 1, 1, 1 };
    IntDoublePair[] nodesAsPairs = new IntDoublePair[8];
    for (int i = 0; i < nodesAsPairs.length; i++) {
      nodesAsPairs[i] = new IntDoublePair(i, weights[i]);
    }
    WeightedCliqueTree clique = new WeightedCliqueTree();
    clique.setGraph(graph);

    Assert.assertEquals("Size of clique should be 0", 0, clique.clique()
View Full Code Here

Examples of com.clearnlp.util.pair.IntDoublePair

 
  /** Each cluster contains indices of {@link Kmeans#v_units}. */
  private List<List<IntDoublePair>> getClusters()
  {
    List<List<IntDoublePair>> cluster = new ArrayList<List<IntDoublePair>>(K);
    IntDoublePair max = new IntDoublePair(-1, -1);
    int[] unit;
    int i, k;  double sim;
   
    for (k=0; k<K; k++)
      cluster.add(new ArrayList<IntDoublePair>());
   
    System.out.print("Clustering: ");
   
    for (i=0; i<N; i++)
    {
      unit = v_units.get(i);
      max.set(-1, -1);
     
      for (k=0; k<K; k++)
      {
        if ((sim = cosine(unit, k)) > max.d)
          max.set(k, sim);
      }
     
      cluster.get(max.i).add(new IntDoublePair(i, max.d));
      if (i%10000 == 0System.out.print(".");
    }
   
    System.out.println();
   
View Full Code Here

Examples of com.gs.collections.api.tuple.primitive.IntDoublePair

        if (!(o instanceof IntDoublePair))
        {
            return false;
        }

        IntDoublePair that = (IntDoublePair) o;

        return (this.one == that.getOne())
                && (Double.compare(this.two, that.getTwo()) == 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.