def marg_prob(self) -> np.ndarray:
    'Calculates marginal probabilities.'
    max_domain_size = np.max([self._var_size(i) for i in range(self.nrVars)])
    ans = np.zeros((self.nrVars, max_domain_size), dtype=np.float64)
    for var_id in range(self.nrVars):
        ans[var_id, 0:self._var_size(var_id)] = self._belief_v(var_id).p.p
    return ans
Calculates marginal probabilities.
def marg_prob(self) -> np.ndarray:
    
    max_domain_size = np.max([self._var_size(i) for i in range(self.nrVars)])
    ans = np.zeros((self.nrVars, max_domain_size), dtype=np.float64)
    for var_id in range(self.nrVars):
        ans[var_id, 0:self._var_size(var_id)] = self._belief_v(var_id).p.p
    return ans