Hello,
I am very new to C++. I am using it to use a set of random numbers in my simulation, for which I am using boost library in the header. I am currently using Microsoft Visual Studio 2010. But it could not open source file "boost/random.hpp". Can anyone please give me some direction here?
1 2 3 4 5 6 7 8 9 10 11 12 13
// In the header file I use these. But it cannot find any of these libraries
# include <boost/random.hpp>
# include <boost/random/random_device.hpp>
# include <boost/random/normal_distribution.hpp>
# include <boost/random/uniform_real_distribution.hpp>
# include "boost/generator_iterator.hpp"
// in the source file I use:
boost::mt19937 rng(time(0));
boost::normal_distribution<> range(0, 1);
boost::variate_generator< boost::mt19937, boost::normal_distribution<> >
randNum(rng, range);
for (unsignedint i=0; i<N; i++) randNumArray[i] = randNum();
I presume by "open source" you mean that the compiler cannot find and include the hpp file. Right?
I also assume that you installed Boost Libraries and have told the compiler (either on the command line or via the project options) where to find the libraries.