Merge two separate nbsearch.h files.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 18 Apr 2012 19:53:31 +0000 (22:53 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 18 Apr 2012 19:54:50 +0000 (22:54 +0300)
Very small part of IssueID #866

Change-Id: I064ee13f31f199c8c7d455ab04445046028d5727

src/gromacs/selection/nbsearch.h
src/gromacs/trajectoryanalysis.h
src/gromacs/trajectoryanalysis/nbsearch.h [deleted file]

index c483586cfa234a8d15f88d19c986abcb4c30c16a..0ce5e27901c973d0b5ba066f67a1d9623e84db0c 100644 (file)
@@ -95,4 +95,57 @@ gmx_ana_nbsearch_pos_first_within(gmx_ana_nbsearch_t *d,
 bool
 gmx_ana_nbsearch_next_within(gmx_ana_nbsearch_t *d, int *jp);
 
+namespace gmx
+{
+
+/*
+ * C++ wrapper for neighborhood searching.
+ *
+ */
+class NeighborhoodSearch
+{
+    public:
+        NeighborhoodSearch(real cutoff, int maxn)
+            : d_(gmx_ana_nbsearch_create(cutoff, maxn))
+        {
+        }
+        ~NeighborhoodSearch() { gmx_ana_nbsearch_free(d_); }
+
+        void init(t_pbc *pbc, int n, const rvec x[])
+        { gmx_ana_nbsearch_init(d_, pbc, n, x); }
+
+        void init(t_pbc *pbc, const gmx_ana_pos_t *p)
+        { gmx_ana_nbsearch_pos_init(d_, pbc, p); }
+
+        void setExclusions(int nexcl, atom_id *excl)
+        { gmx_ana_nbsearch_set_excl(d_, nexcl, excl); }
+
+
+        bool isWithin(const rvec x)
+        { return gmx_ana_nbsearch_is_within(d_, x); }
+
+        bool isWithin(const gmx_ana_pos_t *p, int i)
+        { return gmx_ana_nbsearch_pos_is_within(d_, p, i); }
+
+        real minimumDistance(const rvec x)
+        { return gmx_ana_nbsearch_mindist(d_, x); }
+
+        real minimumDistance(const gmx_ana_pos_t *p, int i)
+        { return gmx_ana_nbsearch_pos_mindist(d_, p, i); }
+
+        bool firstWithin(const rvec x, int *jp)
+        { return gmx_ana_nbsearch_first_within(d_, x, jp); }
+
+        bool firstWithin(const gmx_ana_pos_t *p, int i, int *jp)
+        { return gmx_ana_nbsearch_pos_first_within(d_, p, i, jp); }
+
+        bool nextWithin(int *jp)
+        { return gmx_ana_nbsearch_next_within(d_, jp); }
+
+    private:
+        gmx_ana_nbsearch_t  *d_;
+};
+
+} // namespace gmx
+
 #endif
index 58ecb9e0431abcde069215d76874b2acf7bd26df..f9dbf482e968ab61fedb4e3fbe186d0bd483aa1f 100644 (file)
 #include "options.h"
 #include "selection.h"
 
+#include "selection/nbsearch.h"
 #include "trajectoryanalysis/analysismodule.h"
 #include "trajectoryanalysis/analysissettings.h"
 #include "trajectoryanalysis/cmdlinerunner.h"
-#include "trajectoryanalysis/nbsearch.h"
 #include "utility/exceptions.h"
 
 #endif
diff --git a/src/gromacs/trajectoryanalysis/nbsearch.h b/src/gromacs/trajectoryanalysis/nbsearch.h
deleted file mode 100644 (file)
index b035dbe..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- *                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
- */
-/*
- * 
- * C++ wrapper for analysis tool neighborhood searching.
- *
- */
-#ifndef GMX_TRAJECTORYANALYSIS_NBSEARCH_H
-#define GMX_TRAJECTORYANALYSIS_NBSEARCH_H
-
-#include "../selection/nbsearch.h"
-
-namespace gmx
-{
-
-/*
- * C++ wrapper for neighborhood searching in selection/nbsearch.h.
- *
- */
-class NeighborhoodSearch
-{
-    public:
-        NeighborhoodSearch(real cutoff, int maxn)
-            : _d(gmx_ana_nbsearch_create(cutoff, maxn))
-        {
-        }
-        ~NeighborhoodSearch() { gmx_ana_nbsearch_free(_d); }
-
-        void init(t_pbc *pbc, int n, const rvec x[])
-        { gmx_ana_nbsearch_init(_d, pbc, n, x); }
-
-        void init(t_pbc *pbc, const gmx_ana_pos_t *p)
-        { gmx_ana_nbsearch_pos_init(_d, pbc, p); }
-
-        void setExclusions(int nexcl, atom_id *excl)
-        { gmx_ana_nbsearch_set_excl(_d, nexcl, excl); }
-
-
-        bool isWithin(const rvec x)
-        { return gmx_ana_nbsearch_is_within(_d, x); }
-
-        bool isWithin(const gmx_ana_pos_t *p, int i)
-        { return gmx_ana_nbsearch_pos_is_within(_d, p, i); }
-
-        real minimumDistance(const rvec x)
-        { return gmx_ana_nbsearch_mindist(_d, x); }
-
-        real minimumDistance(const gmx_ana_pos_t *p, int i)
-        { return gmx_ana_nbsearch_pos_mindist(_d, p, i); }
-
-        bool firstWithin(const rvec x, int *jp)
-        { return gmx_ana_nbsearch_first_within(_d, x, jp); }
-
-        bool firstWithin(const gmx_ana_pos_t *p, int i, int *jp)
-        { return gmx_ana_nbsearch_pos_first_within(_d, p, i, jp); }
-
-        bool nextWithin(int *jp)
-        { return gmx_ana_nbsearch_next_within(_d, jp); }
-
-    private:
-        gmx_ana_nbsearch_t  *_d;
-};
-
-} // namespace gmx
-
-#endif