#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB RANDOM_SOURCES *.c)
+file(GLOB RANDOM_SOURCES *.cpp)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${RANDOM_SOURCES} PARENT_SCOPE)
if (BUILD_TESTING)
add_subdirectory(tests)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
unsigned int
gmx_rng_make_seed(void)
{
- FILE *fp;
- unsigned int data;
- int ret;
- long my_pid;
+ FILE *fp;
+ unsigned int data;
+ int ret;
+ long my_pid;
#ifdef HAVE_UNISTD_H
/* We never want Gromacs execution to halt 10-20 seconds while
if (fp != NULL)
{
ret = fread(&data, sizeof(unsigned int), 1, fp);
+ GMX_IGNORE_RETURN_VALUE(ret);
fclose(fp);
}
else
static void
gmx_rng_update(gmx_rng_t rng)
{
- unsigned int lastx, x1, x2, y, *mt;
- int mti, k;
+ unsigned int x1, x2, y, *mt;
+ int k;
const unsigned int mag01[2] = {0x0UL, RNG_MATRIX_A};
/* mag01[x] = x * MATRIX_A for x=0,1 */
/* update random numbers */
mt = rng->mt; /* pointer to array - avoid repeated dereferencing */
- mti = rng->mti;
x1 = mt[0];
for (k = 0; k < RNG_N-RNG_M-3; k += 4)
}
void
-gmx_rng_cycle_2uniform(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_2uniform(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
double* rnd)
{
const gmx_int64_t mask_53bits = 0x1FFFFFFFFFFFFF;
}
void
-gmx_rng_cycle_3gaussian_table(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_3gaussian_table(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
real* rnd)
{
threefry2x64_ctr_t ctr = {{ctr1, ctr2}};
}
void
-gmx_rng_cycle_6gaussian_table(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_6gaussian_table(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
real* rnd)
{
threefry2x64_ctr_t ctr = {{ctr1, ctr2}};
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* (threefry2x64).
*/
void
-gmx_rng_cycle_2uniform(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_2uniform(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
double* rnd);
/* Return three Gaussian random numbers with expectation value
* threadsafe: yes
*/
void
-gmx_rng_cycle_3gaussian_table(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_3gaussian_table(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
real* rnd);
/* As gmx_rng_3gaussian_table, but returns 6 Gaussian numbers. */
void
-gmx_rng_cycle_6gaussian_table(gmx_int64_t ctr1, gmx_int64_t ctr2,
- gmx_int64_t key1, gmx_int64_t key2,
+gmx_rng_cycle_6gaussian_table(gmx_uint64_t ctr1, gmx_uint64_t ctr2,
+ gmx_uint64_t key1, gmx_uint64_t key2,
real* rnd);
#ifdef __cplusplus