// uses brute-force algorithm
public Factor normalize ()
{
VariableElimination inf = new VariableElimination ();
double Z = inf.computeNormalizationFactor (this);
addFactor (new ConstantFactor (1.0/Z));
return this;
}
public Factor marginalize (Variable[] vars)