Re: [Rd] The following code (using rgamma) hangs

From: Faheem Mitha <faheem_at_faheem.info>
Date: Sat, 28 Jan 2012 03:44:34 +0530 (IST)

On Fri, 27 Jan 2012, Dirk Eddelbuettel wrote:

> | Dirk also pointed out (in the bug report) that you get the following
> |
> | ##########################################################
> | int main(void)
> | {
> | set_seed(0, 0);
> | cout << "one normal " << norm_rand() << endl;
> | }
> | ##########################################################
> |
> | edd_at_max:/tmp$ g++ -o faheem faheem.cpp -lRmath; ./faheem
> | one normal -inf
>
> Well I actually sent you a complete program of which you showed only an
> incomplete part. A better quote would have shown all:
>
> #define MATHLIB_STANDALONE
> #include <Rmath.h>
> #include <iostream>
> using std::cout;
> using std::endl;
>
> int main(void) {
> set_seed(0, 0);
> cout << "one normal " << norm_rand() << endl;
> }
>
>
> That does indeed return -Inf on my Ubuntu server. It works with other seed
> values as does the rgamma which hangs only for value 0 and 0.

Yes, apologies for not including the complete code.

Btw, adding the definitions of `get_seed` and `set_seed` from | `src/nmath/standalone/sunif.c` fixes the problem here as well.

faheem_at_orwell[default branch:rev 12]:~/corrmodel/bug$ ./edd one normal -1.26974

where previously it was giving -inf.

                                                        Regards, Faheem

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 27 Jan 2012 - 22:26:45 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 28 Jan 2012 - 16:20:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive