similar to: R equivilant to RAND_MAX in C

Displaying 20 results from an estimated 5000 matches similar to: "R equivilant to RAND_MAX in C"

1999 Feb 24
2
Compiling R on Sunos
I'm looking for some help in getting R to compile on Sunos. We run a collection of Sunos and Solaris machines in the department here. I got to compile on Solaris 2.5.1 using gcc 2.7.2.2. On my Sunos 4.1.3 (and I've tried it on Sunos 4.1.4 as well) machines, it crashes during the compile. I'm using gcc 2.8.1 on there. It gets to this point: gcc -g -O2 -I../include
2000 Dec 11
1
fixing shuffle in ogg123
Hi, There is a bug in the shuffle of ogg123 which was here at least until the CVS version of 3 days ago. Here's our fix: (it seems to be not perfectly equiprobable but at least fixes the old one which sometimes gives two times the same song and never the other song) -=-=-- --- vorbis-tools-1.0beta3/ogg123/ogg123.c.pix Sat Nov 4 01:23:21 2000 +++ vorbis-tools-1.0beta3/ogg123/ogg123.c Thu
2004 Sep 28
3
[LLVMdev] patches and problem...
Here I am again... I missed that in the previous diff, they are the usual missing <algorithm> and the std:: namespace missing in sort, find, make_pair. Alkis can you please give them an eye when you have time? The next major problem is that VC has only int rand(void) void srand( int seed ) So I donno how to compile the ExecutionEngine/Interpreter/ExternalFunctions.cpp that refers to the
2003 Apr 07
4
4-stable and C rand()?
Hi everyone, sorry if this has been answered before - I caught a whiff of a discussion about c's rand() function in a mailing list archive, but couldn't find a definitive answer. I'm trying to do a simple CS project on my machine where I generate two sets of values in parallel using rand() and am running into infinite loops of values, and couldn't figure out why, so I wrote a test
2004 Sep 28
0
[LLVMdev] patches and problem...
On Tue, 28 Sep 2004, Paolo Invernizzi wrote: > The next major problem is that VC has only > > int rand(void) > void srand( int seed ) > > So I donno how to compile the > ExecutionEngine/Interpreter/ExternalFunctions.cpp that refers to the > drand48 srand48 lrand48 etc series... > For now I hacked them, like > > double drand48(void) { return (float) rand() /
2009 Nov 13
2
random numbers in C
I need some random numbers in my C program. Here a small example: //////////////////////////////////////////////////////////////////////////////// #include <R.h> void rand (int* n) { int len = *n; for (int i = 0; i < len; i++) Rprintf("%1.5f ", unif_rand()); } dyn.load("rand.dll") .C("rand", as.integer(10)) dyn.unload("rand.dll")
2003 Oct 27
3
expanding factor with NA
I have a factor (with "n" observations and "k" levels), with only "nobs" < n of the observations not missing. I would like to produce a (n x k) model matrix with treatment contrasts for this factor, with rows of NAs placeholding the missing observations. If I use model.matrix() I get back a (nobs x k) matrix. Is there an easy way to get the (n x k) without
2018 Sep 20
4
Bias in R's random integers?
Hello, On Thursday, September 20, 2018 11:15:04 AM EDT Duncan Murdoch wrote: > On 20/09/2018 6:59 AM, Ralf Stubner wrote: > > On 9/20/18 1:43 AM, Carl Boettiger wrote: > >> For a well-tested C algorithm, based on my reading of Lemire, the > >> unbiased "algorithm 3" in https://arxiv.org/abs/1805.10941 is part > >> already of the C standard library in
2009 Nov 16
2
(Parallel) Random number seed question...
Hi All, I have k identical parallel pieces of code running, each using n.rand random numbers.? I would like to use the same RNG (for now), and set the seeds so that I can guarantee that there are no overlaps in the random numbers sampled by the k pieces of code.? Another side goal is to have reproducibility of my results.? In?the past I have used C with SPRNG for this task, but I'm hoping
1999 Feb 05
0
Installing R programs (PROBLEMS !!!!)
[forwarded to R-devel, where this really belongs] >>>>> "Samira" == Samira M Ismail <samira@ime.unicamp.br> writes: (to me in a private mail) Samira> We have been trying to install R.0.63 for Unix (SunOS 4.1.4 - Samira> SPARC 20) and we detected the following problem which makes Samira> impossible to run R. We have got the following message:
1999 Feb 05
0
[Fwd] Problems installing R on SunOS 4.1.4
[forwarded to R-devel, where this really belongs] >>>>> "Samira" == Samira M Ismail <samira@ime.unicamp.br> writes: (to me in a private mail) Samira> We have been trying to install R.0.63 for Unix (SunOS 4.1.4 - Samira> SPARC 20) and we detected the following problem which makes Samira> impossible to run R. We have got the following message:
2002 Jan 24
2
random number generation issues with r and compiled C code
Dear People, I have been writing a simulation routine that is currently entirely written in c++. I've been using the R standalone math library to give me random number generation for this. However, I have had to set the seed myself, and I am using set_seed(time(NULL), clock) for every call to unif_rand(). However, this works really badly. The random numbers aren't uniform at all. Does
2002 Nov 24
1
unif_rand() and exp_rand()
Dear R-users: Recently I found my simulation run into an apparently infinite loop. After a few days of tracing and chasing, I believe it is caused by the built-in unif_rand() and exp_rand() functions: unif_rand() can produce a value of 0 which causes the following part of exp_rand() running into an infinity loop u = unif_rand(); for (;;) { u += u; if (u > 1.0) break;
2003 Aug 25
1
Re: R 1.7.x and inaccurate log1p() on OpenBSD 3.2 and NetBSD 1.6 (PR#3979)
>> I have come across your reported log1p error (#2837) on a NetBSD (1.6W) >> system. I've just made further experiments on the deficient log1p() function on OpenBSD 3.2 and NetBSD 1.6 with this test program: % cat bug-log1p.c #include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char* argv[]) { int k; double x; for (k = 0; k
2004 Sep 29
2
[LLVMdev] patches and problem...
Hmm, I guess I need a sys::Math::getRandom() function that uses a "good" random number generator on the given platform. I'll make a note of this and tuck it away for future implementation. Reid. Chris Lattner wrote: > On Tue, 28 Sep 2004, Paolo Invernizzi wrote: > > >>The next major problem is that VC has only >> >>int rand(void) >>void srand(
2007 Mar 19
2
Wine and DirectX
I have a couple of questions about Wine, just in an attempt to enhance my understanding of it: Is Wine writing its own implementation of DirectX, which sort of 'forwards' instructions to an equivilant in OpenGL? Is it possible to install the official MS DirectX under Wine? If not, why not? Thanks for any info :-)
2009 Apr 03
1
Hello! I got error in C - R
Hello, My name is Ick Hoon Jin and I am Ph. D. student in Texas A & M Univ.. When I run the C embedded in R in the Linux system, I confront the following error after 6,000 iteration. By googling I found this error is from the problem in C. *** caught segfault *** address (nil), cause 'memory not mapped' My C code is following:
2003 Nov 28
6
3x AVM Fritz!Card PCI for a EuroISDN PBX.
Hi there! I'm currently considering various PBX solutions for our office telephone network, and would very much like to use Asterisk. Currently, my research is incomplete. I have been recommended to use the above cards, but it is unclear from my Googling whether my configuration will work: - 3x Fritz!Card PCI's in one host. - 3x 6 b-channels. - ~20 Budgetone (and some others)
2008 Jan 03
3
Whats the merb equivilant of this?
Hey All Quick question, what''s the merb equivalent of this: ActionView::Base.new([template_root], assigns, self) in merb? Ive found Merb::Template::Erubis.transform(:file => ''/path/to/file'') But I''ve no idea if thats the correct thing to be calling? It doesn''t ''feel'' right, so im not sure it is? Thanks Tim
2018 Sep 20
5
Bias in R's random integers?
On 9/20/18 1:43 AM, Carl Boettiger wrote: > For a well-tested C algorithm, based on my reading of Lemire, the unbiased > "algorithm 3" in https://arxiv.org/abs/1805.10941 is part already of the C > standard library in OpenBSD and macOS (as arc4random_uniform), and in the > GNU standard library. Lemire also provides C++ code in the appendix of his > piece for both this and