diff --git a/doc/src/pg_developer.rst b/doc/src/pg_developer.rst index 1886a15af6..65f7c50c44 100644 --- a/doc/src/pg_developer.rst +++ b/doc/src/pg_developer.rst @@ -878,9 +878,6 @@ Argument processing .. doxygenfunction:: bounds :project: progguide -.. doxygenfunction:: boundsbig - :project: progguide - .. doxygenfunction:: expand_args :project: progguide diff --git a/src/set.cpp b/src/set.cpp index f18746652e..b4a82e5c72 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -633,7 +633,7 @@ void Set::selection(int n) if (atom->tag_enable == 0) error->all(FLERR,"Cannot use set atom with no atom IDs defined"); bigint nlobig,nhibig; - utils::boundsbig(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); + utils::bounds(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); tagint *tag = atom->tag; for (int i = 0; i < n; i++) @@ -644,7 +644,7 @@ void Set::selection(int n) if (atom->molecule_flag == 0) error->all(FLERR,"Cannot use set mol with no molecule IDs defined"); bigint nlobig,nhibig; - utils::boundsbig(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); + utils::bounds(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); tagint *molecule = atom->molecule; for (int i = 0; i < n; i++) diff --git a/src/utils.cpp b/src/utils.cpp index 486a84b601..806ee99d9b 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -359,8 +359,9 @@ tagint utils::tnumeric(const char *file, int line, const char *str, /* ---------------------------------------------------------------------- compute bounds implied by numeric str with a possible wildcard asterisk ------------------------------------------------------------------------- */ +template<> void utils::bounds(const char *file, int line, char *str, - int nmin, int nmax, int &nlo, int &nhi, Error *error) + bigint nmin, bigint nmax, int &nlo, int &nhi, Error *error) { char *ptr = strchr(str,'*'); @@ -398,9 +399,10 @@ void utils::bounds(const char *file, int line, char *str, /* ---------------------------------------------------------------------- compute bounds implied by numeric str with a possible wildcard asterisk ------------------------------------------------------------------------- */ -void utils::boundsbig(const char *file, int line, char *str, - bigint nmin, bigint nmax, bigint &nlo, bigint &nhi, - Error *error) +template <> +void utils::bounds(const char *file, int line, char *str, + bigint nmin, bigint nmax, bigint &nlo, bigint &nhi, + Error *error) { char *ptr = strchr(str,'*'); diff --git a/src/utils.h b/src/utils.h index d8db9815e5..bff1b9efc5 100644 --- a/src/utils.h +++ b/src/utils.h @@ -162,33 +162,9 @@ namespace LAMMPS_NS { * \param nlo lower bound * \param nhi upper bound * \param error pointer to Error class for out-of-bounds messages */ - + template void bounds(const char *file, int line, char *str, - int nmin, int nmax, int &nlo, int &nhi, Error *error); - - /** Compute index bounds derived from a string with a possible wildcard - * - * This functions processes the string in *str* and set the values of *nlo* - * and *nhi* according to the following five cases: - * - * - a single number, i: nlo = i; nhi = i; - * - a single asterisk, \*: nlo = nmin; nhi = nmax; - * - a single number followed by an asterisk, i\*: nlo = i; nhi = nmax; - * - a single asterisk followed by a number, \*i: nlo = nmin; nhi = i; - * - two numbers with an asterisk in between. i\*j: nlo = i; nhi = j; - * - * \param file name of source file for error message - * \param line line number in source file for error message - * \param str string to be processed - * \param nmin smallest possible lower bound - * \param nmax largest allowed upper bound - * \param nlo lower bound - * \param nhi upper bound - * \param error pointer to Error class for out-of-bounds messages */ - - void boundsbig(const char *file, int line, char *str, - bigint nmin, bigint nmax, bigint &nlo, bigint &nhi, - Error *error); + bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error); /** Expand list of arguments when containing fix/compute wildcards *