Remove gmx custom fixed int (e.g. gmx_int64_t) types
[alexxy/gromacs.git] / src / gromacs / random / uniformrealdistribution.h
index 0243a48265b20e90079dd25a1f5723d01d3e04a3..f4a740a10cb3fda7e35afb1919d90edafb01dd8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018, 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.
@@ -105,17 +105,17 @@ RealType
 generateCanonical(Rng &g)
 {
     // No point in using more bits than fit in RealType
-    const gmx_uint64_t digits   = std::numeric_limits<RealType>::digits;
-    const gmx_uint64_t realBits = std::min(digits, static_cast<gmx_uint64_t>(Bits));
-    const gmx_uint64_t range    = Rng::max() - Rng::min() + gmx_uint64_t(1);
-    gmx_uint64_t       log2R    = (range == 0) ? std::numeric_limits<gmx_uint64_t>::digits : log2I(range);
-    gmx_uint64_t       k        = realBits / log2R + (realBits % log2R != 0) + (realBits == 0);
+    const uint64_t     digits   = std::numeric_limits<RealType>::digits;
+    const uint64_t     realBits = std::min(digits, static_cast<uint64_t>(Bits));
+    const uint64_t     range    = Rng::max() - Rng::min() + uint64_t(1);
+    uint64_t           log2R    = (range == 0) ? std::numeric_limits<uint64_t>::digits : log2I(range);
+    uint64_t           k        = realBits / log2R + (realBits % log2R != 0) + (realBits == 0);
     RealType           r        = Rng::max() - Rng::min() + RealType(1);
     RealType           s        = g() - Rng::min();
     RealType           base     = r;
     RealType           result;
 
-    for (gmx_uint64_t i = 1; i < k; ++i)
+    for (uint64_t i = 1; i < k; ++i)
     {
         s    += RealType(g()-Rng::min()) * base;
         base *= r;