815816817818819820821822823824
} // uses brute-force algorithm public Factor normalize () { VariableElimination inf = new VariableElimination (); double Z = inf.computeNormalizationFactor (this); addFactor (new ConstantFactor (1.0/Z)); return this; }
837838839840841842843844
} } public Factor marginalize (Variable var) { VariableElimination inf = new VariableElimination (); return inf.unnormalizedMarginal (this, var); }
925926927928929930931932
return sampler.sample (this, 1); } public double sum () { VariableElimination inf = new VariableElimination (); return inf.computeNormalizationFactor (this); }