Results 1 to 5 of 5

Thread: GSL Random Number Generators: Where?

  1. #1
    Join Date
    Sep 2008
    Location
    Porto Alegre, RS, Brazil
    Posts
    124

    Question GSL Random Number Generators: Where?

    Hi all.

    I'm having a "simple" problem here: I'm not able to find the random number generator commands (random, rand, and alikes) in my Suse 11.0 here. Other commands, like factor, seq, are easilly found, but this one isn't. When I try to find it, it points me tu a executable in the /usr/games directory, which clearly isn't the one I'm looking for.

    Could someone help me here with this? I'm thinking about creating a base for a genetic algorithm script here, and of course that can't be done without randoms...

    Thanks in advance for any help!

  2. #2
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: GSL Random Number Generators: Where?

    johannesrs wrote:
    > Hi all.
    >
    > I'm having a "simple" problem here: I'm not able to find the random
    > number generator commands (random, rand, and alikes) in my Suse 11.0
    > here. Other commands, like factor, seq, are easilly found, but this one
    > isn't. When I try to find it, it points me tu a executable in the
    > /usr/games directory, which clearly isn't the one I'm looking for.
    >
    > Could someone help me here with this? I'm thinking about creating a
    > base for a genetic algorithm script here, and of course that can't be
    > done without randoms...
    >
    > Thanks in advance for any help!


    There is no such command as 'random'
    There are ways to get PRN (Pseudo Random Numbers) in e.g. Bash, Python and other
    scripting languages.
    E.g.
    <Bash>
    $echo $RANDOM
    23595

    $python
    Python 2.6 (r26:66714, Feb 3 2009, 20:52:03)
    [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from random import randint
    >>> randint(0,65535)

    9185

    Using /dev/(u)random
    $dd if=/dev/random bs=10 count=1 |xxd -a
    1+0 records in
    1+0 records out
    0000000: f96d 9f71 563c 90ec 05c3 .m.qV<....


    Theo

  3. #3
    Join Date
    Sep 2008
    Location
    Porto Alegre, RS, Brazil
    Posts
    124

    Default Re: GSL Random Number Generators: Where?

    Ok, that's the trick, it's a variable for bash!

    I usually use tcsh. Just in case, is there any equivalent for tcsh? I'm not finding it with google, only whole scripts...

    Thanks a lot!

  4. #4
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: GSL Random Number Generators: Where?

    johannesrs wrote:
    > Ok, that's the trick, it's a variable for bash!
    >
    > I usually use tcsh. Just in case, is there any equivalent for tcsh? I'm
    > not finding it with google, only whole scripts...
    >
    > Thanks a lot!


    Not as far as I can see.

    Theo

  5. #5
    Join Date
    Sep 2008
    Location
    Porto Alegre, RS, Brazil
    Posts
    124

    Default Re: GSL Random Number Generators: Where?

    No problems so. Or I switch shells, or make a small "random" function to be called.

    Thanks a lot anyway! That really saved me!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •