def loglikelihood(self, net):
        """Returns the log likelihood of the given network.
        
        Similar to the loglikelihood method of a Conditional Probability
        Distribution.  
        
        """

        adjmat = net.edges.adjacency_matrix

        # if any of the mustexist or mustnotexist constraints are violated,
        # return negative infinity
        if (not (adjmat | self.mustexist).all()) and \
           (adjmat & self.mustnotexist).any():
            return NEGINF

        # if any custom constraints are violated, return negative infinity
        if self.constraints and not all(c(adjmat) for c in self.constraints):
            return NEGINF

        loglike = 0.0
        if self.energy_matrix != None:
            energy = N.sum(adjmat * self.energy_matrix) 
            loglike = -self.weight * energy

        return loglike
dataset/ETHPy150Open abhik/pebl/src/pebl/prior.py/Prior.loglikelihood/operator `or` -> `and`