infer
Class Component

java.lang.Object
  extended by infer.Component
All Implemented Interfaces:
java.lang.Comparable<Component>

public class Component
extends java.lang.Object
implements java.lang.Comparable<Component>

A component in the MRF.


Field Summary
static java.util.ArrayList<java.lang.Double> alphas
           
 MRF cutMRF
           
 java.util.HashSet<java.lang.Integer> cutset
           
static RDB db
           
 int id
           
static int maxDegree
           
static java.util.ArrayList<java.lang.Integer> maxDegrees
           
static double minAlpha
           
 int numAtoms
           
 int numClauses
           
 int numCutClauses
           
 int numPins
           
 java.util.ArrayList<Partition> parts
           
 double ramSize
           
 int rep
           
 double totalCutWeight
           
static int totalPosLowComps
          Fields for research experiments.
static int totalPosLowStrictComps
           
 double totalWeight
           
 
Constructor Summary
Component()
           
 
Method Summary
 void addAtom(GAtom a)
          Add a new atom into this component.
 int compareTo(Component c)
           
 void discard()
          Discard all data structures to reclaim the RAM.
 int getNumCriticalAtomsInCut()
           
 void infer(int ntries, int nflips)
          Run partition-aware MAP inference with the Gauss-Seidel scheme.
 double inferGaussSeidel(int rounds, int ntries, int nflips)
          Gauss-Seidel MAP inference scheme.
 boolean isCut()
          Test if this component contains multiple partitions.
 java.util.HashMap<java.lang.Integer,java.lang.Boolean> loadTruthTable()
          Load the truth table of atoms from the database.
 int numParts()
          Get the number of partitions in this component.
 double recalcCostFromDB()
          Recalculate the cost by reading the state from the DB.
 void showStats()
          Show basic stats of this component.
 double size()
          The size of this component as estimated by the number fo bytes consumed to store this component in RAM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alphas

public static java.util.ArrayList<java.lang.Double> alphas

cutMRF

public MRF cutMRF

cutset

public java.util.HashSet<java.lang.Integer> cutset

db

public static RDB db

id

public int id

maxDegree

public static int maxDegree

maxDegrees

public static java.util.ArrayList<java.lang.Integer> maxDegrees

minAlpha

public static double minAlpha

numAtoms

public int numAtoms

numClauses

public int numClauses

numCutClauses

public int numCutClauses

numPins

public int numPins

parts

public java.util.ArrayList<Partition> parts

ramSize

public double ramSize

rep

public int rep

totalCutWeight

public double totalCutWeight

totalPosLowComps

public static int totalPosLowComps
Fields for research experiments.


totalPosLowStrictComps

public static int totalPosLowStrictComps

totalWeight

public double totalWeight
Constructor Detail

Component

public Component()
Method Detail

addAtom

public void addAtom(GAtom a)
Add a new atom into this component.

Parameters:
a - the atom

compareTo

public int compareTo(Component c)
Specified by:
compareTo in interface java.lang.Comparable<Component>

discard

public void discard()
Discard all data structures to reclaim the RAM.


getNumCriticalAtomsInCut

public int getNumCriticalAtomsInCut()

infer

public void infer(int ntries,
                  int nflips)
Run partition-aware MAP inference with the Gauss-Seidel scheme.

Parameters:
ntries -
nflips -

inferGaussSeidel

public double inferGaussSeidel(int rounds,
                               int ntries,
                               int nflips)
Gauss-Seidel MAP inference scheme. Calls WalkSAT on each partition in a round-robin manner.

Parameters:
rounds -
ntries -
nflips - total number of flips per try in one round; will be prorated for each partition

isCut

public boolean isCut()
Test if this component contains multiple partitions.


loadTruthTable

public java.util.HashMap<java.lang.Integer,java.lang.Boolean> loadTruthTable()
Load the truth table of atoms from the database.


numParts

public int numParts()
Get the number of partitions in this component.


recalcCostFromDB

public double recalcCostFromDB()
Recalculate the cost by reading the state from the DB.


showStats

public void showStats()
Show basic stats of this component.


size

public double size()
The size of this component as estimated by the number fo bytes consumed to store this component in RAM.