Package gnu.trove

Examples of gnu.trove.TObjectDoubleIterator.key()


    TObjectDoubleIterator nIter = neighbors_.iterator();
    while (nIter.hasNext()) {
      nIter.advance();
      totalNeighWeight += this.GetContinuationProbability() * nIter.value();
     
      Vertex2 neigh = g._vertices.get(nIter.key());
      totalNeighWeight += neigh.GetContinuationProbability() *
        neigh.GetNeighborWeight(this.GetName());
    }
   
    // mu1 x p^{inj} + 0.5 * mu2 x \sum_j (p_{i}^{cont} W_{ij} + p_{j}^{cont} W_{ji}) + mu3
View Full Code Here


    // sum_{u} W_uv^{2}, where u is the neighbor
    double totalNeighWeightSq = 0;
    TObjectDoubleIterator nIter = neighbors_.iterator();
    while (nIter.hasNext()) {
      nIter.advance();
      Vertex2 neigh = g._vertices.get(nIter.key());
      totalNeighWeightSq += neigh.GetNeighborWeight(this.GetName()) *
        neigh.GetNeighborWeight(this.GetName());
    }
   
    double denom = mu1 * (IsSeedNode() ? 1 : 0) +
View Full Code Here

    ArrayList<ObjectDoublePair> lsps = new ArrayList<ObjectDoublePair>();

    TObjectDoubleIterator mi = m.iterator();
    while (mi.hasNext()) {
      mi.advance();
      lsps.add(new ObjectDoublePair(mi.key(), mi.value()));
    }

    ObjectDoublePairComparator lspComparator = new ObjectDoublePairComparator();
    Collections.sort(lsps, lspComparator);
View Full Code Here

      if (v.IsTestNode()) {
        TObjectDoubleIterator labelIter =
            this._labelManager.getLabelScores(v.GetGoldLabel()).iterator();
        while (labelIter.hasNext()) {
          labelIter.advance();
          testLabels.adjustOrPutValue((String) labelIter.key(), 1, 1);
        }
      }
     
      if (v.IsSeedNode()) {
        Object[] injLabels= this._labelManager.getLabelScores(v.GetInjectedLabelScores()).keys();
View Full Code Here

    for (String vName : this._vertices.keySet()) {
      Vertex2 v = this._vertices.get(vName);
      TObjectDoubleIterator nIter = v.GetNeighbors().iterator();
      while (nIter.hasNext()) {
        nIter.advance();
        String nName = (String) nIter.key();

        // we assume that the currently set distances are distance squares
        double currWeight = v.GetNeighborWeight(nName);
        double sigmaSquarred = Math.pow(sigmaFactor * avgEdgeWeight, 2);
        double newWeight = Math.exp((-1.0 * currWeight) / (2 * sigmaSquarred));
 
View Full Code Here

        nIter.advance();
        ++totalEdges;

        // we assume that the currently set distances are distance squares,
        // so we need to take sqrt before averaging.
        totalDistance += Math.sqrt(v.GetNeighborWeight((String) nIter.key()));
     
    }

    return ((1.0 * totalDistance) / totalEdges);
  }
View Full Code Here

      if (v.IsSeedNode()) {
        TObjectDoubleIterator injLabIter =
            this._labelManager.getLabelScores(v.GetInjectedLabelScores()).iterator();
        while (injLabIter.hasNext()) {
          injLabIter.advance();
          double currVal = classSeedSum.containsKey(injLabIter.key()) ?
            classSeedSum.get(injLabIter.key()) : 0;
          classSeedSum.put(injLabIter.key(), currVal + injLabIter.value());
         
          // add the label to the list of labels
          if (!labels.containsKey(injLabIter.key())) {
View Full Code Here

        TObjectDoubleIterator injLabIter =
            this._labelManager.getLabelScores(v.GetInjectedLabelScores()).iterator();
        while (injLabIter.hasNext()) {
          injLabIter.advance();
          double currVal = classSeedSum.containsKey(injLabIter.key()) ?
            classSeedSum.get(injLabIter.key()) : 0;
          classSeedSum.put(injLabIter.key(), currVal + injLabIter.value());
         
          // add the label to the list of labels
          if (!labels.containsKey(injLabIter.key())) {
            labels.put(injLabIter.key(), 1.0);
View Full Code Here

            this._labelManager.getLabelScores(v.GetInjectedLabelScores()).iterator();
        while (injLabIter.hasNext()) {
          injLabIter.advance();
          double currVal = classSeedSum.containsKey(injLabIter.key()) ?
            classSeedSum.get(injLabIter.key()) : 0;
          classSeedSum.put(injLabIter.key(), currVal + injLabIter.value());
         
          // add the label to the list of labels
          if (!labels.containsKey(injLabIter.key())) {
            labels.put(injLabIter.key(), 1.0);
          }
View Full Code Here

          double currVal = classSeedSum.containsKey(injLabIter.key()) ?
            classSeedSum.get(injLabIter.key()) : 0;
          classSeedSum.put(injLabIter.key(), currVal + injLabIter.value());
         
          // add the label to the list of labels
          if (!labels.containsKey(injLabIter.key())) {
            labels.put(injLabIter.key(), 1.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.