Esempio n. 1
0
 def isValid(self, threshold=1e-7):
     """Rate matrix is valid if rows sum to 0 and no negative off-diags.
     
     threshold gives maximum error allowed in row sums.
     """
     if max(abs(sum(self._data, -1)) > threshold):
         return False
     return not has_neg_off_diags(self._data)
Esempio n. 2
0
 def isValid(self, threshold=1e-7):
     """Rate matrix is valid if rows sum to 0 and no negative off-diags.
     
     threshold gives maximum error allowed in row sums.
     """
     if max(abs(sum(self._data, -1)) > threshold):
         return False
     return not has_neg_off_diags(self._data)
Esempio n. 3
0
 def hasNegOffDiags(self):
     """Returns True if any off-diagonal elements negative."""
     return has_neg_off_diags(self._data)
Esempio n. 4
0
 def hasNegOffDiags(self):
     """Returns True if any off-diagonal elements negative."""
     return has_neg_off_diags(self._data)