If you are currently using RandomLib and expect to be working on
applications involving random numbers for the next few years, please see
my advice at http://randomlib.sf.net:
IMPORTANT NOTE: The original motivation for this library was to
provide a robust and portable library for random numbers of C++
applications. Now that C++11 is widely available, you should
transition to using the <random> header for most applications. On
Linux and Mac OSX, supply the -std=c++0x or -std=c++11 flag to the
compiler. On Windows, use Visual Studio 11 (2012) and later. Exact
sampling from the normal and discrete normal distributions is now
available with the exrandom package which is built on the C++11 random
number facilities.... read more</random>
Changes between 1.10 (released 2014-11-22) and 1.9 versions:
After upgrading to RandomLib version 1.9 or later, it's possible that
projects that compile and link to RandomLib will get this compiler
error:
#error : RANDOMLIB_SHARED_LIB must be 0 or 1
This will only happen on non-Windows systems and is caused by cmake
finding the cmake configuration for a pre-1.9 version of RandomLib. The
fix is to remove all earlier cmake configuration files with (as root):... read more
Changes between 1.9 (released 2014-03-15) and 1.8 versions:
Visual Studio 9 has a long long type. However std::abs doesn't work for this type. This bug causes the compilation of RandomCoverage to abort. The following patch avoids this problem:
diff --git a/examples/RandomCoverage.cpp b/examples/RandomCoverage.cpp
index 44519b6..a89ee42 100644
--- a/examples/RandomCoverage.cpp
+++ b/examples/RandomCoverage.cpp
@@ -279,11 +279,15 @@ void coverage32() {
{ RandomLib::DiscreteNormal<short> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormal<int> pd(7,1,1,2); repeat pd(r); }
{ RandomLib::DiscreteNormal<long> pd(7,1,1,2); repeat pd(r); }
- { RandomLib::DiscreteNormal<long long> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormalAlt<short,1> pd(7); repeat pd(r)(r); }
{ RandomLib::DiscreteNormalAlt<int,8> pd(7); repeat pd(r)(r); }
{ RandomLib::DiscreteNormalAlt<long,28> pd(7); repeat pd(r)(r); }
+#if !(defined(_MSC_VER) && _MSC_VER < 1600)
+// Visual Studio 9 (and earlier?) has a long long but doesn't have a std::abs
+// for this type. So skip the long long tests for DiscreteNormal{,Alt}.
+ { RandomLib::DiscreteNormal<long long> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormalAlt<long long,32> pd(7); repeat pd(r)(r); }
+#endif
{ RandomLib::InversePiProb pd; repeat pd(r); }
{ RandomLib::InverseEProb pd; repeat pd(r); }
}
@@ -551,11 +555,15 @@ void coverage64() {
{ RandomLib::DiscreteNormal<short> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormal<int> pd(7,1,1,2); repeat pd(r); }
{ RandomLib::DiscreteNormal<long> pd(7,1,1,2); repeat pd(r); }
- { RandomLib::DiscreteNormal<long long> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormalAlt<short,1> pd(7); repeat pd(r)(r); }
{ RandomLib::DiscreteNormalAlt<int,8> pd(7); repeat pd(r)(r); }
{ RandomLib::DiscreteNormalAlt<long,28> pd(7); repeat pd(r)(r); }
+#if !(defined(_MSC_VER) && _MSC_VER < 1600)
+// Visual Studio 9 (and earlier?) has a long long but doesn't have a std::abs
+// for this type. So skip the long long tests for DiscreteNormal{,Alt}.
+ { RandomLib::DiscreteNormal<long long> pd(7); repeat pd(r); }
{ RandomLib::DiscreteNormalAlt<long long,32> pd(7); repeat pd(r)(r); }
+#endif
{ RandomLib::InversePiProb pd; repeat pd(r); }
{ RandomLib::InverseEProb pd; repeat pd(r); }
}
This is a maintenance release. Changes
This is a maintenance release. Changes
fix cmake warning with Visual Studio Express.
Fix for compilation with Visual Studio 11.
This is a maintenance release. Changes:
Improve algorithm used by RandomLib::ExactNormal class.
Add internal documenation to the cmake configuration files.
Change license to MIT/X11.
Add RandomLib::ExactNormal class. This enables you to sample
exactly from a normal distribution with zero mean and unit variance
(assuming that the underlying generator is perfect).
Document function arguments and return values.
Include OpenMP header in RandomThread.cpp.
No code changes...
No code changes...
Changes between 2011-06 and 2010-05 versions:
Changes between 2011-05 and 2010-04 versions:
cmake does not configure RandomLib properly if it can't find boost.
The following patch fixes this. (RandomLib does not require boost.)
--- examples/CMakeLists.txt (revision 6940)
+++ examples/CMakeLists.txt (revision 6951)
@@ -1,6 +1,9 @@
# $Id$
-include_directories (${Boost_INCLUDE_DIRS})
+if (Boost_FOUND)
+ include_directories (${Boost_INCLUDE_DIRS})
+endif (Boost_FOUND)
+
add_custom_target (examples ALL)
foreach (EXAMPLE ${EXAMPLES})
The code has been moved on subversion on sourceforge and
the build procedures have been reorganized. The code
remains largely the same.
John DeWitt has pointed out to me at in some environments
is required in RandomSeed.hpp. This change will be included in
the next release, but I'm not sure when that will be. In the
meantime, if you run into iterator related problems when
compiling RandomLib then include this additional header.
--Charles