Fixed trjconv -sub
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 1 Feb 2012 05:57:08 +0000 (16:57 +1100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 1 Feb 2012 06:04:22 +0000 (17:04 +1100)
If the index group contains 1..100, then clust->maxframe == 99,
and thus when frame == clust->maxframe it should be included
in the cluster.

Change-Id: I6e093d9f76d0952b31ea9ee1516bade9e9b4419b

src/tools/gmx_trjconv.c

index ac8eff3d7b4b11c2d9e763a145599b6dd07c7f44..b848fabd1488de7948d5fc36a394a0beab40bb1a 100644 (file)
@@ -1201,7 +1201,7 @@ int gmx_trjconv(int argc,char *argv[])
                 if (bSubTraj) {
                     /*if (frame >= clust->clust->nra)
            gmx_fatal(FARGS,"There are more frames in the trajectory than in the cluster index file\n");*/
-                    if (frame >= clust->maxframe)
+                    if (frame > clust->maxframe)
                         my_clust = -1;
                     else
                         my_clust = clust->inv_clust[frame];