def _belief_f(self, ii) -> LDFactor:
    p = self._calc_belief_f(ii)
    if self.logdomain:
        p.p = np.exp((p.p - np.max(p.p)))
    p.normalize()
    return LDFactor(self.model, self.factors[ii].var_idx, p)
def _belief_f(self, ii) -> LDFactor:
    p = self._calc_belief_f(ii)
    if self.logdomain:
        p.p = np.exp((p.p - np.max(p.p)))
    p.normalize()
    return LDFactor(self.model, self.factors[ii].var_idx, p)