Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / sm_same.cpp
index 03c3bc260acbc03b381fdd98d40917271275fb53..cb8126171bb215283086f6f3dc560c3458187d5d 100644 (file)
@@ -1,32 +1,36 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
+ * 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.
  *
- *                 G   R   O   M   A   C   S
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
  *
- *          GROningen MAchine for Chemical Simulations
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 /*! \internal \file
  * \brief
  * \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
 {
@@ -90,28 +97,64 @@ 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. */
@@ -173,14 +216,8 @@ static gmx_ana_selmethod_t sm_same_str = {
     {"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;
 
@@ -251,16 +288,8 @@ _gmx_selelem_custom_init_same(gmx_ana_selmethod_t                           **me
     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;
 
@@ -307,17 +336,8 @@ cmp_int(const void *a, const void *b)
     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;
@@ -365,7 +385,7 @@ init_frame_same_int(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
  * \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;
@@ -440,17 +460,8 @@ cmp_str(const void *a, const void *b)
     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;
@@ -493,7 +504,7 @@ init_frame_same_str(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
  * \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;