Commit c143f91d authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

MulticanonicalState: improve flatness criterium

parent 6e6c375c
......@@ -468,7 +468,13 @@ class MulticanonicalState(object):
h = self._hist.a
if h.sum() == 0:
return 0
h = array(h[h>0], dtype="float")
idx = h > 0
Ss = self.get_range()
h = array(h[numpy.logical_and(Ss >= Ss[idx].min(),
Ss <= Ss[idx].max())],
dtype="float")
if len(h) == 1:
h = array([0] + list(h))
if not use_ent:
h_mean = h.mean()
return h.min() / h_mean
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment