Package gnu.trove

Examples of gnu.trove.THashSet.addAll()


  private static Collection varsForFactors (List factors)
  {
    Set vars = new THashSet ();
    for (Iterator it = factors.iterator (); it.hasNext ();) {
      Factor ptl = (Factor) it.next ();
      vars.addAll (ptl.varSet ());
    }
    return vars;
  }

}
View Full Code Here


  }

  public static Collection union (Collection c1, Collection c2)
  {
    Set set = new THashSet (c1);
    set.addAll (c2);
    return set;
  }

  /** Returns the key in map that has the greatest score */
  public static Object argmax (TObjectDoubleHashMap map)
View Full Code Here

    // all region graphs are DAGs, so no infinite regress
    for (Iterator it = region.children.iterator (); it.hasNext();) {
      Region child = (Region) it.next ();
      computeDescendantsRec (child);
      descendants.add (child);
      descendants.addAll (child.descendants);
    }

    region.descendants = descendants;
  }
View Full Code Here

/*     */
/*     */   static Operation getContainsOp() {
/* 104 */     Set theirs = new HashSet(dataset.size());
/* 105 */     theirs.addAll(dataset);
/* 106 */     Set ours = new THashSet(dataset.size());
/* 107 */     ours.addAll(dataset);
/*     */
/* 109 */     return new Operation(theirs, ours) { private final Set val$theirs;
/*     */       private final Set val$ours;
/*     */
/* 111 */       public void theirs() { for (int i = 0; i < Main.dataset.size(); i += 5)
View Full Code Here

/*     */
/*     */   static Operation getSumSetOperation() {
/* 303 */     Set theirSet = new HashSet(dataset.size());
/* 304 */     THashSet ourSet = new THashSet(dataset.size());
/* 305 */     theirSet.addAll(dataset);
/* 306 */     ourSet.addAll(dataset);
/* 307 */     TObjectProcedure proc = new TObjectProcedure() {
/* 308 */       int sum = 0;
/*     */
/* 310 */       public boolean execute(Object o) { this.sum += ((Integer)o).intValue();
/* 311 */         return true;
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.