Hello Mohd,
I think you are looking for this function:
f(r) = a + (b - a) * r
where a is the min value, b is the max values and r is a random number
distributed between 0 and 1 (e.g. use gsl_rng_uniform_pos() to
generate r).
This come up a lot on the mailing list maybe it should be added to the
library?
Cheers,
Dan.
On 17 Jun 2008, at 16:26, Mohammad Khaleghi wrote:
Hi everybody!
Could somebody please tell me how to generate random numbers within
some ranges in the domain?
I saw the documentation and did not see anything like setting a min
and max. I mean for a distribution that has a domain (-inf, + inf)
could one set some range (min, max) to sample from? Or it is not
possible with gsl?
thans, Mohd
_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/?
[EMAIL PROTECTED]
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl