Package gnu.trove

Examples of gnu.trove.TIntObjectIterator


  /** Returns an iterator over the set of (key2, value) pairs that match (key1). */
  public TIntObjectIterator curry (int key1)
  {
    final TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
    if (inner == null) {
      return new TIntObjectIterator (new TIntObjectHashMap ());
    } else {
      return new TIntObjectIterator (inner);
    }
  }
View Full Code Here


  {
    for (int i = 0; i < cpfs.length; i++) {
      cpfs[i] = new TableFactor ((VarSet) lookupVertex (i));
    }

    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Sepset sepset = (Sepset) it.value();
      sepset.ptl = newSepsetPtl (sepset.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

        double phi = cpfs[i].logValue (assn);
        accum += phi;
      }
    }

    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      double phi = ptl.logValue (assn);
      accum -= phi;
    }

    return accum;
View Full Code Here

      if (cpfs[i] != null) {
        cpfs[i].normalize();
      }
    }

    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      ptl.normalize();
    }
  }
View Full Code Here

      }
    }

    // And the sepset potentials
    System.out.println("sepset CPFs");
    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      System.out.println(ptl.dumpToString ());
    }
    System.out.println ("/End JT");
  }
View Full Code Here

        double phi = cpfs[i].logValue (assn);
        System.out.println ("CPF "+i+" accum = "+accum);
      }
    }

    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      double phi = ptl.logValue (assn);
      System.out.println("Sepset "+ptl.varSet()+" accum "+accum);
    }

    return accum;
View Full Code Here

    int n = cpfs.length;
    for (int i = 0; i < n; i++)
      if (cpfs[i].isNaN()) return true;

    // And the sepset potentials
    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Factor ptl = ((Sepset) it.value()).ptl;
      if (ptl.isNaN()) return true;
    }

    return false;
  }
View Full Code Here

  {
    for (int i = 0; i < cpfs.length; i++) {
      cpfs[i] = new TableFactor ((VarSet) lookupVertex (i));
    }

    TIntObjectIterator it = sepsets.iterator();
    while (it.hasNext()) {
      it.advance();
      Sepset sepset = (Sepset) it.value();
      sepset.ptl = newSepsetPtl (sepset.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.TIntObjectIterator

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.