Questions tagged [boost-random]

The Boost Random Number Library (Boost.Random for short) provides a variety of generators and distributions to produce random numbers having useful properties, such as uniform distribution. Boost are free peer-reviewed portable C++ source libraries that work well with the C++ Standard Library.

42 questions
1
vote
1 answer

How to use boost::uniform_on_sphere?

I am trying to pick a random point on a unit sphere, and found that boost provides the distribution that does exactly this. But when I try to use it, all generated values are nan. I don't know what I am doing wrong, could you please enlighten me?…
lvella
  • 12,754
  • 11
  • 54
  • 106
0
votes
1 answer

Using boost for (pseudo-)random number generator of long double

I'm trying to use boost for random number generation of a long double (on a 64bits machine). At some point I use rng = boost::mt19937(); However, compiler argues that on line 88 of boost/random/mersenne_twister.hpp, x[i] = (1812433253UL * (x[i-1]…
Jorge Leitao
  • 19,085
  • 19
  • 85
  • 121
0
votes
0 answers

C++ boost library to generate negative binomial random variables

I'm new to C++ and I'm using the boost library to generate random variables. I want to generate random variables from a negative binomial distribution. The first parameter of boost::random::negative_binomial_distribution freq_nb(r, p); has to…
dan
  • 25
  • 6
0
votes
1 answer

Boost Random with templates

So I'm trying to use the Boost.Random mt19937 generator with templates. My c++ is a bit rusty, but from all I understand (and the doc, as always for Boost, is no less than vague) it should take a template argument that specifies it's return type…
TC1
  • 1
  • 3
  • 20
  • 31
0
votes
0 answers

Cmake cannot find boost_randomConfig.cmake file

I am installing an inhouse software. When I use cmake I get the following error: CMake Error at /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:120 (find_package): Could not find a package configuration file provided by "boost_random" …
Alpha001
  • 21
  • 4
0
votes
3 answers

Why i cant change nav-link color on CSS?

1) Why I can not change the nav-link color on CSS? I'm trying to change the color of MENUTEST's (nav-link) to white, but it's not working and 2) Add a line white above every MENUTEST's texts (just like [u] but above) How to do it? What do i'm doing…
Runsicky
  • 13
  • 5
0
votes
2 answers

Behavior of discard for boost random number generators

I am wrapping boost random number generators with an adapter class to implement a Monte Carlo routine. When writing unit tests on the member functions of the class, I assumed that the behavior of .discard(unsigned int N) is to draw N random numbers…
tompdavis
  • 115
  • 4
0
votes
0 answers

thread safe random number with same seed for intel TBB threads

I have a function object for parallelizing a for_each() algorithm using Thread Building Blocks, The function object uses a random number generator RND whose operator method () generates a random number. Problem: I need a random number number…
pugs
  • 155
  • 1
  • 8
0
votes
0 answers

optimizing/checking drawing random numbers with boost

I have finished installing Boost, and I am (finally) using it in my program. What I wanted was to be able to generate Randomly distributed numbers between 0 and 1 Normally distrubted numbers with standard deviation 1 I have accomplished this by…
BillyJean
  • 1,537
  • 1
  • 22
  • 39
0
votes
1 answer

Setting parameters for gamma_distribution using boost

I am trying to use the Gamma distribution from Boost 1.5. Now I want the value of k and theta to be 4 and .5 respectively. But I get a compile error whenever I set the value of theta < 1. /usr/local/include/boost/random/gamma_distribution.hpp:118:…
freeborn
  • 115
  • 1
  • 2
  • 8
-3
votes
4 answers

Boostrap Form with PHP, MySQL not sending data to database

I've been trying to debug this for ages now and don't understand why is it not sending data to my database. Also as an indication, I'm using Boostrap and this form is inside of a modal. Can someone help me out please. I will include my html snipet…
Kasia Wichrowska
  • 311
  • 2
  • 5
  • 16
1 2
3