Bug #1743
Selections like "x 1 to 1.5 2 to 2.5" select unwanted atoms
Description
If a selection fulfills the following conditions, it is incorrectly evaluated:
* it uses a real-valued keyword (like x
or charge
),
* it uses multiple A to B
parts in the same expression (like in the title), and
* the difference between the closer endpoints of two to
ranges is less than one.
In such a case, the selection incorrectly selects also values between the two to
ranges. For example, in the case in the title, also positions with x
between 1.5 and 2 are incorrectly selected.
Will upload a fix shortly; the issue is a copy-paste bug between integer and real to
implementations.
Associated revisions
History
#1 Updated by Gerrit Code Review Bot over 4 years ago
Gerrit received a related patchset '1' for Issue #1743.
Uploader: Teemu Murtola (teemu.murtola@gmail.com)
Change-Id: I3ac79c55dc3817e6325e43e27e0ccb4fe360e609
Gerrit URL: https://gerrit.gromacs.org/4637
#2 Updated by Teemu Murtola over 4 years ago
- Status changed from Fix uploaded to Closed
Fix handling of real-valued 'to' selection ranges
Two adjacent ranges were incorrectly merged to a single range if the
difference between their nearest endpoints was less than one (the extra
+1 in the code is incorrectly copy-pasted from the integer case).
Add tests for handling overlapping and near-overlapping ranges.
Fixes #1743.
Change-Id: I3ac79c55dc3817e6325e43e27e0ccb4fe360e609