Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Trying to use class from GNU C++ library
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
abcdefghijklmnopqrstuvwxy




PostPosted: Tue Jun 26, 2007 1:35 pm   Post subject: Trying to use class from GNU C++ library

Hi, I am needing a random number generator more sophisticated than rand() and so I found this
http://www.lix.polytechnique.fr/~liberti/public/computing/prog/c/CPLUSPLUS/CONTRIB/GNU_STDLIB/libgpp.html#SEC44

I dunno if ACG fits my needs but I attempted to use it like this:

code:

ACG rNum((unsigned)time(0), 7); //ACG::ACG(seed, size)


But of course it won't compile because ACG isn't declared. The documentation doesn't give any examples of using ACG nor does it tell you what files to include. Does anyone know what files i need to include?

Also i tried getting other random number generators but I don't know how to install the libraries... i figure the GNU C++ library is already installed so. . . ya
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Jun 26, 2007 5:32 pm   Post subject: RE:Trying to use class from GNU C++ library

Why do you need a random number generator behond what c++ provids?
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
md




PostPosted: Wed Jun 27, 2007 12:26 am   Post subject: RE:Trying to use class from GNU C++ library

Because there are better random number generators? The standard C++ RNG is not cryptographically secure which is another reason to use something else.

You would need to have the source code for that particular library; from the looks if it it's from Art of Computer Programming, Vol III. Since finding the actual code might be difficult you could always implement the mersenne twister. Or download a library that does it if you are lazy.
wtd




PostPosted: Wed Jun 27, 2007 11:49 am   Post subject: RE:Trying to use class from GNU C++ library

Why would you need the source?

You just need a header file, and the appropriate library to link against.
abcdefghijklmnopqrstuvwxy




PostPosted: Wed Jun 27, 2007 5:11 pm   Post subject: Re: Trying to use class from GNU C++ library

yeah i think he means the source so i can see what libraries i need to include. I thought this ACG random number class would be in the gnu c++ library which i think is included in the standard gcc? If not than can someone tell me how to install a random number generator library... i'm confused about all this linking and stuff and my programs never compile...
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: