Package bgu.bio.adt.tuples

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


   */
  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

        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

    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

   * @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

    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

    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

    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

TOP

Related Classes of bgu.bio.adt.tuples.IntDoublePair

Copyright © 2018 www.massapicom. 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.