cc.mallet.grmm.inference
Class JunctionTree

java.lang.Object
  extended by cc.mallet.grmm.types.Tree
      extended by cc.mallet.grmm.inference.JunctionTree

public class JunctionTree
extends Tree

Datastructure for a junction tree. Created: Tue Sep 30 10:30:25 2003

Version:
$Id: JunctionTree.java,v 1.1 2007/10/22 21:37:49 mccallum Exp $
Author:
Charles Sutton

Constructor Summary
JunctionTree(int size)
           
 
Method Summary
 void addNode(java.lang.Object parent1, java.lang.Object child1)
           
 java.util.Collection clusterPotentials()
          Returns a collection of all the potentials of cliques in the junction tree.
 void compact()
           
 void decompact()
           
 void dump()
           
 double dumpLogJoint(Assignment assn)
           
 double entropy()
           
 VarSet findCluster(Variable[] vars)
          Returns a cluster in the tree that contains exactly the given variables, or null if no such cluster exists.
 VarSet findParentCluster(java.util.Collection vars)
          Returns a cluster in the tree that contains all the vars in a collection.
 VarSet findParentCluster(Variable var)
          Returns a cluster in the tree that contains var.
 Factor getCPF(VarSet c)
           
 java.util.Set getSepset(VarSet v1, VarSet v2)
           
 Factor getSepsetPot(VarSet v1, VarSet v2)
           
 boolean isNaN()
           
 double lookupLogJoint(Assignment assn)
           
 Factor lookupMarginal(Variable var)
           
 void normalizeAll()
          Normalizes all potentials in the tree, both node and sepset.
 java.util.Set sepsetPotentials()
           
 void setCPF(VarSet c, Factor pot)
           
 
Methods inherited from class cc.mallet.grmm.types.Tree
add, containsObject, dumpToString, getChildren, getParent, getRoot, getVerticesIterator, isLeaf, isRoot, lookupIndex, lookupVertex, makeFromSubtree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JunctionTree

public JunctionTree(int size)
Method Detail

addNode

public void addNode(java.lang.Object parent1,
                    java.lang.Object child1)
Overrides:
addNode in class Tree

getCPF

public Factor getCPF(VarSet c)

setCPF

public void setCPF(VarSet c,
                   Factor pot)

sepsetPotentials

public java.util.Set sepsetPotentials()

getSepsetPot

public Factor getSepsetPot(VarSet v1,
                           VarSet v2)

clusterPotentials

public java.util.Collection clusterPotentials()
Returns a collection of all the potentials of cliques in the junction tree. (i.e., these are the terms in the numerator of the jounction tre theorem).

See Also:
sepsetPotentials()

getSepset

public java.util.Set getSepset(VarSet v1,
                               VarSet v2)

lookupMarginal

public Factor lookupMarginal(Variable var)

lookupLogJoint

public double lookupLogJoint(Assignment assn)

findParentCluster

public VarSet findParentCluster(Variable var)
Returns a cluster in the tree that contains var.


findParentCluster

public VarSet findParentCluster(java.util.Collection vars)
Returns a cluster in the tree that contains all the vars in a collection.


findCluster

public VarSet findCluster(Variable[] vars)
Returns a cluster in the tree that contains exactly the given variables, or null if no such cluster exists.


normalizeAll

public void normalizeAll()
Normalizes all potentials in the tree, both node and sepset.


dump

public void dump()

dumpLogJoint

public double dumpLogJoint(Assignment assn)

isNaN

public boolean isNaN()

entropy

public double entropy()

decompact

public void decompact()

compact

public void compact()