/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_selection
*/
+#include "gmxpre.h"
+
#include <stdlib.h>
#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/smalloc.h"
-#include "gromacs/legacyheaders/string2.h"
-
-#include "gromacs/selection/selmethod.h"
#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/smalloc.h"
#include "keywords.h"
#include "parsetree.h"
#include "selelem.h"
+#include "selmethod.h"
-/*! \internal \brief
+/*! \internal
+ * \brief
* Data structure for the \p same selection method.
*
* To avoid duplicate initialization code, the same data structure is used
* for matching both integer and string keywords; hence the unions.
+ *
+ * \ingroup module_selection
*/
typedef struct
{
bool bSorted;
} t_methoddata_same;
-/** Allocates data for the \p same selection method. */
+/*! \brief
+ * Allocates data for the \p same selection method.
+ *
+ * \param[in] npar Not used (should be 2).
+ * \param[in,out] param Method parameters (should point to a copy of
+ * ::smparams_same_int or ::smparams_same_str).
+ * \returns Pointer to the allocated data (\ref t_methoddata_same).
+ */
static void *
init_data_same(int npar, gmx_ana_selparam_t *param);
-/** Initializes the \p same selection method. */
+/*! \brief
+ * Initializes the \p same selection method.
+ *
+ * \param top Not used.
+ * \param npar Not used (should be 2).
+ * \param param Initialized method parameters (should point to a copy of
+ * ::smparams_same_int or ::smparams_same_str).
+ * \param data Pointer to \ref t_methoddata_same to initialize.
+ * \returns 0 on success, -1 on failure.
+ */
static void
init_same(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data);
/** Frees the data allocated for the \p same selection method. */
static void
free_data_same(void *data);
-/** Initializes the evaluation of the \p same selection method for a frame. */
+/*! \brief
+ * Initializes the evaluation of the \p same selection method for a frame.
+ *
+ * \param[in] top Not used.
+ * \param[in] fr Current frame.
+ * \param[in] pbc PBC structure.
+ * \param data Should point to a \ref t_methoddata_same.
+ *
+ * Sorts the \c data->as.i array and removes identical values for faster and
+ * simpler lookup.
+ */
static void
init_frame_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
/** Evaluates the \p same selection method. */
static void
-evaluate_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
-/** Initializes the evaluation of the \p same selection method for a frame. */
+/*! \brief
+ * Initializes the evaluation of the \p same selection method for a frame.
+ *
+ * \param[in] top Not used.
+ * \param[in] fr Current frame.
+ * \param[in] pbc PBC structure.
+ * \param data Should point to a \ref t_methoddata_same.
+ *
+ * Sorts the \c data->as.s array and removes identical values for faster and
+ * simpler lookup.
+ */
static void
init_frame_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data);
/** Evaluates the \p same selection method. */
static void
-evaluate_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data);
/** Parameters for the \p same selection method. */
{"same KEYWORD as ATOM_EXPR", asize(help_same), help_same},
};
-/*!
- * \param[in] npar Not used (should be 2).
- * \param[in,out] param Method parameters (should point to a copy of
- * ::smparams_same_int or ::smparams_same_str).
- * \returns Pointer to the allocated data (\ref t_methoddata_same).
- */
static void *
-init_data_same(int npar, gmx_ana_selparam_t *param)
+init_data_same(int /* npar */, gmx_ana_selparam_t *param)
{
t_methoddata_same *data;
return 0;
}
-/*!
- * \param top Not used.
- * \param npar Not used (should be 2).
- * \param param Initialized method parameters (should point to a copy of
- * ::smparams_same_int or ::smparams_same_str).
- * \param data Pointer to \ref t_methoddata_same to initialize.
- * \returns 0 on success, -1 on failure.
- */
static void
-init_same(t_topology *top, int npar, gmx_ana_selparam_t *param, void *data)
+init_same(t_topology * /* top */, int /* npar */, gmx_ana_selparam_t *param, void *data)
{
t_methoddata_same *d = (t_methoddata_same *)data;
return 0;
}
-/*!
- * \param[in] top Not used.
- * \param[in] fr Current frame.
- * \param[in] pbc PBC structure.
- * \param data Should point to a \ref t_methoddata_same.
- *
- * Sorts the \c data->as.i array and removes identical values for faster and
- * simpler lookup.
- */
static void
-init_frame_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
+init_frame_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */, void *data)
{
t_methoddata_same *d = (t_methoddata_same *)data;
int i, j;
* \c data->val.
*/
static void
-evaluate_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_same_int(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
{
t_methoddata_same *d = (t_methoddata_same *)data;
return strcmp(*(char **)a, *(char **)b);
}
-/*!
- * \param[in] top Not used.
- * \param[in] fr Current frame.
- * \param[in] pbc PBC structure.
- * \param data Should point to a \ref t_methoddata_same.
- *
- * Sorts the \c data->as.s array and removes identical values for faster and
- * simpler lookup.
- */
static void
-init_frame_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
+init_frame_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */, void *data)
{
t_methoddata_same *d = (t_methoddata_same *)data;
int i, j;
* \c data->val.
*/
static void
-evaluate_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+evaluate_same_str(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
gmx_ana_index_t *g, gmx_ana_selvalue_t *out, void *data)
{
t_methoddata_same *d = (t_methoddata_same *)data;