edu.ucla.belief.recursiveconditioning
Class RCUtilities

Object
  extended by RCUtilities

public class RCUtilities
extends Object

This class contains utility functions for RC objects.

Author:
David Allen

Method Summary
static Collection calculateCutsetFromChildren(RCNodeInternalBinaryCache nd, Collection acutset)
          Calculates the cutset of a variable based only on its children.
static int clusterSize(RCNode rt)
           
static void computeLeafs(RCNode rt, Collection ret)
          Compute leaf nodes in the subtree rooted at rt (will include rt if it is a leaf node).
static void computeParentsInTree(RCNode rt, Map ret)
          When finished, ret will include a mapping from all nodes to their parents in the subtree rooted at rt.
static void getElimOrder(RCNode rt, ArrayList ord)
          The ArrayList ord will contain the vars in an elimination order determined by the subtree rooted at rt (it is not unique).
static void getElimOrderUnInitialized(RCNode rt, Collection acutset, ArrayList ord)
          The ArrayList ord will contain the vars in an elimination order determined by the subtree rooted at rt (it is not unique).
static double logsub(double lna, double lnb)
          Compute ln(a-b) from ln(a) and ln(b) using the log sub equation.
static double logsub2(double lna, double lnb)
          Compute ln(a-b) from ln(a) and ln(b) using the log sub equation.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

computeParentsInTree

public static final void computeParentsInTree(RCNode rt,
                                              Map ret)
When finished, ret will include a mapping from all nodes to their parents in the subtree rooted at rt.


computeLeafs

public static final void computeLeafs(RCNode rt,
                                      Collection ret)
Compute leaf nodes in the subtree rooted at rt (will include rt if it is a leaf node).


calculateCutsetFromChildren

public static final Collection calculateCutsetFromChildren(RCNodeInternalBinaryCache nd,
                                                           Collection acutset)
Calculates the cutset of a variable based only on its children. To calculate a "local cutset", acutset can be Collections.EMPTY_SET.


getElimOrder

public static final void getElimOrder(RCNode rt,
                                      ArrayList ord)
The ArrayList ord will contain the vars in an elimination order determined by the subtree rooted at rt (it is not unique). This assumes that leaf nodes have their contxt set and internal nodes have their iterators created.


getElimOrderUnInitialized

public static final void getElimOrderUnInitialized(RCNode rt,
                                                   Collection acutset,
                                                   ArrayList ord)
The ArrayList ord will contain the vars in an elimination order determined by the subtree rooted at rt (it is not unique). This assumes that leaf nodes know their variables.


clusterSize

public static final int clusterSize(RCNode rt)

logsub

public static final double logsub(double lna,
                                  double lnb)
Compute ln(a-b) from ln(a) and ln(b) using the log sub equation. Its possible that lna and/or lnb might be NaN, or pos/neg infin. If lna or lnb are NaN, the result is NaN. If lna=lnb=negInf, then (a=b=0 and ln(0)=negInf) return negInf. If lna=negInf or lnb=negInf return other one (possibly negated). If lna or lnb are posInf, then it is an error.


logsub2

public static final double logsub2(double lna,
                                   double lnb)
Compute ln(a-b) from ln(a) and ln(b) using the log sub equation. Its possible that lna and/or lnb might be NaN, or pos/neg infin. If lna or lnb are NaN, the result is NaN. If lna=lnb=negInf, then (a=b=0 and ln(0)=negInf) return negInf. If lna=negInf or lnb=negInf return other one (possibly negated). If lna or lnb are posInf, then it is an error.



Copyright 2010 UCLA Automated Reasoning Group