Package gnu.trove

Examples of gnu.trove.THashSet$HashProcedure


    return newMdl;
  }

  private static void addSlicedPotentials (FactorGraph fromMdl, FactorGraph toMdl, Assignment assn, Map toSlicedMap)
  {
    Set inputVars = new THashSet (Arrays.asList (assn.getVars ()));
    Set remainingVars = new THashSet (fromMdl.variablesSet ());
    remainingVars.removeAll (inputVars);
    for (Iterator it = fromMdl.factorsIterator (); it.hasNext ();) {
      Factor ptl = (Factor) it.next ();
      Set theseVars = new THashSet (ptl.varSet ());
      theseVars.retainAll (remainingVars);
      Factor slicedPtl = ptl.slice (assn);
      toMdl.addFactor (slicedPtl);
      if (toSlicedMap != null) {
        toSlicedMap.put (ptl, slicedPtl);
      }
View Full Code Here


    }
  }

  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

    isRoot = true;
    index = -1;
  }
  Region (Variable var) {
    this ();
    factors = new THashSet ();
    vars = new ArrayList (1);
    vars.add (var);
  }
View Full Code Here

    vars.add (var);
  }

  Region (Factor ptl) {
    this ();
    factors = new THashSet ();
    factors.add (ptl);
    vars = new ArrayList (ptl.varSet ());
  }
View Full Code Here

  }

  Region (Variable[] vars, Factor[] factors)
  {
    this();
    this.factors = new THashSet (Arrays.asList (factors));
    this.vars = new ArrayList (Arrays.asList (vars));
  }
View Full Code Here

  }

  Region (Collection vars, Collection factors)
  {
    this();
    this.factors = new THashSet (factors);
    this.vars = new ArrayList (vars);
  }
View Full Code Here

  Region (Collection vars)
  {
    this();
    this.vars = new ArrayList (vars);
    factors = new THashSet ();
  }
View Full Code Here

  }

  /** Computes a nondestructive intersection of two collections. */
  public static Collection intersection (Collection c1, Collection c2)
  {
    Set set = new THashSet (c1);
    set.retainAll (c2);
    return set;
  }
View Full Code Here

    return set;
  }

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

  }


  public Set sepsetPotentials()
  {
    THashSet set = new THashSet();
    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      set.add(ptl);
    }

    return set;
  }
View Full Code Here

TOP

Related Classes of gnu.trove.THashSet$HashProcedure

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.