public Factor extractMax (Collection vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable var) { if (numVariables () < 5) { return asTable ().extractMax (var); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable[] vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable[] vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable[] vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor marginalize (Collection vars) { if (numVariables () < 5) { return asTable ().marginalize (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable var) { if (numVariables () < 5) { return asTable ().extractMax (var); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor marginalize (Collection vars) { if (numVariables () < 5) { return asTable ().marginalize (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Collection vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Collection vars) { if (numVariables () < 5) { return asTable ().extractMax (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor extractMax (Variable var) { if (numVariables () < 5) { return asTable ().extractMax (var); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public Factor marginalize (Collection vars) { if (numVariables () < 5) { return asTable ().marginalize (vars); } else { throw new UnsupportedOperationException ("not yet implemented"); } }
public void testAsTable2 () { Factor f1 = new TableFactor (vars[0], new double[] { 0.6, 0.4 }); Factor f2 = new ConstantFactor (2.0); FactorGraph fg = new FactorGraph (new Factor[] { f1, f2 }); AbstractTableFactor tbl = fg.asTable (); assertTrue (Arrays.equals(new double[] { 0.6 * 2.0, 0.4 * 2.0 }, tbl.toValueArray ())); }
public void testAsTable2 () { Factor f1 = new TableFactor (vars[0], new double[] { 0.6, 0.4 }); Factor f2 = new ConstantFactor (2.0); FactorGraph fg = new FactorGraph (new Factor[] { f1, f2 }); AbstractTableFactor tbl = fg.asTable (); assertTrue (Arrays.equals(new double[] { 0.6 * 2.0, 0.4 * 2.0 }, tbl.toValueArray ())); }
public void testAsTable () { FactorGraph fg = new FactorGraph (); fg.multiplyBy (tbl1); fg.multiplyBy (tbl2); AbstractTableFactor actual = fg.asTable (); AbstractTableFactor expected = (AbstractTableFactor) tbl1.multiply (tbl2); assertTrue (expected.almostEquals (actual)); }
public void testAsTable () { FactorGraph fg = new FactorGraph (); fg.multiplyBy (tbl1); fg.multiplyBy (tbl2); AbstractTableFactor actual = fg.asTable (); AbstractTableFactor expected = (AbstractTableFactor) tbl1.multiply (tbl2); assertTrue (expected.almostEquals (actual)); }
public void testEmbeddedFactorGraph () { FactorGraph embeddedFg = new FactorGraph (); embeddedFg.multiplyBy (tbl1); embeddedFg.multiplyBy (tbl2); FactorGraph fg = new FactorGraph (); fg.multiplyBy (embeddedFg); fg.multiplyBy (tbl3); assertEquals (4, fg.varSet ().size ()); assertEquals (2, fg.factors ().size ()); Assignment assn = new Assignment (fg.varSet ().toVariableArray (), new int [4]); assertEquals (0.032, fg.value (assn), 1e-5); AbstractTableFactor tbl = fg.asTable (); assertEquals (4, tbl.varSet ().size ()); assertEquals (0.032, tbl.value (assn), 1e-5); }
public void testEmbeddedFactorGraph () { FactorGraph embeddedFg = new FactorGraph (); embeddedFg.multiplyBy (tbl1); embeddedFg.multiplyBy (tbl2); FactorGraph fg = new FactorGraph (); fg.multiplyBy (embeddedFg); fg.multiplyBy (tbl3); assertEquals (4, fg.varSet ().size ()); assertEquals (2, fg.factors ().size ()); Assignment assn = new Assignment (fg.varSet ().toVariableArray (), new int [4]); assertEquals (0.032, fg.value (assn), 1e-5); AbstractTableFactor tbl = fg.asTable (); assertEquals (4, tbl.varSet ().size ()); assertEquals (0.032, tbl.value (assn), 1e-5); }