More consistent Doxygen comments throughout.
authorTeemu Murtola <teemu.murtola@cbr.su.se>
Mon, 27 Sep 2010 11:26:48 +0000 (13:26 +0200)
committerTeemu Murtola <teemu.murtola@cbr.su.se>
Mon, 27 Sep 2010 11:26:48 +0000 (13:26 +0200)
74 files changed:
src/gromacs/errorreporting/abstracterrorreporter.h
src/gromacs/fatalerror/fatalerror.h
src/gromacs/gromacs.h [new file with mode: 0644]
src/gromacs/options.h
src/gromacs/options/abstractoption.h
src/gromacs/options/abstractoptionstorage.h
src/gromacs/options/globalproperties.h
src/gromacs/options/optionsassigner.h
src/gromacs/options/optionstorageinterface.h
src/gromacs/options/optionsvisitor.h
src/gromacs/options/tests/cmdlineparser.cpp
src/gromacs/options/tests/option.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/tests/test_main.cpp
src/gromacs/selection.h
src/gromacs/selection/centerofmass.cpp
src/gromacs/selection/centerofmass.h
src/gromacs/selection/compiler.cpp
src/gromacs/selection/evaluate.cpp
src/gromacs/selection/evaluate.h
src/gromacs/selection/indexutil.cpp
src/gromacs/selection/indexutil.h
src/gromacs/selection/keywords.h
src/gromacs/selection/mempool.cpp
src/gromacs/selection/mempool.h
src/gromacs/selection/nbsearch.cpp
src/gromacs/selection/nbsearch.h
src/gromacs/selection/params.cpp
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.h
src/gromacs/selection/parser.y
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/poscalc.h
src/gromacs/selection/position.cpp
src/gromacs/selection/position.h
src/gromacs/selection/regenerate_parser.sh
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner_flex.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/scanner_internal.h
src/gromacs/selection/selection.cpp
src/gromacs/selection/selection.h
src/gromacs/selection/selectioncollection-impl.h
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selectioncollection.h
src/gromacs/selection/selectionenums.h
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoption.h
src/gromacs/selection/selectionoptionstorage.cpp
src/gromacs/selection/selectionoptionstorage.h
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selhelp.h
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/selmethod.h
src/gromacs/selection/selparam.h
src/gromacs/selection/selvalue.cpp
src/gromacs/selection/selvalue.h
src/gromacs/selection/sm_compare.cpp
src/gromacs/selection/sm_distance.cpp
src/gromacs/selection/sm_insolidangle.cpp
src/gromacs/selection/sm_keywords.cpp
src/gromacs/selection/sm_merge.cpp
src/gromacs/selection/sm_permute.cpp
src/gromacs/selection/sm_position.cpp
src/gromacs/selection/sm_same.cpp
src/gromacs/selection/sm_simple.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/symrec.h
src/gromacs/selection/tests/test_main.cpp

index 9880727d064fd9e785e47ed7a895a9fb7030c7fc..50b154ddc9479b3ff5d0bd1257053758a7a010bd 100644 (file)
@@ -49,7 +49,7 @@ namespace gmx
  *
  * This class provides an interface for reporting non-fatal errors from a
  * complex function.  Such a function should take a pointer to an
- * AbstractReporter object, and use the provided methods to report any errors
+ * AbstractErrorReporter object, and use the provided methods to report any errors
  * it encounters.  If the function calls other functions that can also detect
  * errors, it can pass the reporter object to these functions as well, possibly
  * after adding context information using startContext()/finishContext() or the
index a0625c91a5bb22d294821b71fddc868b4a10e282..916feac32d7a993d96695a8b4814e79ac332f16a 100644 (file)
@@ -107,7 +107,12 @@ typedef void (*ErrorHandlerFunc)(int retcode, const char *msg,
 ErrorHandlerFunc setFatalErrorHandler(ErrorHandlerFunc handler);
 
 /*! \brief
- * Raises an error.
+ * Raises a fatal error.
+ *
+ * \param[in] retcode Error code to raise.
+ * \param[in] msg     More detailed description of the error.
+ * \param[in] file    Name of the source file where the error occurred.
+ * \param[in] line    Line in \p file on which the error occurred.
  */
 void fatalError(int retcode, const char *msg, const char *file, int line);
 /*! \brief
@@ -118,6 +123,11 @@ void fatalError(int retcode, const char *msg, const char *file, int line);
 ::gmx::fatalErrorFormatted(::gmx::eeInvalidInput, GMX_ERRORLOC,
     "Invalid command-line argument: %s", argname);
  * \endcode
+ *
+ * \param[in] retcode Error code to raise.
+ * \param[in] file    Name of the source file where the error occurred.
+ * \param[in] line    Line in \p file on which the error occurred.
+ * \param[in] fmt     printf format string.
  */
 void fatalErrorFormatted(int retcode, const char *file, int line,
                          const char *fmt, ...);
diff --git a/src/gromacs/gromacs.h b/src/gromacs/gromacs.h
new file mode 100644 (file)
index 0000000..29b90ea
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ *
+ *                This source code is part of
+ *
+ *                 G   R   O   M   A   C   S
+ *
+ *          GROningen MAchine for Chemical Simulations
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ */
+/*! \internal \file
+ * \brief
+ * Dummy header for Doxygen documentation.
+ *
+ * This file just holds the main page for doxygen.  When, at some point in the
+ * future, there is an obvious location for this documentation, we should
+ * move it there.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ */
+/*! \mainpage Gromacs
+ * GROMACS is a versatile package to perform molecular dynamics, i.e. simulate
+ * the Newtonian equations of motion for systems with hundreds, to millions
+ * of particles.
+ */
+/*! \defgroup group_publicapi Public API
+ * \brief
+ * Classes and other symbols that are publicly accessible from user code.
+ */
+/*! \defgroup group_libraryapi Library API
+ * \brief
+ * Classes and other symbols that are publicly accessible within the Gromacs
+ * library.
+ *
+ * \see group_publicapi
+ */
+/*! \defgroup group_utilitymodules Utility Modules
+ * \brief
+ * Modules with generic utility functions.
+ */
+/*! \defgroup group_analysismodules Analysis Modules
+ * \brief
+ * Modules used in analysis tools.
+ */
+/*! \namespace gmx
+ * \brief
+ * Generic Gromacs namespace.
+ *
+ * \inpublicapi
+ */
index 00924d2438c698fb4890456d235d623344c751ec..cb6330af97d9d84a459f90a1c2bc365606ec6c45 100644 (file)
  * <H3>Basic Use</H3>
  *
  * Basic interface for providing options is implemented by the Options class
- * (in options.hpp) and classes defined in basicoptions.hpp for specifying
- * individual options.  Only these are needed if a class wants to provide a
- * set of standard options.
+ * and classes defined in basicoptions.h for specifying individual options.
+ * Only these are needed if a class wants to provide a set of standard options.
  *
  * Values for options can be set using option parsers.
- * Currently, only one is defined: CommandLineParser in cmdlineparser.hpp.
+ * Currently, only one is defined: CommandLineParser.
  * As the name suggests, this parser gets values from command-line arguments.
  * Multiple parsers can be used in sequence to provide option values from
  * multiple sources; in such cases, if an option is provided in multiple
@@ -52,7 +51,7 @@
  * is possible to add descriptions for individual options as well as for the
  * whole set of options.  These can then be used to write out a help using one
  * of the provided help writers.
- * Currently, only one is defined: AsciiHelpWriter in asciihelpwriter.hpp
+ * Currently, only one is defined: AsciiHelpWriter
  * (implementation is not yet complete).
  *
  * <H3>Advanced Use</H3>
  * option values.
  *
  * To implement new option types, it is necessary to subclass the templates
- * AbstractStorage (abstractstorage.hpp) and SettingsTempl
- * (abstractsettings.hpp) with the type of the values that the option should
- * provide as the template argument.  After this is done, it is possible to add
- * options of this new type using Options::addOption().
+ * AbstractOptionStorage and OptionTemplate with the type of the values that
+ * the option should provide as the template argument.  After this is done, it
+ * is possible to add options of this new type using Options::addOption().
  *
  * There is limited support for options that need to share information across
  * instances, e.g., to store values in a shared external data structure or to
  * provide a global option to set a common setting for all such options,
- * provided by the GlobalProperties class.  This mechanism is not generic,
- * meaning that it is required to change the options module to add data to this
- * structure.
+ * provided by the OptionsGlobalProperties class.  This mechanism is not
+ * generic, meaning that it is required to change the options module to add
+ * data to this structure.
  *
- * To implement new parsers, one can use OptionsAssigner (assigner.hpp),
- * which provides an interface to set values in an Options object.
+ * To implement new parsers, one can use OptionsAssigner, which provides an
+ * interface to set values in an Options object.
  *
- * It is possible to iterate over all options in an Options object using
- * classes in visitor.hpp.  One should implement the OptionsVisitor interface,
- * and then use OptionsIterator to apply this visitor to the Options object.
+ * There is also an interface to iterate over all options in an Options object.
+ * One should implement the OptionsVisitor interface, and then use
+ * OptionsIterator to apply this visitor to the Options object.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  */
index 79a1e30240ae0dfb50969047bf04da959b3f0ee1..a0dedc6c0305546906dae9a7508b0a3269cd55c5 100644 (file)
  * These classes also take care of creating and setting up the actual option
  * objects.
  *
- * This header is needed directly only when implementing new option types.
+ * This header is needed directly only when implementing new option types,
+ * but methods of OptionTemplate are visible even to the normal user through
+ * its subclasses..
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
- * \inpublicapi
+ * \inlibraryapi
  * \ingroup module_options
  */
 #ifndef GMX_OPTIONS_ABSTRACTOPTION_H
index 1cf3a9802672c785156f4e8fa011d07553a0673f..959cb1dcdb40d0fa3d6b1e57084bf06dd11aa92d 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Defines gmx::AbstractOptionStorage template.
  *
@@ -58,7 +58,7 @@ class Options;
  * \tparam T Assignable type that stores a single option value.
  *
  * Provides an implementation of the clear(), finish(), valueCount(), and
- * formatValues() methods of the StorageInterface interface, leaving
+ * formatValues() methods of the OptionStorageInterface interface, leaving
  * typeString(), appendValue(), finishSet(), and formatValue() to be
  * implemented in derived classes.
  *
index cf9944ae2ac8fa4f5c88bdc062da7eb1d56a3860..6089221b33a19b58bbc27ddfe9d84ed766cd1aee 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::OptionsGlobalProperties.
  *
@@ -45,7 +45,7 @@ namespace gmx
 class Options;
 class SelectionCollection;
 
-/*! \brief
+/*! \libinternal \brief
  * ID numbers for global properties.
  */
 enum OptionGlobalPropertyId
@@ -54,7 +54,7 @@ enum OptionGlobalPropertyId
     eogpSelectionCollection,
 };
 
-/*! \brief
+/*! \libinternal \brief
  * Describes global properties of an Options collection.
  *
  * These properties are used to implement features that require all options of
@@ -75,6 +75,7 @@ class OptionsGlobalProperties
             _usedProperties |= (1<<id);
         }
 
+        //! Set the selection collection for selection option output.
         void setSelectionCollection(SelectionCollection *sc)
         {
             _selectionCollection = sc;
@@ -82,6 +83,7 @@ class OptionsGlobalProperties
 
         //! Returns the scaling factor to get times in ps.
         double timeScaleFactor() const;
+        //! Returns the selection collection.
         SelectionCollection *selectionCollection() const
         {
             return _selectionCollection;
@@ -90,6 +92,7 @@ class OptionsGlobalProperties
     private:
         OptionsGlobalProperties();
 
+        //! Returns true if request() has been called for the given property.
         bool isPropertyUsed(OptionGlobalPropertyId id) const
         {
             return _usedProperties & (1<<id);
index 9a6a89047dc8a20351ac0e8b6c336d97192a805e..fd81977ebe3dfcc2adee06bd8c120fac424bcb98 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::OptionsAssigner.
  *
@@ -50,7 +50,7 @@ class AbstractErrorReporter;
 
 class Options;
 
-/*! \brief
+/*! \libinternal \brief
  * Decorator class for assigning values to Options.
  *
  * This class extends the interface of an Options object by providing methods
index 4ff178cd2f1cbc77d9c3b89e1f46bca0982aedab..f11e3e777e9b2c92d2dfd74dda15c6a5fe6f8ef5 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::OptionStorageInterface interface.
  *
@@ -46,14 +46,14 @@ namespace gmx
 
 class AbstractErrorReporter;
 
-/*! \brief
+/*! \libinternal \brief
  * Pure interface for converting, validating, and storing option values.
  *
- * The AbstractStorage template provides basic functionality for this
+ * The AbstractOptionStorage template provides basic functionality for this
  * interface, only leaving some of the functions to implement in derived
  * classes.
  * It also integrates well with option settings objects derived from
- * SettingsTempl.
+ * OptionTemplate.
  *
  * \inlibraryapi
  * \ingroup module_options
index 95ad20ffbee14ec04b81d0d5979a13850615130d..4a9a38bdeeda9cefb918169f053a3ccf820e8aaf 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::OptionsVisitor interface and supporting classes.
  *
@@ -47,7 +47,7 @@ namespace gmx
 class Option;
 class Options;
 
-/*! \brief
+/*! \libinternal \brief
  * Wrapper class for accessing option information.
  *
  * This class isolates the details of the internal option implementation
@@ -92,7 +92,7 @@ class OptionInfo
         void operator =(const OptionInfo &);
 };
 
-/*! \brief
+/*! \libinternal \brief
  * Pure interface for visiting options in a Options object.
  *
  * \see OptionsIterator
@@ -115,7 +115,7 @@ class OptionsVisitor
         virtual void visitOption(const OptionInfo &option) = 0;
 };
 
-/*! \brief
+/*! \libinternal \brief
  * Decorator class for visiting options in a Options object.
  *
  * This class provides an interface for looping through subsections and
index 992b1b2590920abf8072fabc0bed3108a665ec76..1a41faac7aa8160c482ed34652b13672bb3e2aed 100644 (file)
@@ -30,7 +30,7 @@
  */
 /*! \internal \file
  * \brief
- * Tests gmx::options::CommandLineParser.
+ * Tests gmx::CommandLineParser.
  *
  * These tests exercise a large fraction of the code, so they may
  * catch errors in other parts than just in command-line parsing.
index e7bdb5d5fa8d22d4ba4055c797d8fc6d72e56239..4bcdf28d71269f5f88795b5856f5da8c0a800f73 100644 (file)
@@ -32,7 +32,7 @@
  * \brief
  * Tests construction of basic option types.
  *
- * Most of the tests for the basic options are in assigner_test.cpp.
+ * Most of the tests for the basic options are in optionsassigner.cpp.
  * This file only tests behavior that should fail in parameter construction,
  * which would result in higher-level code asserting.
  *
index a1628c3c888c5ea36c1ea116d4ffdd99ee266591..665ba19828774169e3fc5e85df56bdcc9a64b69f 100644 (file)
  * Tests option assignment.
  *
  * In addition to testing gmx::OptionsAssigner, these are the main
- * tests for the classes from basicoptions.hpp and basicstorage.hpp (and their
- * base classes) that actually implement the behavior, as well as for the
- * internal implementation of the gmx::Options and
- * gmx::Option classes.
+ * tests for the classes from basicoptions.h and basicoptionstorage.h (and
+ * their base classes) that actually implement the behavior, as well as for the
+ * internal implementation of the gmx::Options and gmx::Option classes.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_options
index ee7b45a62be57d676b8d51e13380ec64387294d2..406a8ff95d705b61db00cf9f3c6dd3a45293e0ca 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "gromacs/fatalerror/fatalerror.h"
 
+/*! \brief
+ * Initializes unit testing with Google C++ Testing Framework.
+ */
 int main(int argc, char *argv[])
 {
     ::testing::InitGoogleTest(&argc, argv);
index 47207b0e29a044923c501312a1b1ac9c6c6545df..dcec555a06aeafe1fba38a153cfcc0b2715a9ba2 100644 (file)
  * \brief
  * Provides functionality for initializing and evaluating selections.
  *
+ * \internal
+ * Implementation details of different parts of the module are discussed on
+ * separate pages:
+ *   - \ref page_module_selection_custom
+ *   - \ref page_module_selection_parser
+ *   - \ref page_module_selection_compiler
+ *   - \ref page_module_selection_insolidangle
+ */
+/*! \ingroup group_analysismodules
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  */
 /*! \file
index 8fd510c34c3bab057d7950ccc60482aa7b14eaa2..783d2164d94f1b8f18b3ea2fa2575c72a9052685 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in centerofmass.h.
+ * \brief
+ * Implements functions in centerofmass.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -171,11 +175,11 @@ gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
 /*!
  * \param[in]  top   Topology structure with masses
  *   (can be NULL if \p bMASS==TRUE).
- * \param[in]  x     Forces on all atoms.
+ * \param[in]  f     Forces on all atoms.
  * \param[in]  nrefat Number of atoms in the index.
  * \param[in]  index Indices of atoms.
  * \param[in]  bMass If TRUE, force on COM is calculated.
- * \param[out] xout  Force on the COM/COG position for the indexed atoms.
+ * \param[out] fout  Force on the COM/COG position for the indexed atoms.
  * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is FALSE.
  *
  * Calls either gmx_calc_cog() or gmx_calc_cog_f() depending on the value of
@@ -431,7 +435,7 @@ gmx_calc_com_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
  * \param[in]  f     Forces on all atoms.
  * \param[in]  block t_block structure that divides \p index into blocks.
  * \param[in]  index Indices of atoms.
- * \param[out] xout  \p block->nr Forces on COG positions.
+ * \param[out] fout  \p block->nr Forces on COG positions.
  * \returns    0 on success, EINVAL if \p top is NULL.
  */
 int
@@ -501,7 +505,7 @@ gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
  * \param[in]  block t_block structure that divides \p index into blocks.
  * \param[in]  index Indices of atoms.
  * \param[in]  bMass If TRUE, force on COM is calculated.
- * \param[out] xout  \p block->nr forces on the COM/COG positions.
+ * \param[out] fout  \p block->nr forces on the COM/COG positions.
  * \returns    0 on success, EINVAL if \p top is NULL and \p bMass is TRUE.
  *
  * Calls either gmx_calc_com_block() or gmx_calc_cog_block() depending on the
index b66ca76ba88aa4352339fd98bea56ad590021408..b3e3d4b5e5e519216c133e7f12aa1b5d20cca353 100644 (file)
  *
  * Finally, there is a function gmx_calc_comg_blocka() that takes both the
  * index group and the partitioning as a single \c t_blocka structure.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef CENTEROFMASS_H
-#define CENTEROFMASS_H
+#ifndef GMX_SELECTION_CENTEROFMASS_H
+#define GMX_SELECTION_CENTEROFMASS_H
 
 #include "typedefs.h"
 
index 1a1d118bf8ef4b758563308fa0f25f4d266d4a0e..3500bcba440edebc4d285afe71fb9da9912aa032 100644 (file)
  * The memory usage could still be optimized.
  * Use of memory pooling could still be extended, and a lot of redundant
  * gmin/gmax data could be eliminated for complex arithmetic expressions.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 /*! \internal
- * \page selcompiler Selection compilation
+ * \page page_module_selection_compiler Selection compilation
  *
  * The compiler takes the selection element tree from the selection parser
- * (see \ref selparser) as input. The selection parser is quite independent of
- * selection evaluation details, and the compiler processes the tree to
- * conform to what the evaluation functions expect.
+ * (see \ref page_module_selection_parser) as input.
+ * The selection parser is quite independent of selection evaluation details,
+ * and the compiler processes the tree to conform to what the evaluation
+ * functions expect.
  * For better control and optimization possibilities, the compilation is
  * done on all selections simultaneously.
  * Hence, all the selections should be parsed before the compiler can be
  *
  * \todo
  * Some combinations of method parameter flags are not yet properly treated by
- * the compiler or the evaluation functions in evaluate.c. All the ones used by
+ * the compiler or the evaluation functions in evaluate.cpp. All the ones used by
  * currently implemented methods should work, but new combinations might not.
  *
  *
@@ -2603,7 +2607,7 @@ calculate_mass_charge(std::vector<gmx::Selection *> *selections,
  ********************************************************************/
 
 /*!
- * \param[in,out] sc Selection collection to be compiled.
+ * \param[in,out] coll Selection collection to be compiled.
  * \returns       0 on successful compilation, a non-zero error code on error.
  *
  * Before compilation, the selection collection should have been initialized
index 207f4481b3e50b65afd9e5d36d3e1f29611d9a7a..cf4d668d2d22d2ad3b50ca2332489725116665c0 100644 (file)
@@ -29,7 +29,8 @@
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in evaluate.h.
+ * \brief
+ * Implements functions in evaluate.h.
  *
  * \todo
  * One of the major bottlenecks for selection performance is that all the
@@ -41,6 +42,9 @@
  * something can be evaluated by residue/molecule instead by atom, and
  * converting selections by residue/molecule into selections by atom
  * when necessary.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index acb34ea653211197a0a785dc7479dfd594693a98..58ad7fbffd3902d3aa500ccf30d3d9bcb943b6aa 100644 (file)
  *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
- * Users should only use gmx_ana_selcollection_evaluate() declared in
- * \ref selection.h to evaluate selections.
+ * Users should only use SelectionCollection::evaluate() to evaluate
+ * selections.
  *
  * The functions defined in this header file are all the possible values
  * for the \c t_selelem::evaluate field (in addition to NULL).
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef SELECTION_EVALUATE_H
-#define SELECTION_EVALUATE_H
+#ifndef GMX_SELECTION_EVALUATE_H
+#define GMX_SELECTION_EVALUATE_H
 
 #include <typedefs.h>
 
index 6ae45c716f62c7e79eea927f4cb38057a690e542..40c7d95367b9ad5db5a788977f7d9b4a9f87ffa7 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in indexutil.h.
+ * \brief
+ * Implements functions in indexutil.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 6af9d9d6c0331c502ec0c9cb2b4d8647e191bcb5..6242853dc7797eff9177a37391babc5d302c1ae1 100644 (file)
  * check the validity of input groups.
  * Also, the mapping functions are useful when dealing with dynamic index
  * groups.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef INDEXUTIL_H
-#define INDEXUTIL_H
+#ifndef GMX_SELECTION_INDEXUTIL_H
+#define GMX_SELECTION_INDEXUTIL_H
 
 #include "typedefs.h"
 
index f28f2aaf5b20e759cd86a577b441d0262d329a19..3e8e9ad80654d7838c23ed712fb27bdd5680e1e1 100644 (file)
  */
 /*! \internal \file
  * \brief Definitions of generic keyword evaluation structures.
- * 
+ *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELECTION_KEYWORDS_H
 #define SELECTION_KEYWORDS_H
index a13f0887d5cd79c3d2ce62717425f08f5cc17f56..73105f20fca34a39c7e72b5b54160e4d41d872b4 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Memory pooling for selection evaluation.
+ * \brief
+ * Implements functions in mempool.h.
  *
- * \todo
- * Document these functions.
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 
 #include "mempool.h"
 
+//! Alignment in bytes for all returned blocks.
 #define ALIGN_STEP 8
 
+/*! \internal \brief
+ * Describes a single block allocated from the memory pool.
+ */
 typedef struct gmx_sel_mempool_block_t
 {
+    //! Pointer to the start of the block (as returned to the user).
     void                       *ptr;
+    //! Size of the block, including padding required to align next block.
     size_t                      size;
 } gmx_sel_mempool_block_t;
 
+/*! \internal \brief
+ * Describes a memory pool.
+ */
 struct gmx_sel_mempool_t
 {
+    //! Number of bytes currently allocated from the pool.
     size_t                      currsize;
+    //! Number of bytes free in the pool, or 0 if \a buffer is NULL.
     size_t                      freesize;
+    //! Memory area allocated for the pool, or NULL if not yet reserved.
     char                       *buffer;
+    //! Pointer to the first free byte (aligned at ::ALIGN_STEP) in \a buffer.
     char                       *freeptr;
+    //! Number of blocks allocated from the pool.
     int                         nblocks;
+    //! Array describing the allocated blocks.
     gmx_sel_mempool_block_t    *blockstack;
+    //! Number of elements allocated for the \a blockstack array.
     int                         blockstack_nalloc;
+    /*! \brief
+     * Maximum number of bytes that have been reserved from the pool
+     * simultaneously.
+     */
     size_t                      maxsize;
 };
 
index ca6abba6895af18a75b24b4ae4d1fa1e646f0274..dfaa81a13c12ff81ff94d8668cfff378f11a8f9b 100644 (file)
 /*! \internal \file
  * \brief Declarations for memory pooling functions.
  *
+ * \todo
+ * Document these functions.
+ *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef GMX_SELECTION_MEMPOOL_H
 #define GMX_SELECTION_MEMPOOL_H
 
 struct gmx_ana_index_t;
 
+/** Opaque struct for memory pooling. */
 typedef struct gmx_sel_mempool_t gmx_sel_mempool_t;
 
 /** Create an empty memory pool. */
index e4e79d5a2f46514161e41ceb43b68d5f16a3ed24..4aba85c89dea49e04333533f5e83802d14846a1b 100644 (file)
  *     without a memory cost.
  */
 /*! \internal \file
- * \brief Implementation of functions in nbsearch.h.
+ * \brief
+ * Implements functions in nbsearch.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -749,7 +753,6 @@ gmx_ana_nbsearch_pos_mindist(gmx_ana_nbsearch_t *d, gmx_ana_pos_t *p, int i)
 
 /*!
  * \param[in]  d   Neighborhood search data structure.
- * \param[in]  n   Number of test positions in \p x.
  * \param[in]  x   Test positions.
  * \param[out] jp  Index of the reference position in the first pair.
  * \returns    TRUE if there are positions within the cutoff.
index 5dd73521ea0c562a40623af6b1795b2fc9956681..08f681504b399cb0468758edf803ef38d0fbeb43 100644 (file)
  * The functions within this file can be used independently of the other parts
  * of the library.
  * The library also uses the functions internally.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef NBSEARCH_H
-#define NBSEARCH_H
+#ifndef GMX_SELECTION_NBSEARCH_H
+#define GMX_SELECTION_NBSEARCH_H
 
 #include "typedefs.h"
 
index 8398f491a93f36ed0b5196c2951189d1bc8e9834..4a211e96ec9b9ab087cb8b600abda9b858d8e280 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Implementation of functions in selparam.h.
+ * Implements functions in selparam.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -1240,7 +1243,7 @@ next_param:
             bOk = FALSE;
         }
     }
-    
+
     _gmx_selexpr_free_params(pparams);
     return bOk;
 }
index e8aac56206f8d79b83ac9a7ae4e84f7a8a54ef5f..e9735b6651ed41d3f25705ad8fbf59df59199e6f 100644 (file)
 
 
 /* Copy the first part of user declarations.  */
-#line 34 "parser.y"
+#line 37 "parser.y"
 
-/*! \internal \file parser.c
+/*! \internal \file parser.cpp
  * \brief Generated (from parser.y by Bison) parser for the selection language.
+ *
+ * \ingroup module_selection
  */
 /*! \internal \file parser.h
  * \brief Generated (from parser.y by Bison) parser include file.
+ *
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -195,7 +199,7 @@ yyerror(yyscan_t, char const *s);
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 62 "parser.y"
+#line 69 "parser.y"
 {
     int                         i;
     real                        r;
@@ -208,7 +212,7 @@ typedef union YYSTYPE
     struct t_selexpr_param     *param;
 }
 /* Line 187 of yacc.c.  */
-#line 212 "parser.c"
+#line 216 "parser.cpp"
        YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -221,7 +225,7 @@ typedef union YYSTYPE
 
 
 /* Line 216 of yacc.c.  */
-#line 225 "parser.c"
+#line 229 "parser.cpp"
 
 #ifdef short
 # undef short
@@ -534,14 +538,14 @@ static const yytype_int8 yyrhs[] =
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   178,   178,   179,   188,   189,   209,   213,   214,   223,
-     233,   235,   237,   239,   241,   247,   248,   251,   252,   256,
-     257,   262,   263,   274,   275,   278,   279,   287,   293,   299,
-     311,   315,   323,   329,   337,   338,   342,   347,   352,   360,
-     372,   379,   389,   394,   402,   404,   406,   408,   410,   412,
-     414,   421,   428,   440,   445,   449,   457,   468,   472,   476,
-     485,   487,   492,   493,   498,   505,   506,   510,   511,   513,
-     517,   519,   521,   523,   525,   530,   535
+       0,   185,   185,   186,   195,   196,   216,   220,   221,   230,
+     240,   242,   244,   246,   248,   254,   255,   258,   259,   263,
+     264,   269,   270,   281,   282,   285,   286,   294,   300,   306,
+     318,   322,   330,   336,   344,   345,   349,   354,   359,   367,
+     379,   386,   396,   401,   409,   411,   413,   415,   417,   419,
+     421,   428,   435,   447,   452,   456,   464,   475,   479,   483,
+     492,   494,   499,   500,   505,   512,   513,   517,   518,   520,
+     524,   526,   528,   530,   532,   537,   542
 };
 #endif
 
@@ -1268,99 +1272,99 @@ yydestruct (yymsg, yytype, yyvaluep, scanner)
   switch (yytype)
     {
       case 5: /* "HELP_TOPIC" */
-#line 158 "parser.y"
+#line 165 "parser.y"
        { free((yyvaluep->str));                     };
-#line 1274 "parser.c"
+#line 1278 "parser.cpp"
        break;
       case 8: /* "STR" */
-#line 158 "parser.y"
+#line 165 "parser.y"
        { free((yyvaluep->str));                     };
-#line 1279 "parser.c"
+#line 1283 "parser.cpp"
        break;
       case 9: /* "IDENTIFIER" */
-#line 158 "parser.y"
+#line 165 "parser.y"
        { free((yyvaluep->str));                     };
-#line 1284 "parser.c"
+#line 1288 "parser.cpp"
        break;
       case 25: /* "PARAM" */
-#line 159 "parser.y"
+#line 166 "parser.y"
        { if((yyvaluep->str)) free((yyvaluep->str));              };
-#line 1289 "parser.c"
+#line 1293 "parser.cpp"
        break;
       case 28: /* "CMP_OP" */
-#line 158 "parser.y"
+#line 165 "parser.y"
        { free((yyvaluep->str));                     };
-#line 1294 "parser.c"
+#line 1298 "parser.cpp"
        break;
       case 46: /* "command" */
-#line 160 "parser.y"
+#line 167 "parser.y"
        { if((yyvaluep->sel)) _gmx_selelem_free((yyvaluep->sel)); };
-#line 1299 "parser.c"
+#line 1303 "parser.cpp"
        break;
       case 47: /* "cmd_plain" */
-#line 160 "parser.y"
+#line 167 "parser.y"
        { if((yyvaluep->sel)) _gmx_selelem_free((yyvaluep->sel)); };
-#line 1304 "parser.c"
+#line 1308 "parser.cpp"
        break;
       case 50: /* "selection" */
-#line 161 "parser.y"
+#line 168 "parser.y"
        { _gmx_selelem_free_chain((yyvaluep->sel));  };
-#line 1309 "parser.c"
+#line 1313 "parser.cpp"
        break;
       case 52: /* "string" */
-#line 158 "parser.y"
+#line 165 "parser.y"
        { free((yyvaluep->str));                     };
-#line 1314 "parser.c"
+#line 1318 "parser.cpp"
        break;
       case 53: /* "sel_expr" */
-#line 162 "parser.y"
+#line 169 "parser.y"
        { _gmx_selelem_free((yyvaluep->sel));        };
-#line 1319 "parser.c"
+#line 1323 "parser.cpp"
        break;
       case 55: /* "num_expr" */
-#line 162 "parser.y"
+#line 169 "parser.y"
        { _gmx_selelem_free((yyvaluep->sel));        };
-#line 1324 "parser.c"
+#line 1328 "parser.cpp"
        break;
       case 56: /* "str_expr" */
-#line 162 "parser.y"
+#line 169 "parser.y"
        { _gmx_selelem_free((yyvaluep->sel));        };
-#line 1329 "parser.c"
+#line 1333 "parser.cpp"
        break;
       case 57: /* "pos_expr" */
-#line 162 "parser.y"
+#line 169 "parser.y"
        { _gmx_selelem_free((yyvaluep->sel));        };
-#line 1334 "parser.c"
+#line 1338 "parser.cpp"
        break;
       case 58: /* "method_params" */
-#line 163 "parser.y"
+#line 170 "parser.y"
        { _gmx_selexpr_free_params((yyvaluep->param)); };
-#line 1339 "parser.c"
+#line 1343 "parser.cpp"
        break;
       case 59: /* "method_param_list" */
-#line 163 "parser.y"
+#line 170 "parser.y"
        { _gmx_selexpr_free_params((yyvaluep->param)); };
-#line 1344 "parser.c"
+#line 1348 "parser.cpp"
        break;
       case 60: /* "method_param" */
-#line 163 "parser.y"
+#line 170 "parser.y"
        { _gmx_selexpr_free_params((yyvaluep->param)); };
-#line 1349 "parser.c"
+#line 1353 "parser.cpp"
        break;
       case 61: /* "value_list" */
-#line 164 "parser.y"
+#line 171 "parser.y"
        { _gmx_selexpr_free_values((yyvaluep->val)); };
-#line 1354 "parser.c"
+#line 1358 "parser.cpp"
        break;
       case 62: /* "value_list_nonempty" */
-#line 164 "parser.y"
+#line 171 "parser.y"
        { _gmx_selexpr_free_values((yyvaluep->val)); };
-#line 1359 "parser.c"
+#line 1363 "parser.cpp"
        break;
       case 63: /* "value_item" */
-#line 164 "parser.y"
+#line 171 "parser.y"
        { _gmx_selexpr_free_values((yyvaluep->val)); };
-#line 1364 "parser.c"
+#line 1368 "parser.cpp"
        break;
 
       default:
@@ -1669,12 +1673,12 @@ yyreduce:
   switch (yyn)
     {
         case 2:
-#line 178 "parser.y"
+#line 185 "parser.y"
     { (yyval.sel) = NULL ;}
     break;
 
   case 3:
-#line 180 "parser.y"
+#line 187 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_append_selection((yyvsp[(2) - (2)].sel), (yyvsp[(1) - (2)].sel), scanner);
                  if (_gmx_sel_parser_should_finish(scanner))
@@ -1683,12 +1687,12 @@ yyreduce:
     break;
 
   case 4:
-#line 188 "parser.y"
+#line 195 "parser.y"
     { (yyval.sel) = (yyvsp[(1) - (2)].sel); ;}
     break;
 
   case 5:
-#line 190 "parser.y"
+#line 197 "parser.y"
     {
                  (yyval.sel) = NULL;
                  _gmx_selparser_error("invalid selection '%s'",
@@ -1707,7 +1711,7 @@ yyreduce:
     break;
 
   case 6:
-#line 209 "parser.y"
+#line 216 "parser.y"
     {
                  (yyval.sel) = NULL;
                  _gmx_sel_handle_empty_cmd(scanner);
@@ -1715,12 +1719,12 @@ yyreduce:
     break;
 
   case 7:
-#line 213 "parser.y"
+#line 220 "parser.y"
     { (yyval.sel) = NULL; ;}
     break;
 
   case 8:
-#line 215 "parser.y"
+#line 222 "parser.y"
     {
                  t_selelem *s, *p;
                  s = _gmx_sel_init_group_by_id((yyvsp[(1) - (1)].i), scanner);
@@ -1732,7 +1736,7 @@ yyreduce:
     break;
 
   case 9:
-#line 224 "parser.y"
+#line 231 "parser.y"
     {
                  t_selelem *s, *p;
                  s = _gmx_sel_init_group_by_name((yyvsp[(1) - (1)].str), scanner);
@@ -1745,52 +1749,52 @@ yyreduce:
     break;
 
   case 10:
-#line 234 "parser.y"
+#line 241 "parser.y"
     { (yyval.sel) = _gmx_sel_init_selection(NULL, (yyvsp[(1) - (1)].sel), scanner); ;}
     break;
 
   case 11:
-#line 236 "parser.y"
+#line 243 "parser.y"
     { (yyval.sel) = _gmx_sel_init_selection((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].sel), scanner);   ;}
     break;
 
   case 12:
-#line 238 "parser.y"
+#line 245 "parser.y"
     { (yyval.sel) = _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].sel), scanner);  ;}
     break;
 
   case 13:
-#line 240 "parser.y"
+#line 247 "parser.y"
     { (yyval.sel) = _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].sel), scanner);  ;}
     break;
 
   case 14:
-#line 242 "parser.y"
+#line 249 "parser.y"
     { (yyval.sel) = _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].sel), scanner);  ;}
     break;
 
   case 15:
-#line 247 "parser.y"
+#line 254 "parser.y"
     { _gmx_sel_handle_help_cmd(NULL, scanner); ;}
     break;
 
   case 17:
-#line 251 "parser.y"
+#line 258 "parser.y"
     { _gmx_sel_handle_help_cmd((yyvsp[(2) - (2)].str), scanner); ;}
     break;
 
   case 18:
-#line 252 "parser.y"
+#line 259 "parser.y"
     { _gmx_sel_handle_help_cmd((yyvsp[(2) - (2)].str), scanner); ;}
     break;
 
   case 19:
-#line 256 "parser.y"
+#line 263 "parser.y"
     { (yyval.sel) = (yyvsp[(1) - (1)].sel); ;}
     break;
 
   case 20:
-#line 258 "parser.y"
+#line 265 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_position((yyvsp[(1) - (1)].sel), NULL, scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1798,12 +1802,12 @@ yyreduce:
     break;
 
   case 21:
-#line 262 "parser.y"
+#line 269 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); ;}
     break;
 
   case 22:
-#line 264 "parser.y"
+#line 271 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_modifier((yyvsp[(2) - (3)].meth), (yyvsp[(3) - (3)].param), (yyvsp[(1) - (3)].sel), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1811,27 +1815,27 @@ yyreduce:
     break;
 
   case 23:
-#line 274 "parser.y"
+#line 281 "parser.y"
     { (yyval.r) = (yyvsp[(1) - (1)].i); ;}
     break;
 
   case 24:
-#line 275 "parser.y"
+#line 282 "parser.y"
     { (yyval.r) = (yyvsp[(1) - (1)].r); ;}
     break;
 
   case 25:
-#line 278 "parser.y"
+#line 285 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str); ;}
     break;
 
   case 26:
-#line 279 "parser.y"
+#line 286 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str); ;}
     break;
 
   case 27:
-#line 288 "parser.y"
+#line 295 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_BOOLEAN);
                  (yyval.sel)->u.boolt = BOOL_NOT;
@@ -1840,7 +1844,7 @@ yyreduce:
     break;
 
   case 28:
-#line 294 "parser.y"
+#line 301 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_BOOLEAN);
                  (yyval.sel)->u.boolt = BOOL_AND;
@@ -1849,7 +1853,7 @@ yyreduce:
     break;
 
   case 29:
-#line 300 "parser.y"
+#line 307 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_BOOLEAN);
                  (yyval.sel)->u.boolt = BOOL_OR;
@@ -1858,12 +1862,12 @@ yyreduce:
     break;
 
   case 30:
-#line 311 "parser.y"
+#line 318 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); ;}
     break;
 
   case 31:
-#line 316 "parser.y"
+#line 323 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_comparison((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), (yyvsp[(2) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1871,7 +1875,7 @@ yyreduce:
     break;
 
   case 32:
-#line 324 "parser.y"
+#line 331 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_group_by_name((yyvsp[(2) - (2)].str), scanner);
                  free((yyvsp[(2) - (2)].str));
@@ -1880,7 +1884,7 @@ yyreduce:
     break;
 
   case 33:
-#line 330 "parser.y"
+#line 337 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_group_by_id((yyvsp[(2) - (2)].i), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1888,17 +1892,17 @@ yyreduce:
     break;
 
   case 34:
-#line 337 "parser.y"
+#line 344 "parser.y"
     { (yyval.str) = NULL; ;}
     break;
 
   case 35:
-#line 338 "parser.y"
+#line 345 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str);   ;}
     break;
 
   case 36:
-#line 343 "parser.y"
+#line 350 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), NULL, (yyvsp[(1) - (2)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1906,7 +1910,7 @@ yyreduce:
     break;
 
   case 37:
-#line 348 "parser.y"
+#line 355 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_keyword((yyvsp[(2) - (3)].meth), process_value_list((yyvsp[(3) - (3)].val), NULL), (yyvsp[(1) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1914,7 +1918,7 @@ yyreduce:
     break;
 
   case 38:
-#line 353 "parser.y"
+#line 360 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_keyword((yyvsp[(2) - (3)].meth), process_value_list((yyvsp[(3) - (3)].val), NULL), (yyvsp[(1) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1922,7 +1926,7 @@ yyreduce:
     break;
 
   case 39:
-#line 361 "parser.y"
+#line 368 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_method((yyvsp[(2) - (3)].meth), (yyvsp[(3) - (3)].param), (yyvsp[(1) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1930,7 +1934,7 @@ yyreduce:
     break;
 
   case 40:
-#line 373 "parser.y"
+#line 380 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_CONST);
                  _gmx_selelem_set_vtype((yyval.sel), INT_VALUE);
@@ -1940,7 +1944,7 @@ yyreduce:
     break;
 
   case 41:
-#line 380 "parser.y"
+#line 387 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_CONST);
                  _gmx_selelem_set_vtype((yyval.sel), REAL_VALUE);
@@ -1950,7 +1954,7 @@ yyreduce:
     break;
 
   case 42:
-#line 390 "parser.y"
+#line 397 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), NULL, (yyvsp[(1) - (2)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1958,7 +1962,7 @@ yyreduce:
     break;
 
   case 43:
-#line 395 "parser.y"
+#line 402 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_method((yyvsp[(2) - (3)].meth), (yyvsp[(3) - (3)].param), (yyvsp[(1) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -1966,42 +1970,42 @@ yyreduce:
     break;
 
   case 44:
-#line 403 "parser.y"
+#line 410 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), '+', scanner); ;}
     break;
 
   case 45:
-#line 405 "parser.y"
+#line 412 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), '-', scanner); ;}
     break;
 
   case 46:
-#line 407 "parser.y"
+#line 414 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), '*', scanner); ;}
     break;
 
   case 47:
-#line 409 "parser.y"
+#line 416 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), '/', scanner); ;}
     break;
 
   case 48:
-#line 411 "parser.y"
+#line 418 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(2) - (2)].sel), NULL, '-', scanner); ;}
     break;
 
   case 49:
-#line 413 "parser.y"
+#line 420 "parser.y"
     { (yyval.sel) = _gmx_sel_init_arithmetic((yyvsp[(1) - (3)].sel), (yyvsp[(3) - (3)].sel), '^', scanner); ;}
     break;
 
   case 50:
-#line 414 "parser.y"
+#line 421 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); ;}
     break;
 
   case 51:
-#line 422 "parser.y"
+#line 429 "parser.y"
     {
                  (yyval.sel) = _gmx_selelem_create(SEL_CONST);
                  _gmx_selelem_set_vtype((yyval.sel), STR_VALUE);
@@ -2011,7 +2015,7 @@ yyreduce:
     break;
 
   case 52:
-#line 429 "parser.y"
+#line 436 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), NULL, (yyvsp[(1) - (2)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -2019,17 +2023,17 @@ yyreduce:
     break;
 
   case 53:
-#line 441 "parser.y"
+#line 448 "parser.y"
     { (yyval.sel) = _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r)); ;}
     break;
 
   case 54:
-#line 445 "parser.y"
+#line 452 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); ;}
     break;
 
   case 55:
-#line 450 "parser.y"
+#line 457 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_method((yyvsp[(1) - (2)].meth), (yyvsp[(2) - (2)].param), NULL, scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -2037,7 +2041,7 @@ yyreduce:
     break;
 
   case 56:
-#line 458 "parser.y"
+#line 465 "parser.y"
     {
                  (yyval.sel) = _gmx_sel_init_position((yyvsp[(3) - (3)].sel), (yyvsp[(1) - (3)].str), scanner);
                  if ((yyval.sel) == NULL) YYERROR;
@@ -2045,42 +2049,42 @@ yyreduce:
     break;
 
   case 57:
-#line 469 "parser.y"
+#line 476 "parser.y"
     { (yyval.sel) = _gmx_sel_init_variable_ref((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 58:
-#line 473 "parser.y"
+#line 480 "parser.y"
     { (yyval.sel) = _gmx_sel_init_variable_ref((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 59:
-#line 477 "parser.y"
+#line 484 "parser.y"
     { (yyval.sel) = _gmx_sel_init_variable_ref((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 60:
-#line 486 "parser.y"
+#line 493 "parser.y"
     { (yyval.param) = process_param_list((yyvsp[(1) - (1)].param)); ;}
     break;
 
   case 61:
-#line 488 "parser.y"
+#line 495 "parser.y"
     { (yyval.param) = process_param_list((yyvsp[(1) - (2)].param)); ;}
     break;
 
   case 62:
-#line 492 "parser.y"
+#line 499 "parser.y"
     { (yyval.param) = NULL;              ;}
     break;
 
   case 63:
-#line 494 "parser.y"
+#line 501 "parser.y"
     { (yyvsp[(2) - (2)].param)->next = (yyvsp[(1) - (2)].param); (yyval.param) = (yyvsp[(2) - (2)].param); ;}
     break;
 
   case 64:
-#line 499 "parser.y"
+#line 506 "parser.y"
     {
                  (yyval.param) = _gmx_selexpr_create_param((yyvsp[(1) - (2)].str));
                  (yyval.param)->value = process_value_list((yyvsp[(2) - (2)].val), &(yyval.param)->nval);
@@ -2088,52 +2092,52 @@ yyreduce:
     break;
 
   case 65:
-#line 505 "parser.y"
+#line 512 "parser.y"
     { (yyval.val) = NULL; ;}
     break;
 
   case 66:
-#line 506 "parser.y"
+#line 513 "parser.y"
     { (yyval.val) = (yyvsp[(1) - (1)].val);   ;}
     break;
 
   case 67:
-#line 510 "parser.y"
+#line 517 "parser.y"
     { (yyval.val) = (yyvsp[(1) - (1)].val); ;}
     break;
 
   case 68:
-#line 512 "parser.y"
+#line 519 "parser.y"
     { (yyvsp[(2) - (2)].val)->next = (yyvsp[(1) - (2)].val); (yyval.val) = (yyvsp[(2) - (2)].val); ;}
     break;
 
   case 69:
-#line 514 "parser.y"
+#line 521 "parser.y"
     { (yyvsp[(3) - (3)].val)->next = (yyvsp[(1) - (3)].val); (yyval.val) = (yyvsp[(3) - (3)].val); ;}
     break;
 
   case 70:
-#line 518 "parser.y"
+#line 525 "parser.y"
     { (yyval.val) = _gmx_selexpr_create_value_expr((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 71:
-#line 520 "parser.y"
+#line 527 "parser.y"
     { (yyval.val) = _gmx_selexpr_create_value_expr((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 72:
-#line 522 "parser.y"
+#line 529 "parser.y"
     { (yyval.val) = _gmx_selexpr_create_value_expr((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 73:
-#line 524 "parser.y"
+#line 531 "parser.y"
     { (yyval.val) = _gmx_selexpr_create_value_expr((yyvsp[(1) - (1)].sel)); ;}
     break;
 
   case 74:
-#line 526 "parser.y"
+#line 533 "parser.y"
     {
                  (yyval.val) = _gmx_selexpr_create_value(INT_VALUE);
                  (yyval.val)->u.i.i1 = (yyvsp[(1) - (3)].i); (yyval.val)->u.i.i2 = (yyvsp[(3) - (3)].i);
@@ -2141,7 +2145,7 @@ yyreduce:
     break;
 
   case 75:
-#line 531 "parser.y"
+#line 538 "parser.y"
     {
                  (yyval.val) = _gmx_selexpr_create_value(REAL_VALUE);
                  (yyval.val)->u.r.r1 = (yyvsp[(1) - (3)].i); (yyval.val)->u.r.r2 = (yyvsp[(3) - (3)].r);
@@ -2149,7 +2153,7 @@ yyreduce:
     break;
 
   case 76:
-#line 536 "parser.y"
+#line 543 "parser.y"
     {
                  (yyval.val) = _gmx_selexpr_create_value(REAL_VALUE);
                  (yyval.val)->u.r.r1 = (yyvsp[(1) - (3)].r); (yyval.val)->u.r.r2 = (yyvsp[(3) - (3)].r);
@@ -2158,7 +2162,7 @@ yyreduce:
 
 
 /* Line 1267 of yacc.c.  */
-#line 2162 "parser.c"
+#line 2166 "parser.cpp"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2372,7 +2376,7 @@ yyreturn:
 }
 
 
-#line 542 "parser.y"
+#line 549 "parser.y"
 
 
 static t_selexpr_value *
index 088158bd72fd40369d7a2b874d7348dba2db6c7e..198724754bce68469a5004ceac341c930fe8d10a 100644 (file)
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 62 "parser.y"
+#line 69 "parser.y"
 {
     int                         i;
     real                        r;
index 6738ff11e500ac23d7b7a11686166e80a4527669..7ca3d5a5d26300f5f92cae1965a4c3fa6ed6af91 100644 (file)
  */
 /*! \internal \file
  * \brief Grammar description and parser for the selection language.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 %{
-/*! \internal \file parser.c
+/*! \internal \file parser.cpp
  * \brief Generated (from parser.y by Bison) parser for the selection language.
+ *
+ * \ingroup module_selection
  */
 /*! \internal \file parser.h
  * \brief Generated (from parser.y by Bison) parser include file.
+ *
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index f63e25b82f3a67ab20b8a0c4bafb7170c7b9ca59..7fa4f6ecade7bf5e3ad5df8d360184e655a54528 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions of in parsetree.h.
+ * \brief
+ * Implements functions in parsetree.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 /*! \internal
- * \page selparser Selection parsing
+ * \page page_module_selection_parser Selection parsing
  *
  * The selection parser is implemented in the following files:
  *  - scanner.l:
  *    Tokenizer implemented using Flex, splits the input into tokens
  *    (scanner.c and scanner_flex.h are generated from this file).
- *  - scanner.h, scanner_internal.h, scanner_internal.c:
+ *  - scanner.h, scanner_internal.h, scanner_internal.cpp:
  *    Helper functions for scanner.l and for interfacing between
  *    scanner.l and parser.y. Functions in scanner_internal.h are only
  *    used from scanner.l, while scanner.h is used from the parser.
- *  - symrec.h, symrec.c:
+ *  - symrec.h, symrec.cpp:
  *    Functions used by the tokenizer to handle the symbol table, i.e.,
  *    the recognized keywords. Some basic keywords are hardcoded into
  *    scanner.l, but all method and variable references go through the
  *    symbol table, as do position evaluation keywords.
  *  - parser.y:
  *    Semantic rules for parsing the grammar
- *    (parser.c and parser.h are generated from this file by Bison).
- *  - parsetree.h, parsetree.c:
+ *    (parser.cpp and parser.h are generated from this file by Bison).
+ *  - parsetree.h, parsetree.cpp:
  *    Functions called from actions in parser.y to construct the
  *    evaluation elements corresponding to different grammar elements.
- *    parsetree.c also defines the external interface of the parser,
- *    i.e., the \c gmx_ana_selcollection_parse_*() functions declared
- *    in selection.h.
  *  - params.c:
  *    Defines a function that processes the parameters of selection
  *    methods and initializes the children of the method element.
+ *  - selectioncollection.h, selectioncollection.cpp:
+ *    These files define the high-level public interface to the parser
+ *    through SelectionCollection::parseFromStdin(),
+ *    SelectionCollection::parseFromFile() and
+ *    SelectionCollection::parseFromString().
  *
- * The basic control flow in the parser is as follows: when a
- * fmx_ana_selcollection_parse_*() gets called, it performs some
+ * The basic control flow in the parser is as follows: when a parser function
+ * in SelectionCollection gets called, it performs some
  * initialization, and then calls the _gmx_sel_yyparse() function generated
  * by Bison. This function then calls _gmx_sel_yylex() to repeatedly read
  * tokens from the input (more complex tasks related to token recognition
- * and bookkeeping are done by functions in scanner_internal.c) and uses the
+ * and bookkeeping are done by functions in scanner_internal.cpp) and uses the
  * grammar rules to decide what to do with them. Whenever a grammar rule
- * matches, a corresponding function in parsetree.c is called to construct
- * either a temporary representation for the object or a \c t_selelem object
+ * matches, a corresponding function in parsetree.cpp is called to construct
+ * either a temporary representation for the object or a ::t_selelem object
  * (some simple rules are handled internally in parser.y).
- * When a complete selection has been parsed, the functions in parsetree.c
- * also take care of updating the \c gmx_ana_selcollection_t structure
+ * When a complete selection has been parsed, the functions in parsetree.cpp
+ * also take care of updating the ::gmx_ana_selcollection_t structure
  * appropriately.
  *
- * The rest of this page describes the resulting \c t_selelem object tree.
+ * The rest of this page describes the resulting ::t_selelem object tree.
  * Before the selections can be evaluated, this tree needs to be passed to
  * the selection compiler, which is described on a separate page:
- * \ref selcompiler
+ * \ref page_module_selection_compiler
  *
  *
  * \section selparser_tree Element tree constructed by the parser
index fce054d0dfa4e77b273b9d8bd61b16f4a4632d83..2bcc4b83311f4510357a0af7224844c778b456dd 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Handling of intermediate selection parser data.
+ * \brief
+ * Handling of intermediate selection parser data.
  *
  * The data types declared in this header are used by the parser to store
  * intermediate data when constructing method expressions.
  * In particular, the parameters for the method are stored.
  * The intermediate data is freed once a \c t_selelem object can be
  * constructed.
- * 
+ *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELECTION_PARSETREE_H
 #define SELECTION_PARSETREE_H
@@ -61,6 +65,7 @@ typedef struct t_selexpr_value
     e_selvalue_t            type;
     /** TRUE if the value is the result of an expression. */
     gmx_bool                    bExpr;
+    /** The actual value. */
     union {
         /** The integer value/range (\p type INT_VALUE); */
         struct {
index 3147f951b2af8be2d7953f0b67383302f5942d37..5094166f3d7956e2d033f3a39a89728b0e933c8e 100644 (file)
@@ -79,7 +79,8 @@
  * gmx_ana_poscalc_create_enum() is also provided for convenience.
  */
 /*! \internal \file
- * \brief Implementation of functions in poscalc.h.
+ * \brief
+ * Implements functions in poscalc.h.
  *
  * \todo
  * There is probably some room for optimization in the calculation of
  * but better heuristics could probably be implemented.
  * For best results, the setup should probably be postponed (at least
  * partially) to gmx_ana_poscalc_init_eval().
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -208,7 +212,8 @@ struct gmx_ana_poscalc_t
     /** Collection this calculation belongs to. */
     gmx_ana_poscalc_coll_t   *coll;
 };
-    
+
+//! Strings returned by gmx_ana_poscalc_create_type_enum().
 static const char *const poscalc_enum_strings[] = {
     "atom",
     "res_com",       "res_cog",
@@ -221,6 +226,7 @@ static const char *const poscalc_enum_strings[] = {
     "dyn_mol_com",   "dyn_mol_cog",
     NULL,
 };
+//! Number of elements in ::poscalc_enum_strings.
 #define NENUM asize(poscalc_enum_strings)
 
 /*! \brief
index aaac1836df6b564a05699f1608aa738bd4c58091..80045288feba9f1292d13a494b1604dc77ebada3 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \file
+/*! \internal \file
  * \brief API for structured and optimized calculation of positions.
  *
  * The functions in this header are used internally by the analysis library
  * need. Instead, one should write an analysis tool such that it gets all
  * positions through selections.
  *
- * \internal
- *
  * The API is documented in more detail on a separate page:
  * \ref poscalcengine.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef POSCALC_H
 #define POSCALC_H
index 03eaafd9ef73ac9cc8763b2b9be17d4a59858e94..3d16704e51b0c7e9dbae7701eed38f1e88c7968d 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in position.h.
+ * \brief
+ * Implements functions in position.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 4e27d513aee22f588607f27b70c5186f88ffcabb..9427f8832cd481909f15e6f53e1693f5bf477b9f 100644 (file)
@@ -30,6 +30,9 @@
  */
 /*! \file
  * \brief API for handling positions.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef POSITION_H
 #define POSITION_H
index df7e77cedb549daf3f9fc4844076c3f2c1ad1b2f..e8af512d3714127e881a6691452e7a3386a995d2 100755 (executable)
@@ -18,5 +18,5 @@ if [[ -f $dirname/parser.y && -f $dirname/scanner.l ]] ; then
     cd $dirname
 fi
 
-[[ $FORCE || parser.y  -nt parser.cpp ]]  && bison -d -t -o parser.cpp parser.y
+[[ $FORCE || parser.y  -nt parser.cpp ]]  && bison -t -o parser.cpp --defines=parser.h parser.y
 [[ $FORCE || scanner.l -nt scanner.cpp ]] && flex -o scanner.cpp scanner.l
index 7236ecc2778150fded09c8dea48d1f110a7e3699..7ef03c7f9ce5d4cfe33b0df7ea9196f826b8aba9 100644 (file)
@@ -1,6 +1,6 @@
-#line 2 "scanner.c"
+#line 2 "scanner.cpp"
 
-#line 4 "scanner.c"
+#line 4 "scanner.cpp"
 
 #define  YY_INT_ALIGNED short int
 
@@ -545,13 +545,18 @@ static yyconst flex_int16_t yy_chk[208] =
 /*! \cond \internal \file scanner.l
  * \brief
  * Tokenizer for the selection language.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  * \endcond
  */
-/*! \internal \file scanner.c
+/*! \internal \file scanner.cpp
  * \brief
  * Generated (from scanner.l by Flex) tokenizer for the selection language.
+ *
+ * \ingroup module_selection
  */
-#line 41 "scanner.l"
+#line 46 "scanner.l"
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -571,7 +576,7 @@ static yyconst flex_int16_t yy_chk[208] =
 
 
 
-#line 575 "scanner.c"
+#line 580 "scanner.cpp"
 
 #define INITIAL 0
 #define matchof 1
@@ -801,7 +806,7 @@ YY_DECL
        register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 80 "scanner.l"
+#line 85 "scanner.l"
 
 
 
@@ -834,7 +839,7 @@ YY_DECL
     }
 
 
-#line 838 "scanner.c"
+#line 843 "scanner.cpp"
 
        if ( !yyg->yy_init )
                {
@@ -915,34 +920,34 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 112 "scanner.l"
+#line 117 "scanner.l"
 
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 113 "scanner.l"
+#line 118 "scanner.l"
 { yylval->i   = strtol(yytext, NULL, 10);    ADD_TOKEN; return TOK_INT; }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 114 "scanner.l"
+#line 119 "scanner.l"
 { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 115 "scanner.l"
+#line 120 "scanner.l"
 { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR;  }
        YY_BREAK
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 117 "scanner.l"
+#line 122 "scanner.l"
 { _gmx_sel_lexer_add_token(" ", 1, state); }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 118 "scanner.l"
+#line 123 "scanner.l"
 {
                     if (yytext[0] == ';' || state->bInteractive)
                     {
@@ -957,110 +962,110 @@ YY_RULE_SETUP
        YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 130 "scanner.l"
+#line 135 "scanner.l"
 { BEGIN(help); return HELP; }
        YY_BREAK
 
 case 8:
 YY_RULE_SETUP
-#line 132 "scanner.l"
+#line 137 "scanner.l"
 
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 133 "scanner.l"
+#line 138 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); return HELP_TOPIC; }
        YY_BREAK
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 134 "scanner.l"
+#line 139 "scanner.l"
 { return CMD_SEP; }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 135 "scanner.l"
+#line 140 "scanner.l"
 { return INVALID; }
        YY_BREAK
 
 
 case 12:
 YY_RULE_SETUP
-#line 139 "scanner.l"
+#line 144 "scanner.l"
 { ADD_TOKEN; yylval->i = 1; return TOK_INT; }
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 140 "scanner.l"
+#line 145 "scanner.l"
 { ADD_TOKEN; yylval->i = 0; return TOK_INT; }
        YY_BREAK
 
 case 14:
 YY_RULE_SETUP
-#line 142 "scanner.l"
+#line 147 "scanner.l"
 { ADD_TOKEN; return GROUP; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 143 "scanner.l"
+#line 148 "scanner.l"
 { ADD_TOKEN; return TO; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 144 "scanner.l"
+#line 149 "scanner.l"
 { ADD_TOKEN; BEGIN(0); return OF; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 145 "scanner.l"
+#line 150 "scanner.l"
 { ADD_TOKEN; return AND; }
        YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 146 "scanner.l"
+#line 151 "scanner.l"
 { ADD_TOKEN; return OR; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 147 "scanner.l"
+#line 152 "scanner.l"
 { ADD_TOKEN; return XOR; }
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 148 "scanner.l"
+#line 153 "scanner.l"
 { ADD_TOKEN; return NOT; }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 149 "scanner.l"
+#line 154 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
        YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 151 "scanner.l"
+#line 156 "scanner.l"
 { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
        YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 153 "scanner.l"
+#line 158 "scanner.l"
 { _gmx_sel_lexer_add_token(" ", 1, state); }
        YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 154 "scanner.l"
+#line 159 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
        YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 155 "scanner.l"
+#line 160 "scanner.l"
 { ADD_TOKEN; return yytext[0]; }
        YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 156 "scanner.l"
+#line 161 "scanner.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 1064 "scanner.c"
+#line 1069 "scanner.cpp"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(matchof):
 case YY_STATE_EOF(matchbool):
@@ -2216,4 +2221,4 @@ void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 156 "scanner.l"
+#line 161 "scanner.l"
index f3404ca9487e9187603acb54b0f88d822c09211d..ff91c066c3aa98e9aac6533a2f1505f90f1af752 100644 (file)
 /*! \cond \internal \file scanner.l
  * \brief
  * Tokenizer for the selection language.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  * \endcond
  */
-/*! \internal \file scanner.c
+/*! \internal \file scanner.cpp
  * \brief
  * Generated (from scanner.l by Flex) tokenizer for the selection language.
+ *
+ * \ingroup module_selection
  */
 %{
 #ifdef HAVE_CONFIG_H
index 0a89dc97fdbe505140daf4a34264b7200da586b4..abb400cb31da000c3e10e0c95146dd74a620e410 100644 (file)
@@ -343,7 +343,7 @@ extern int _gmx_sel_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 156 "scanner.l"
+#line 161 "scanner.l"
 
 #line 349 "scanner_flex.h"
 #undef _gmx_sel_yyIN_HEADER
index a791e51b637834415214119aac8ce4218f8b1f20..b36bdefcc94e22a49075b55ce5d30914bcda4a94 100644 (file)
  *
  * This file implements the functions in the headers scanner.h and
  * scanner_internal.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-/*! \internal file scanner_flex.h
+/*! \internal \file scanner_flex.h
  * \brief Generated (from scanner.l) header file by Flex.
  *
  * This file contains definitions of functions that are needed in
- * scanner_internal.c.
+ * scanner_internal.cpp.
+ *
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -63,6 +68,7 @@
 #include "scanner.h"
 #include "scanner_internal.h"
 
+//! Step in which the allocated memory for pretty-printed input is incremeted.
 #define STRSTORE_ALLOCSTEP 1000
 
 /* These are defined as macros in the generated scanner_flex.h.
index 802c8f72130c7ffda1f458ff7afa3531b81a77f8..9a5f887a837a69edbc791466b02459e492283bd5 100644 (file)
@@ -30,6 +30,9 @@
  */
 /*! \internal \file
  * \brief Internal header file used by the selection tokenizer.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELECTION_SCANNER_INTERNAL_H
 #define SELECTION_SCANNER_INTERNAL_H
@@ -49,44 +52,70 @@ struct gmx_sel_lexer_t;
 /* We cannot include scanner_flex.h from the scanner itself, because it
  * seems to break everything. */
 /* And we need to define YY_NO_UNISTD_H here as well, otherwise unistd.h
- * gets included in other files than scanner.c... */
+ * gets included in other files than scanner.cpp... */
 #ifndef FLEX_SCANNER
 #define YY_NO_UNISTD_H
 #include "scanner_flex.h"
 #endif
 
-/*! \brief
+/*! \internal \brief
  * Internal data structure for the selection tokenizer state.
  */
 typedef struct gmx_sel_lexer_t
 {
+    //! Selection collection to put parsed selections in.
     struct gmx_ana_selcollection_t  *sc;
+    //! External index groups for resolving \c group keywords.
     struct gmx_ana_indexgrps_t      *grps;
+    //! Number of selections at which the parser should stop.
     int                              nexpsel;
 
+    //! Whether the parser is interactive.
     gmx_bool                             bInteractive;
+    //! Current input string (line) for an interactive scanner.
     char                            *inputstr;
+    //! Number of bytes allocated for \a inputstr.
     int                              nalloc_input;
 
+    //! Pretty-printed version of the string parsed since last clear.
     char                            *pselstr;
+    //! Length of the string in \a pselstr.
     int                              pslen;
+    //! Number of bytes allocated for \a pselstr.
     int                              nalloc_psel;
 
+    //! Stack of methods in which parameters should be looked up.
     struct gmx_ana_selmethod_t     **mstack;
+    //! Index of the top of the stack in \a mstack.
     int                              msp;
+    //! Number of elements allocated for \a mstack.
     int                              mstack_alloc;
 
+    //! Number of END_OF_METHOD tokens to return before \a nextparam.
     int                              neom;
+    //! Parameter symbol to return before resuming scanning.
     struct gmx_ana_selparam_t       *nextparam;
+    //! Whether \a nextparam was a boolean parameter with a 'no' prefix.
     gmx_bool                             bBoolNo;
+    /*! \brief
+     * Method symbol to return before resuming scanning
+     *
+     * Only used when \p nextparam is NULL.
+     */
     struct gmx_ana_selmethod_t      *nextmethod;
+    //! Used to track whether the previous token was a position modifier.
     int                              prev_pos_kw;
 
+    //! Whether the 'of' keyword is acceptable as the next token.
     gmx_bool                             bMatchOf;
+    //! Whether boolean values (yes/no/on/off) are acceptable as the next token.
     gmx_bool                             bMatchBool;
+    //! Whether the next token starts a new selection.
     gmx_bool                             bCmdStart;
 
+    //! Whether an external buffer is set for the scanner.
     gmx_bool                             bBuffer;
+    //! The current buffer for the scanner.
     YY_BUFFER_STATE                  buffer;
 } gmx_sel_lexer_t;
 
index 9247ea13d90aed365f0974f77db3f3711d4c2040..9972ea4b7118b7aa97aadf3b76ee67156d26a84a 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Implementation of functions in selection.h.
+ * Implements gmx::Selection.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -103,6 +106,7 @@ Selection::Selection(t_selelem *elem, const char *selstr)
     initCoveredFraction(CFRAC_NONE);
 }
 
+
 Selection::~Selection()
 {
     sfree(_sel.name);
@@ -120,6 +124,7 @@ Selection::~Selection()
     sfree(_sel.orgq);
 }
 
+
 void
 Selection::printInfo() const
 {
@@ -130,10 +135,7 @@ Selection::printInfo() const
     fprintf(stderr, "\n");
 }
 
-/*!
- * \param[in] type Type of covered fraction required.
- * \returns   True if the covered fraction can be calculated for the selection.
- */
+
 bool
 Selection::initCoveredFraction(e_coverfrac_t type)
 {
index fa58a059c73d539b591c35fcc8bdaebb19606088..2109a0ccf2e7a8240bd5b72150652dcfb3d18ad9 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \file
- * \brief API for handling selection (the \c gmx_ana_selection_t structure and related functions).
+ * \brief
+ * Declares gmx::Selection.
  *
- * There should be no need to use the data structures or call the
- * functions in this file directly unless using the selection routines outside
- * the main trajectory analysis API.
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \inpublicapi
+ * \ingroup module_selection
  */
 #ifndef GMX_SELECTION_SELECTION_H
 #define GMX_SELECTION_SELECTION_H
 
 struct t_selelem;
 
-/*! \brief
+/*! \internal \brief
  * Describes a single selection.
+ *
+ * \ingroup module_selection
  */
 typedef struct gmx_ana_selection_t
 {
@@ -92,38 +95,86 @@ namespace gmx
 class SelectionCollection;
 
 /*! \brief
- * Wrapper class for accessing selection information.
+ * Provides access to a single selection.
+ *
+ * \inpublicapi
+ * \ingroup module_selection
  */
 class Selection
 {
     public:
+        /*! \brief
+         * Creates a new selection object.
+         *
+         * \param[in] elem   Root of the evaluation tree for this selection.
+         * \param[in] selstr String that was parsed to produce this selection.
+         */
         Selection(t_selelem *elem, const char *selstr);
 
+        //! Returns the name of the selection.
         const char *name() const  { return _sel.name; }
+        //! Returns the string that was parsed to produce this selection.
         const char *selectionText() const { return _sel.selstr; }
-        e_index_t type() const { return _sel.p.m.type; }
+        //! Returns true if the size of the selection (posCount()) is dynamic.
         bool isDynamic() const { return _sel.bDynamic; }
+        //! Returns the type of positions in the selection.
+        e_index_t type() const { return _sel.p.m.type; }
+        //! Number of positions in the selection.
         int posCount() const { return _sel.p.nr; }
-        const gmx_ana_pos_t *positions() const { return &_sel.p; }
+        //! Returns the \p i'th position for the selection.
         const rvec &x(int i) const { return _sel.p.x[i]; }
+        //! Returns the velocity for the \p i'th position.
         const rvec &v(int i) const { return _sel.p.v[i]; }
+        //! Returns the force for the \p i'th position.
         const rvec &f(int i) const { return _sel.p.f[i]; }
+        /*! \brief
+         * Returns the reference ID for the \p i'th position.
+         */
         int refId(int i) const { return _sel.p.m.refid[i]; }
+        /*! \brief
+         * Returns the mapped ID for the \p i'th position.
+         */
         int mapId(int i) const { return _sel.p.m.mapid[i]; }
+        //! Returns the mass for the \p i'th position.
         real mass(int i) const { return _sel.m[i]; }
+        //! Returns the charge for the \p i'th position.
         real charge(int i) const { return _sel.q[i]; }
+        //! Returns the number of atoms contributing to the \p i'th position.
         int atomCount(int i) const
             { return _sel.p.m.mapb.index[i+1] - _sel.p.m.mapb.index[i]; }
+        //! Returns the atom indices contributing to the \p i'th position.
         const int *atomIndices(int i) const
             { return _sel.g ? _sel.g->index + _sel.p.m.mapb.index[i] : NULL; }
-        int *mapIds() const { return _sel.p.m.mapid; }
-        gmx_ana_index_t *indexGroup() const { return _sel.g; }
+        //! Returns the covered fraction for the current frame.
         real cfrac() const { return _sel.cfrac; }
+        //! Deprecated method for direct access to position data.
+        const gmx_ana_pos_t *positions() const { return &_sel.p; }
+        //! Deprecated method for direct access to atom index data.
+        gmx_ana_index_t *indexGroup() const { return _sel.g; }
+        //! Deprecated method for direct access to to mapped ID array.
+        int *mapIds() const { return _sel.p.m.mapid; }
 
+        /*! \brief
+         * Sets the ID for the \p i'th position for use with mapId().
+         */
         void setOriginalId(int i, int id) { _sel.p.m.orgid[i] = id; }
+        /*! \brief
+         * Initializes information about covered fractions.
+         *
+         * \param[in] type Type of covered fraction required.
+         * \returns   True if the covered fraction can be calculated for the
+         *      selection.
+         */
         bool initCoveredFraction(e_coverfrac_t type);
 
+        //! Prints out one-line description of the selection.
         void printInfo() const;
+        /*! \brief
+         * Prints out extended information about the selection for debugging.
+         *
+         * \param[in] nmaxind Maximum number of values to print in lists
+         *      (-1 = print all).
+         */
         void printDebugInfo(int nmaxind) const;
 
         gmx_ana_selection_t     _sel;
index c896d227636def0f949ddac4cfa444adb99714b5..a8d9cb654e9f5355873e8b147f865f2d747bb745 100644 (file)
@@ -55,38 +55,10 @@ namespace gmx
 class Selection;
 }
 
-/*! \internal
- * \brief
+/*! \internal \brief
  * Information for a collection of selections.
  *
- * The functions to deal with the structure are defined in selection.h.
- * The structure is allocated with gmx_ana_selcollection_create() and
- * freed with gmx_ana_selcollection_free().
- * Some default values must then be set with
- * gmx_ana_selcollection_set_refpostype() and
- * gmx_ana_selcollection_set_outpostype().
- *
- * After setting the default values, one or more selections can be parsed
- * with gmx_ana_selcollection_parse_*().
- * At latest at this point, the topology must be set with
- * gmx_ana_selcollection_set_topology() unless
- * gmx_ana_selcollection_requires_top() returns FALSE.
- * Once all selections are parsed, they must be compiled all at once using
- * gmx_ana_selcollection_compile().
- * After these calls, gmx_ana_selcollection_get_count() and 
- * gmx_ana_selcollection_get_selections() can be used
- * to get the compiled selections.
- * gmx_ana_selcollection_evaluate() can be used to update the selections for a
- * new frame.
- * gmx_ana_selcollection_evaluate_fin() can be called after all the frames have
- * been processed to restore the selection values back to the ones they were
- * after gmx_ana_selcollection_compile(), i.e., dynamic selections have the
- * maximal index group as their value.
- *
- * At any point, gmx_ana_selcollection_requires_top() can be called to see
- * whether the information provided so far requires loading the topology.
- * gmx_ana_selcollection_print_tree() can be used to print the internal
- * representation of the selections (mostly useful for debugging).
+ * \ingroup module_selection
  */
 struct gmx_ana_selcollection_t
 {
@@ -125,49 +97,103 @@ struct gmx_ana_selcollection_t
 namespace gmx
 {
 
+/*! \internal \brief
+ * Private implemention class for SelectionCollection.
+ *
+ * \ingroup module_selection
+ */
 class SelectionCollection::Impl
 {
     public:
+        //! Shorthand for a list of selections stored internally.
         typedef std::vector<Selection *> SelectionList;
 
+        //! Possibel flags for the selection collection.
         enum Flag
         {
             efOwnPositionCollection = 1<<0
         };
 
-        Impl(gmx_ana_poscalc_coll_t *pcc);
+        //! Creates a new selection collection.
+        explicit Impl(gmx_ana_poscalc_coll_t *pcc);
         ~Impl();
 
+        //! Returns true if the given flag has been set.
         bool hasFlag(Flag flag) const { return _flags & flag; }
+        //! Sets or clears the given flag.
         void setFlag(Flag flat, bool bSet);
+        //! Clears the symbol table of the selection collection.
         void clearSymbolTable();
+        //! Registers the default selection methods for the collection.
         int registerDefaultMethods();
+        /*! \brief
+         * Helper function that runs the parser once the tokenizer has been
+         * initialized.
+         *
+         * \param[in,out] scanner Scanner data structure.
+         * \param[in]     maxnr   Maximum number of selections to parse
+         *      (if -1, parse as many as provided by the user).
+         * \param[out]    output  Vector to which parsed selections are
+         *      appended.
+         * \retval        0 on success.
+         * \retval        ::eeInvalidInput on error.
+         *
+         * Does not clear \p output.
+         */
         int runParser(void *scanner, int maxnr,
                       std::vector<Selection *> *output);
 
+        //! Internal data, used for interfacing with old C code.
         gmx_ana_selcollection_t _sc;
+        //! Options object for setting global properties on the collection.
         Options                 _options;
+        //! Default reference position type for selections.
         std::string             _rpost;
+        //! Default output position type for selections.
         std::string             _spost;
+        /*! \brief
+         * Debugging level for the collection.
+         *
+         * Possible values:
+         *  - 0: no debugging
+         *  - 1: print selection trees after parsing and compilation
+         *  - 2: like 1, also print intermediate compilation trees
+         *  - 3: like 1, also print the tree after evaluation
+         *  - 4: combine 2 and 3
+         */
         int                     _debugLevel;
+        //! Flags for various properties of the collection.
         unsigned long           _flags;
+        //! External index groups (can be NULL).
         gmx_ana_indexgrps_t    *_grps;
 };
 
 } // namespace gmx
 
-/* In compiler.c */
-/** Prepares the selections for evaluation and performs some optimizations. */
+/*! \addtogroup module_selection
+ * \{
+ */
+
+/* In compiler.cpp */
+/*! \internal \brief
+ * Prepares the selections for evaluation and performs some optimizations.
+ */
 int
 gmx_ana_selcollection_compile(gmx::SelectionCollection *coll);
 
-/* In evaluate.c */
-/** Evaluates the selection. */
+/* In evaluate.cpp */
+/*! \internal \brief
+ * Evaluates the selection.
+ */
 int
 gmx_ana_selcollection_evaluate(gmx_ana_selcollection_t *sc,
                                t_trxframe *fr, t_pbc *pbc);
-/** Evaluates the largest possible index groups from dynamic selections. */
+/*! \internal \brief
+ * Evaluates the largest possible index groups from dynamic selections.
+ */
 int
 gmx_ana_selcollection_evaluate_fin(gmx_ana_selcollection_t *sc, int nframes);
 
+/*!\}*/
+
 #endif
index b6ff0a3812b8fe94711da964c09fb59b94f1f1a7..e08d8c0b97f654ee0130a314c72b55d722d8a1ae 100644 (file)
@@ -33,6 +33,7 @@
  * Implements gmx::SelectionCollection.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -94,6 +95,7 @@ SelectionCollection::Impl::Impl(gmx_ana_poscalc_coll_t *pcc)
     _sc.symtab    = NULL;
 }
 
+
 SelectionCollection::Impl::~Impl()
 {
     _gmx_selelem_free_chain(_sc.root);
@@ -119,6 +121,7 @@ SelectionCollection::Impl::~Impl()
     clearSymbolTable();
 }
 
+
 void
 SelectionCollection::Impl::setFlag(Flag flag, bool bSet)
 {
@@ -132,6 +135,7 @@ SelectionCollection::Impl::setFlag(Flag flag, bool bSet)
     }
 }
 
+
 void
 SelectionCollection::Impl::clearSymbolTable()
 {
@@ -142,14 +146,7 @@ SelectionCollection::Impl::clearSymbolTable()
     }
 }
 
-/*! \brief
- * Internal helper function used by gmx_ana_selcollection_parse_*() to do the actual work.
- *
- * \param[in]     maxnr   Maximum number of selections to parse
- *   (if -1, parse as many as provided by the user).
- * \param[in,out] scanner Scanner data structure.
- * \returns       0 on success, -1 on error.
- */
+
 int
 SelectionCollection::Impl::runParser(yyscan_t scanner, int maxnr,
                                      std::vector<Selection *> *output)
@@ -190,11 +187,13 @@ SelectionCollection::SelectionCollection(gmx_ana_poscalc_coll_t *pcc)
 {
 }
 
+
 SelectionCollection::~SelectionCollection()
 {
     delete _impl;
 }
 
+
 int
 SelectionCollection::init()
 {
@@ -212,12 +211,7 @@ SelectionCollection::init()
     return 0;
 }
 
-/*!
- * \param[out] scp Pointer to a newly allocated empty selection collection.
- * \param[in]  pcc Position calculation data structure to use for selection
- *   position evaluation.
- * \returns    0 on success.
- */
+
 int
 SelectionCollection::create(SelectionCollection **scp,
                             gmx_ana_poscalc_coll_t *pcc)
@@ -235,6 +229,7 @@ SelectionCollection::create(SelectionCollection **scp,
     return 0;
 }
 
+
 Options *
 SelectionCollection::initOptions()
 {
@@ -273,13 +268,7 @@ SelectionCollection::initOptions()
     return &_impl->_options;
 }
 
-/*!
- * \param[in]     type      Default selection reference position type
- *   (one of the strings acceptable for gmx_ana_poscalc_type_from_enum()).
- *
- * Should be called before calling gmx_ana_selcollection_requires_top() or
- * gmx_ana_selcollection_parse_*().
- */
+
 void
 SelectionCollection::setReferencePosType(const char *type)
 {
@@ -287,13 +276,7 @@ SelectionCollection::setReferencePosType(const char *type)
     _impl->_rpost = type;
 }
 
-/*!
- * \param[in]     type      Default selection output position type
- *   (one of the strings acceptable for gmx_ana_poslcalc_type_from_enum()).
- *
- * Should be called before calling gmx_ana_selcollection_requires_top() or
- * gmx_ana_selcollection_parse_*().
- */
+
 void
 SelectionCollection::setOutputPosType(const char *type)
 {
@@ -301,60 +284,35 @@ SelectionCollection::setOutputPosType(const char *type)
     _impl->_spost = type;
 }
 
-/*!
- * \param[in]     bMaskOnly If TRUE, the output positions are initialized
- *   using \ref POS_MASKONLY.
- */
+
 void
 SelectionCollection::setMaskOnly(bool bMaskOnly)
 {
     _impl->_sc.bMaskOnly = bMaskOnly;
 }
 
-/*!
- * \param[in]     bVelOut   If TRUE, selections will also evaluate
- *      velocities.
- */
+
 void
 SelectionCollection::setVelocityOutput(bool bVelOut)
 {
     _impl->_sc.bVelocities = bVelOut;
 }
 
-/*!
- * \param[in]     bForceOut If TRUE, selections will also evaluate
- *      forces.
- */
+
 void
 SelectionCollection::setForceOutput(bool bForceOut)
 {
     _impl->_sc.bForces = bForceOut;
 }
 
-/*!
- * \param[in]     bDebug If TRUE, later call to gmx_ana_selcollection_compile()
- *     will print out intermediate selection trees.
- */
+
 void
 SelectionCollection::setDebugLevel(int debuglevel)
 {
     _impl->_debugLevel = debuglevel;
 }
 
-/*!
- * \param[in]     top       Topology data.
- * \param[in]     natoms    Number of atoms. If <=0, the number of atoms in the
- *   topology is used.
- * \retval  0 on success.
- * \retval  eeInvalidValue if \p top is NULL and \p natoms <= 0.
- *
- * The topology is also set for the position calculation collection
- * associated with \p sc.
- *
- * \p natoms determines the largest atom index that can be selected by the
- * selection: even if the topology contains more atoms, they will not be
- * selected.
- */
+
 int
 SelectionCollection::setTopology(t_topology *top, int natoms)
 {
@@ -376,24 +334,16 @@ SelectionCollection::setTopology(t_topology *top, int natoms)
     return 0;
 }
 
-/*!
- * \returns True if any selection in the collection requires topology information.
- *
- * Before gmx_ana_selcollection_parse_*(), the return value is based just on
- * the position types set.
- * After gmx_ana_selcollection_parse_*(), the return value also takes into account the
- * selection keywords used.
- */
+
 bool
 SelectionCollection::requiresTopology() const
 {
-    gmx_ana_selcollection_t *sc = &_impl->_sc;
     t_selelem   *sel;
     e_poscalc_t  type;
     int          flags;
     int          rc;
 
-    if (sc->rpost)
+    if (!_impl->_rpost.empty())
     {
         flags = 0;
         rc = gmx_ana_poscalc_type_from_enum(_impl->_rpost.c_str(), &type, &flags);
@@ -402,7 +352,7 @@ SelectionCollection::requiresTopology() const
             return TRUE;
         }
     }
-    if (sc->spost)
+    if (!_impl->_spost.empty())
     {
         flags = 0;
         rc = gmx_ana_poscalc_type_from_enum(_impl->_spost.c_str(), &type, &flags);
@@ -412,7 +362,7 @@ SelectionCollection::requiresTopology() const
         }
     }
 
-    sel = sc->root;
+    sel = _impl->_sc.root;
     while (sel)
     {
         if (_gmx_selelem_requires_top(sel))
@@ -424,12 +374,7 @@ SelectionCollection::requiresTopology() const
     return FALSE;
 }
 
-/*!
- * \param[in]     nr    Number of selections to parse
- *   (if -1, parse as many as provided by the user).
- * \param[in]     bInteractive Whether the parser should behave interactively.
- * \returns       0 on success, -1 on error.
- */
+
 int
 SelectionCollection::parseFromStdin(int nr, bool bInteractive,
                                     std::vector<Selection *> *output)
@@ -447,12 +392,9 @@ SelectionCollection::parseFromStdin(int nr, bool bInteractive,
     return _impl->runParser(scanner, nr, output);
 }
 
-/*!
- * \param[in]     fnm   Name of the file to parse selections from.
- * \returns       0 on success, -1 on error.
- */
+
 int
-SelectionCollection::parseFromFile(const std::string &fnm,
+SelectionCollection::parseFromFile(const std::string &filename,
                                    std::vector<Selection *> *output)
 {
     yyscan_t scanner;
@@ -464,17 +406,14 @@ SelectionCollection::parseFromFile(const std::string &fnm,
     {
         return rc;
     }
-    fp = ffopen(fnm.c_str(), "r");
+    fp = ffopen(filename.c_str(), "r");
     _gmx_sel_set_lex_input_file(scanner, fp);
     rc = _impl->runParser(scanner, -1, output);
     ffclose(fp);
     return rc;
 }
 
-/*!
- * \param[in]     str   String to parse selections from.
- * \returns       0 on success, -1 on error.
- */
+
 int
 SelectionCollection::parseFromString(const std::string &str,
                                      std::vector<Selection *> *output)
@@ -491,6 +430,7 @@ SelectionCollection::parseFromString(const std::string &str,
     return _impl->runParser(scanner, -1, output);
 }
 
+
 int
 SelectionCollection::compile()
 {
@@ -519,6 +459,7 @@ SelectionCollection::compile()
     return rc;
 }
 
+
 int
 SelectionCollection::evaluate(t_trxframe *fr, t_pbc *pbc)
 {
@@ -535,17 +476,14 @@ SelectionCollection::evaluate(t_trxframe *fr, t_pbc *pbc)
     return rc;
 }
 
+
 int
 SelectionCollection::evaluateFinal(int nframes)
 {
     return gmx_ana_selcollection_evaluate_fin(&_impl->_sc, nframes);
 }
 
-/*!
- * \param[in] fp      File handle to receive the output.
- * \param[in] bValues If TRUE, the evaluated values of selection elements
- *   are printed as well.
- */
+
 void
 SelectionCollection::printTree(FILE *fp, bool bValues) const
 {
@@ -559,10 +497,7 @@ SelectionCollection::printTree(FILE *fp, bool bValues) const
     }
 }
 
-/*!
- * \param[in] out  Output file.
- * \param[in] oenv Output options structure.
- */
+
 void
 SelectionCollection::printXvgrInfo(FILE *out, output_env_t oenv) const
 {
index 6903bdeba78cbd60dc007e28881e0e6005313f23..e9e3359d31ad2cd88cbf08e1d3da9b7f23504a61 100644 (file)
@@ -53,38 +53,255 @@ namespace gmx
 class Options;
 class Selection;
 
+/*! \libinternal \brief
+ * Collection of selections.
+ *
+ * Some default values must then be set with
+ * gmx_ana_selcollection_set_refpostype() and
+ * gmx_ana_selcollection_set_outpostype().
+ *
+ * After setting the default values, one or more selections can be parsed
+ * with one or more calls to parseFromStdin(), parseFromFile(), and/or
+ * parseFromString().  After all selections are parsed, the topology must be
+ * set with setTopology() unless requiresTopology() returns false (the topology
+ * can also be set earlier).  Once all selections are parsed, they must be
+ * compiled all at once using compile().
+ * After compilation, dynamic selections have the maximum number of atoms they
+ * can evaluate to, but positions have undefined values.  evaluate() can be
+ * used to update the selections for a new frame.
+ * evaluateFinal() can be called after all the frames have been processed to
+ * restore the selection values back to the ones they were after compile().
+ *
+ * At any point, requiresTopology() can be called to see whether the
+ * information provided so far requires loading the topology.
+ * printTree() can be used to print the internal representation of the
+ * selections (mostly useful for debugging).
+ *
+ * \inlibraryapi
+ * \ingroup module_selection
+ */
 class SelectionCollection
 {
     public:
+        /*! \brief
+         * Creates an empty selection collection.
+         *
+         * \param[in] pcc  Position calculation collection to use for selection
+         *      evaluation.
+         *
+         * If \p pcc is NULL, an internal collection is created and managed by
+         * the object.
+         */
         explicit SelectionCollection(gmx_ana_poscalc_coll_t *pcc);
         ~SelectionCollection();
 
+        /*! \brief
+         * Initializes the object.
+         *
+         * \retval 0 on success.
+         *
+         * Should be called immediately after construction.
+         */
         int init();
+        /*! \brief
+         * Initializes options for setting global properties on the collection.
+         *
+         * The return value should not be deleted by the caller.
+         */
         Options *initOptions();
 
+        /*! \brief
+         * Convenience function that creates a new selection collection and
+         * calls init().
+         *
+         * \param[out] scp Pointer to a newly created selection collection.
+         * \param[in]  pcc Position calculation data structure to use for
+         *      selection evaluation.
+         * \returns    0 on success.
+         */
         static int create(SelectionCollection **scp, gmx_ana_poscalc_coll_t *pcc);
 
+        /*! \brief
+         * Sets the default reference position handling for a selection
+         * collection.
+         *
+         * \param[in]     type      Default selection reference position type
+         *   (one of the strings acceptable for gmx_ana_poscalc_type_from_enum()).
+         *
+         * Should be called before calling the parser functions, unless
+         * initOptions() has been called.  In the latter case, can still be
+         * used to override the default value and/or the value provided through
+         * the Options object.
+         */
         void setReferencePosType(const char *type);
+        /*! \brief
+         * Sets the default reference position handling for a selection
+         * collection.
+         *
+         * \param[in]     type      Default selection output position type
+         *   (one of the strings acceptable for gmx_ana_poscalc_type_from_enum()).
+         *
+         * Should be called before calling the parser functions, unless
+         * initOptions() has been called.  In the latter case, can still be
+         * used to override the default value and/or the value provided through
+         * the Options object.
+         */
         void setOutputPosType(const char *type);
+        /*! \brief
+         * Requests dynamic selection evaluation using masks.
+         *
+         * \param[in]     bMaskOnly If TRUE, the output positions are
+         *     initialized using \ref POS_MASKONLY.
+         */
         void setMaskOnly(bool bMaskOnly);
+        //! Request evaluation of velocities for selections.
         void setVelocityOutput(bool bVelOut);
+        //! Request evaluation of forces for selections.
         void setForceOutput(bool bForceOut);
+        /*! \brief
+         * Sets the debugging level for the selection collection.
+         */
         void setDebugLevel(int debuglevel);
 
+        /*! \brief
+         * Returns true if the collection requires topology information for
+         * evaluation.
+         *
+         * \returns true if any selection in the collection requires topology
+         *      information.
+         *
+         * Before the parser functions have been called, the return value is
+         * based just on the position types set.
+         * After parser functions have been called, the return value also takes
+         * into account the selection keywords used.
+         */
         bool requiresTopology() const;
+        /*! \brief
+         * Sets the topology for the collection.
+         *
+         * \param[in]     top       Topology data.
+         * \param[in]     natoms    Number of atoms. If <=0, the number of
+         *      atoms in the topology is used.
+         * \retval  0 on success.
+         * \retval  ::eeInvalidValue if \p top is NULL and \p natoms <= 0.
+         *
+         * The topology is also set for the position calculation collection
+         * associated with the collection.
+         *
+         * \p natoms determines the largest atom index that can be selected by
+         * the selection: even if the topology contains more atoms, they will
+         * not be selected.
+         */
         int setTopology(t_topology *top, int natoms);
+        /*! \brief
+         * Sets the external index groups to use for the selections.
+         */
         void setIndexGroups(gmx_ana_indexgrps_t *grps);
+        /*! \brief
+         * Parses selection(s) from standard input.
+         *
+         * \param[in]  count    Number of selections to parse
+         *      (if -1, parse as many as provided by the user).
+         * \param[in]  bInteractive Whether the parser should behave
+         *      interactively.
+         * \param[out] output   Vector to which parsed selections are appended.
+         * \retval     0 on success.
+         * \retval     ::eeInvalidInput on syntax error (an interactive parser
+         *      only returns this if an incorrect number of selections is
+         *      provided).
+         *
+         * Parsed selections are appended to \p output without clearing it
+         * first.  If parsing fails, \p output is not modified.
+         *
+         * The objects returned in \p output remain valid for the lifetime of
+         * the selection collection, and should not be freed by the user.
+         * Some information about the selections only becomes available once
+         * compile() has been called.
+         */
         int parseFromStdin(int count, bool bInteractive,
                            std::vector<Selection *> *output);
+        /*! \brief
+         * Parses selection(s) from a file.
+         *
+         * \param[in]  filename Name of the file to parse selections from.
+         * \param[out] output   Vector to which parsed selections are appended.
+         * \retval     0 on success.
+         * \retval     ::eeInvalidInput on syntax error.
+         *
+         * Parsed selections are appended to \p output without clearing it
+         * first.  If parsing fails, \p output is not modified.
+         *
+         * The objects returned in \p output remain valid for the lifetime of
+         * the selection collection, and should not be freed by the user.
+         * Some information about the selections only becomes available once
+         * compile() has been called.
+         */
         int parseFromFile(const std::string &filename,
                           std::vector<Selection *> *output);
+        /*! \brief
+         * Parses selection(s) from a string.
+         *
+         * \param[in]  str      String to parse selections from.
+         * \param[out] output   Vector to which parsed selections are appended.
+         * \retval     0 on success.
+         * \retval     ::eeInvalidInput on syntax error.
+         *
+         * Parsed selections are appended to \p output without clearing it
+         * first.  If parsing fails, \p output is not modified.
+         *
+         * The objects returned in \p output remain valid for the lifetime of
+         * the selection collection, and should not be freed by the user.
+         * Some information about the selections only becomes available once
+         * compile() has been called.
+         */
         int parseFromString(const std::string &str,
                             std::vector<Selection *> *output);
+        /*! \brief
+         * Prepares the selections for evaluation and performs optimizations.
+         *
+         * \retval  0 on successful compilation, a non-zero error code on error.
+         *
+         * Before compilation, selections should have been added to the
+         * collection using the parseFrom*() functions.
+         * The compiled selection collection can be passed to evaluate() to
+         * evaluate the selection for a frame.
+         * If an error occurs, the collection is cleared.
+         *
+         * The covered fraction information is initialized to ::CFRAC_NONE for
+         * all selections.
+         */
         int compile();
+        /*! \brief
+         * Evaluates selections in the collection.
+         *
+         * \param[in] fr  Frame for which the evaluation should be carried out.
+         * \param[in] pbc PBC data, or NULL if no PBC should be used.
+         * \returns   0 on successful evaluation, a non-zero error code on error.
+         */
         int evaluate(t_trxframe *fr, t_pbc *pbc);
+        /*! \brief
+         * Evaluates the largest possible index groups from dynamic selections.
+         *
+         * \param[in] nframes Total number of frames.
+         * \returns   0 on successful evaluation, a non-zero error code on error.
+         */
         int evaluateFinal(int nframes);
 
+        /*! \brief
+         * Prints a human-readable version of the internal selection element
+         * tree.
+         *
+         * \param[in] fp      File handle to receive the output.
+         * \param[in] bValues If true, the evaluated values of selection
+         *      elements are printed as well.
+         */
         void printTree(FILE *fp, bool bValues) const;
+        /*! \brief
+         * Prints the selection strings into an XVGR file as comments.
+         *
+         * \param[in] fp   Output file.
+         * \param[in] oenv Output options structure.
+         */
         void printXvgrInfo(FILE *fp, output_env_t oenv) const;
 
         class Impl;
index 8541a3152842285f55055697e6fc2ea8dcb3989a..f3f3701afd78ce6afe1a34bc8fb5adaea22971ed 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \file
- * \brief API for handling selection (the \c gmx_ana_selection_t structure and related functions).
+ * \brief
+ * Declares common types used in selections.
  *
- * There should be no need to use the data structures or call the
- * functions in this file directly unless using the selection routines outside
- * the main trajectory analysis API.
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef GMX_SELECTION_SELECTIONENUMS_H
 #define GMX_SELECTION_SELECTIONENUMS_H
 
-/** Defines the type of covered fraction. */
+/*! \brief
+ * Defines the type of covered fraction.
+ *
+ * \inpublicapi
+ */
 typedef enum
 {
     CFRAC_NONE,         /**< No covered fraction (everything covered). */
@@ -48,6 +52,12 @@ typedef enum
 namespace gmx
 {
 
+/*! \brief
+ * Flags for options.
+ *
+ * These flags are not part of the public interface, even though they are in an
+ * installed header.  They are needed in the implementation of SelectionOption.
+ */
 enum SelectionFlag
 {
     efOnlyStatic        = 1<<0,
@@ -57,6 +67,7 @@ enum SelectionFlag
     efCollectRemaining  = 1<<4,
 };
 
+//! Holds a collection of ::SelectionFlag values.
 typedef unsigned long SelectionFlags;
 
 }
index ea2a413c30db33bf4285612fe8fa3768b66b582e..e1d0eceb0bbe8451381c75967b34b1d7c81dc4bc 100644 (file)
@@ -30,7 +30,7 @@
  */
 /*! \internal \file
  * \brief
- * Implements ::gmx::SelectionOption.
+ * Implements gmx::SelectionOption.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_selection
index 13ea41737d3fbebaee5cbb66307d9484051fa23a..5102fe17f2172610bb12f1376b03ec0af7cc7b11 100644 (file)
@@ -30,6 +30,7 @@
  */
 /*! \file
  * \brief
+ * Declares gmx::SelectionOption.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \inpublicapi
@@ -59,10 +60,26 @@ class SelectionOption : public OptionTemplate<Selection *, SelectionOption>
         //! Initializes an option with the given name.
         explicit SelectionOption(const char *name) : MyBase(name), _flags(0) {}
 
+        /*! \brief
+         * Only accept selections that evaluate to atom positions.
+         */
         MyClass &onlyAtoms() { _flags |= efOnlyAtoms; return me(); }
+        /*! \brief
+         * Only accept static selections for this option.
+         */
         MyClass &onlyStatic() { _flags |= efOnlyStatic; return me(); }
+        /*! \brief
+         * Handle dynamic selections for this option with position masks.
+         */
         MyClass &dynamicMask() { _flags |= efDynamicMask; return me(); }
+        /*! \brief
+         * Disallow using atom coordinates as the reference positions.
+         */
         MyClass &dynamicOnlyWhole() { _flags |= efDynamicOnlyWhole; return me(); }
+        /*! \brief
+         * Mark this option as receiving selections that can't be assigned to
+         * other options.
+         */
         MyClass &collectRemaining() { _flags |= efCollectRemaining; return me(); }
 
     private:
index d2a857001cb60f75ca087af87cbac9994f933652..7f9b5c6b06075bae732a97b705857012d15e5392 100644 (file)
@@ -30,7 +30,7 @@
  */
 /*! \internal \file
  * \brief
- * Implements ::gmx::SelectionOptionStorage.
+ * Implements gmx::SelectionOptionStorage.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_selection
index de78bc5d986b844f2cef66edad8465752b57be6f..c5fd23ab359b9d9d4e50321593d6c86ad1133783 100644 (file)
@@ -30,7 +30,7 @@
  */
 /*! \internal \file
  * \brief
- * Declares storage class for selection options.
+ * Declares gmx::SelectionOptionStorage.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_selection
@@ -49,6 +49,8 @@ class SelectionOption;
 
 /*! \internal \brief
  * Converts, validates, and stores selection values.
+ *
+ * \ingroup module_selection
  */
 class SelectionOptionStorage : public AbstractOptionStorage<Selection *>
 {
index 84778d64d65de5afc3aa1399d1320efc78b767d0..db7243436b33589da4af59b687237d2821641bf7 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in selelem.h.
+ * \brief
+ * Implements functions in selelem.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index bca5d6d6cb7a2ab7eff23c47a513507fe745472b..bcbeafad28a7b4d242cc54d85dfddde2f92fb39a 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Definition of \c t_selelem and related things.
+ * \brief
+ * Declares ::t_selelem and related things.
  *
  * The selection element trees constructed by the parser and the compiler
  * are described on the respective pages:
- * \ref selparser and \ref selcompiler.
+ * \ref page_module_selection_parser and \ref page_module_selection_compiler.
  *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELECTION_ELEMENT_H
 #define SELECTION_ELEMENT_H
index a1459d31345f79e1ab2c366c5943d1d0ca66494e..f6fbeb23c31e19cc6439a5fc288dfd8f790a2a55 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in selhelp.c.
+ * \brief
+ * Implements functions in selhelp.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #include "selhelp.h"
 #include "symrec.h"
 
+/*! \internal \brief
+ * Describes a selection help section.
+ */
 typedef struct {
+    //! Topic keyword that produces this help.
     const char  *topic;
+    //! Number of items in the \a text array.
     int          nl;
+    //! Help text as a list of strings that will be concatenated.
     const char **text;
 } t_selection_help_item;
 
@@ -308,7 +318,7 @@ static const t_selection_help_item helpitems[] = {
 /*! \brief
  * Prints a brief list of keywords (selection methods) available.
  *
- * \param[in] sc    Selection collection for which the list should be printed.
+ * \param[in] symtab  Symbol table to use to find available keywords.
  * \param[in] type  Only methods that return this type are printed.
  * \param[in] bMod  If FALSE, \ref SMETH_MODIFIER methods are excluded, otherwise
  *     only them are printed.
@@ -352,7 +362,7 @@ print_keyword_list(gmx_sel_symtab_t *symtab, e_selvalue_t type,
 }
 
 /*!
- * \param[in]  sc    Selection collection for which help should be printed.
+ * \param[in]   symtab  Symbol table to use to find available keywords.
  * \param[in]  topic Topic to print help on, or NULL for general help.
  *
  * \p sc is used to get information on which keywords are available in the
index 8d6f9862604ff3b3eba7db10402068f4cd9ea3fd..1072d0b27751f76fcc95f27474b186d97a1f146f 100644 (file)
  *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef SELECTION_HELP_H
-#define SELECTION_HELP_H
+#ifndef GMX_SELECTION_HELP_H
+#define GMX_SELECTION_HELP_H
 
 struct gmx_sel_symtab_t;
 
index a4c3200a08292cb8a50ea95c9268597562a078b6..6b9cadab55dff4a6cdc60590d976bb3d8c0e7f59 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in selmethod.h.
+ * \brief
+ * Implements functions in selmethod.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -102,7 +106,7 @@ extern gmx_ana_selmethod_t sm_plus;
 /* From sm_permute.c */
 extern gmx_ana_selmethod_t sm_permute;
 
-/*! \brief
+/*! \internal \brief
  * Helper structure for defining selection methods.
  */
 typedef struct {
@@ -596,7 +600,7 @@ check_modifier(FILE *fp, gmx_ana_selmethod_t *method, gmx_sel_symtab_t *symtab)
 }
 
 /*!
- * \param[in,out] sc     Selection collection to registered the method to.
+ * \param[in,out] symtab Symbol table to register the method to.
  * \param[in]     name   Name under which the method should be registered.
  * \param[in]     method Method to register.
  * \returns       0 on success, EINVAL if there was something wrong with the
@@ -644,7 +648,7 @@ gmx_ana_selmethod_register(gmx_sel_symtab_t *symtab,
 }
 
 /*!
- * \param[in,out] sc     Selection collection to registered the methods to.
+ * \param[in,out] symtab Symbol table to register the methods to.
  * \returns       0 on success, -1 if any of the default methods could not be
  *   registered.
  */
index c9617d2131596606a83da5b5ce302169a14f953d..cf705bedde6ba2dd99869d6b6f4f584dbab0f658 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \page selmethods Custom selection methods
+/*! \page page_module_selection_custom Custom selection methods
  *
  * Custom selection methods are defined by creating a new instance of 
  * \c gmx_ana_selmethod_t and filling it with the necessary data for handling
  *    or to control the default behavior of the selection engine
  *    (currently, such a framework is not implemented, but should be easy to
  *    implement if required).
- *    
+ *
  * In addition to restricting the type of the method, selection modifiers
  * do not allow the flags \ref SMETH_SINGLEVAL and \ref SMETH_VARNUMVAL
  * (they would not make sense).
  *
  * Parameters and callbacks should be implemented as with normal selection
  * method, but beware that very little of the functionality has been tested.
- * 
+ *
  * \todo
  * The modifier handling could be made more flexible and more generic;
  * the current implementation does not allow many things which would be
  * In analysis programs, this can be done by calling
  * gmx_ana_selmethod_register().
  * If adding the method to the library, you should add a pointer to the new
- * method structure into the \c smtable_def array (in \ref selmethod.c
- * "selmethod.c"), and it is registered automatically.
+ * method structure into the \c smtable_def array (in selmethod.cpp), and it is
+ * registered automatically.
  * In both cases, gmx_ana_selmethod_register() does several checks on the
  * structure and reports any errors or inconsistencies it finds.
  */
  * method.
  *
  * Instructions for implementing custom selection methods can be found
- * on a separate page: \ref selmethods
+ * on a separate page: \ref page_module_selection_custom
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
-#ifndef SELMETHOD_H
-#define SELMETHOD_H
+#ifndef GMX_SELECTION_SELMETHOD_H
+#define GMX_SELECTION_SELMETHOD_H
 
 #include "typedefs.h"
 
@@ -604,8 +607,8 @@ typedef struct gmx_ana_selmethod_help_t
  *
  * See the function pointer type documentation for details of how the
  * functions should be implemented.
- * More details on implementing new selection methods can be found on a 
- * separate page: \ref selmethods.
+ * More details on implementing new selection methods can be found on a
+ * separate page: \ref page_module_selection_custom.
  */
 typedef struct gmx_ana_selmethod_t
 {
index a10b609a9d5fba605ca7f43639c37c057820a417..7c6d41f3cd879a417e249aa069f796dc7407c75a 100644 (file)
  * method.
  *
  * More details can be found on the page discussing
- * \ref selmethods "custom selection methods".
+ * \ref page_module_selection_custom "custom selection methods".
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELPARAM_H
 #define SELPARAM_H
index bd55f605005ffe4fd77329c77b6822767ea8be44..aac6992735a0740c155a2ab1683547b114420070 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in selvalue.h.
+ * \brief
+ * Implements functions in selvalue.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 8460fe89a34490ea9f3e9841fef2755bc707d0b9..8fe133e4a0fc4427dc66a5398a6eb2839d265811 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \file
- * \brief Declaration of \c gmx_ana_selvalue_t.
+ * \brief
+ * Declares ::gmx_ana_selvalue_t.
  *
  * There should be no need to use the data structures in this file directly
  * unless implementing a custom selection routine.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELVALUE_H
 #define SELVALUE_H
index 9fc2abf23a23f568b3d428a0ec620eb1c54e2ca4..d4e225f9bdedf62b213cf769be967ca50637a423 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Implementation of internal selection method for comparison expressions.
+ * Implements internal selection method for comparison expressions.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 5f8fa2090b3871c177c1e26e714ed67a69bf912b..116550c5ef207b3d33642840058bb135c5191b30 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of distance-based selection methods.
+ * \brief
+ * Implements distance-based selection methods.
  *
  * This file implements the \p distance, \p mindistance and \p within
  * selection methods.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 87a8109b5a0ce6c65f5397edc5eb0c9d05d3b7a0..610a57115e5233b9f0fa5a793526ec265bb486e2 100644 (file)
@@ -28,7 +28,7 @@
  *
  * For more info, check our website at http://www.gromacs.org
  */
-/*! \page sm_insolidangle Selection method: insolidangle
+/*! \page page_module_selection_insolidangle Selection method: insolidangle
  *
  * This method selects a subset of particles that are located in a solid
  * angle defined by a center and a set of points.
  * for the averages as well as in cases where the bin size is small.
  */
 /*! \internal \file
- * \brief Implementation of the \ref sm_insolidangle "insolidangle"
- *   selection method.
+ * \brief
+ * Implements the \ref sm_insolidangle "insolidangle" selection method.
  *
  * \todo
  * The implementation could be optimized quite a bit.
- * 
- * \todo Move the covered fraction stuff somewhere else and make it more
- * generic (along the lines it is handled in selection.h and trajana.h).
+ *
+ * \todo
+ * Move the covered fraction stuff somewhere else and make it more generic
+ * (along the lines it is handled in selection.h and trajana.h in the old C
+ * API).
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index dd47f7ea42248f4c07dbbcbb09be6dc66acd5261..6869f76ec2d83a8c2afd96292cbd5a83bd7e8689 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementations of internal selection methods for numeric and
- * string keyword evaluation.
+ * \brief
+ * Implements internal selection methods for numeric and string keyword
+ * evaluation.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index ea44d33f4eec4052a83519a5476d19e64ab21a18..2e436ee75cf7b1fa18acd130e63b1f04f40c41eb 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of the merging selection modifier.
+ * \brief
+ * Implements the \p merge and \p plus selection modifiers.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index d17bf4bea20435d8cacce22d2e16b7558ef2e36a..bbc43d8fea38af89f6381fe15d8cbfa4109c9bcf 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of the \p permute selection modifier.
+ * \brief
+ * Implements the \p permute selection modifier.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index ce00ed31c594fe0a61d9a15f4cc55ea122856ec1..c2d9e5c8a4dae0202e4472a97a0f550c37f85b39 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of position evaluation selection methods.
+ * \brief
+ * Implements position evaluation selection methods.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index f15f3d1fe706d963e60654c87a1397a52347e7f1..0c4925e52c32dc3a5ee8ec6a0374729a97a6731d 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of the \p same selection method.
+ * \brief
+ * Implements the \p same selection method.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 1c126864f7d69c5fd606235153aa417c4c7ecb15..ca479a2dd17ac95cc45f5e07933052fa04576f6a 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementations of simple keyword selection methods.
+ * \brief
+ * Implements simple keyword selection methods.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 80375c81063a2c6a5f3bf9f3ff780b5f5d08c382..baa0aae721a8c9281b88897b9bab939d46bc3761 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  */
 /*! \internal \file
- * \brief Implementation of functions in symrec.h.
+ * \brief
+ * Implements functions in symrec.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index bbf21b1005ff7961ce5a7bd2f16ff9e9fe2bbdec..bab9483beb919f8de5918cacb62ffc066f2457f9 100644 (file)
@@ -33,6 +33,9 @@
  *
  * This is an implementation header: there should be no need to use it outside
  * this directory.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \ingroup module_selection
  */
 #ifndef SELECTION_SYMREC_H
 #define SELECTION_SYMREC_H
index ee7b45a62be57d676b8d51e13380ec64387294d2..406a8ff95d705b61db00cf9f3c6dd3a45293e0ca 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "gromacs/fatalerror/fatalerror.h"
 
+/*! \brief
+ * Initializes unit testing with Google C++ Testing Framework.
+ */
 int main(int argc, char *argv[])
 {
     ::testing::InitGoogleTest(&argc, argv);