From: Jim Procter Date: Thu, 20 Oct 2022 09:50:42 +0000 (+0100) Subject: JAL-2349 adjusted range calculation to be inclusive rather than inclusive, exclusive... X-Git-Tag: Release_2_11_4_0~536 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=48935da8225797aada1fe5f0863385b6b57ee67e;p=jalview.git JAL-2349 adjusted range calculation to be inclusive rather than inclusive, exclusive of bounds --- diff --git a/src/jalview/datamodel/ContactListImpl.java b/src/jalview/datamodel/ContactListImpl.java index 6eb4cdb..561048e 100644 --- a/src/jalview/datamodel/ContactListImpl.java +++ b/src/jalview/datamodel/ContactListImpl.java @@ -10,7 +10,6 @@ public class ContactListImpl implements ContactListI { ContactListProviderI clist; - public static ContactListI newContactList(ContactListProviderI list) { return new ContactListImpl(list); @@ -53,7 +52,7 @@ public class ContactListImpl implements ContactListI cr.setFrom_column(from_column); cr.setTo_column(to_column); double tot = 0; - for (int i = from_column; i < to_column; i++) + for (int i = from_column; i <= to_column; i++) { double contact = getContactAt(i); tot += contact; @@ -80,7 +79,7 @@ public class ContactListImpl implements ContactListI } if (tot > 0) { - cr.setMean(tot / (to_column - from_column)); + cr.setMean(tot / (1 + to_column - from_column)); } else {