Add check for unsorted index groups in selections.
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 2 May 2013 18:05:48 +0000 (21:05 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 10 Aug 2013 10:30:05 +0000 (12:30 +0200)
commit907e551881a62a2b5ac65cb42618794a589bf188
tree73ecd6a89b2f9a2e6cb25d845f464858d567ecf3
parent6aeb717c6a7a8d882497a5cafe95a51a5946660d
Add check for unsorted index groups in selections.

Selections did not work properly if an index group was used that
did not have the atom indices in strictly ascending order.
Added a check for this, and tests that check that this now gives an
error.

Refactored the way index group references are resolved such that the
logic and the related error messages are now only in one place:
selelem.cpp.  This resolves TODOs about improving the error messages.
Also made this piece of code to use exceptions for error reporting.

Related to #651 and #655.

Change-Id: I2318823b1be74775d0a0f8bd4a3c58b0aed1aba1
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.y
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/selectioncollection-impl.h
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selectioncollection.h
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/tests/selectioncollection.cpp