Check frame atom count before evaluating selections
[alexxy/gromacs.git] / src / gromacs / selection / indexutil.h
index 4575879009167e905247d771840d5fc73b1f331a..bdbaaf0076c176641e4569d71bd5978616c77932 100644 (file)
@@ -236,10 +236,17 @@ gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, bool bAlloc);
 void
 gmx_ana_index_dump(FILE *fp, gmx_ana_index_t *g, int maxn);
 
+/*! \brief
+ * Returns maximum atom index that appears in an index group.
+ *
+ * \param[in]  g      Index group to query.
+ * \returns    Largest atom index that appears in \p g, or zero if \p g is empty.
+ */
+int
+gmx_ana_index_get_max_index(gmx_ana_index_t *g);
 /** Checks whether an index group is sorted. */
 bool
 gmx_ana_index_check_sorted(gmx_ana_index_t *g);
-
 /*! \brief
  * Checks whether an index group has atoms from a defined range.
  *