similar to: The following code (using rgamma) hangs

Displaying 20 results from an estimated 1000 matches similar to: "The following code (using rgamma) hangs"

2002 Jan 14
1
trouble using R Mathlib as standalone
Dear People, I am trying to use R's Math library as standalone, as documented in /src/nmath/standalone. I am using C++ in Debian testing, and the versions are as follows: ii g++-3.0 3.0.3-1 The GNU C++ compiler. ii r-mathlib 1.4.0-1 `GNU S' - Standalone R math library I have a file (rand.cc) as follows. I don't think that lattice.hh or mh.hh are very
2006 Mar 03
1
Fwd: Re: calling R's library using C
Sorry, forgot to switch the header to the R group.... --- Globe Trotter <itsme_410 at yahoo.com> wrote: > Date: Thu, 2 Mar 2006 19:35:21 -0800 (PST) > From: Globe Trotter <itsme_410 at yahoo.com> > Subject: Re: [R] calling R's library using C > To: Dirk Eddelbuettel <edd at debian.org> > > Hi, Dirk: > > Thanks for all the help. I thought I would
2003 Dec 14
1
compile error with C code and standalone R math C library
Dear People, I just went back to an old piece of C code. On trying to compile it with the R math standalone C library I got the following error. Can anyone enlighten me what I am doing wrong, if anything? C file (rr-sa.c) follows. I'm on Debian sarge. I'm running R version 1.8.1. Gcc is version 3.3.1. Thanks in advance. Faheem.
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
2011 Aug 04
1
How to seed the R random number generator in C (standalone) with an instance of .Random.seed
hello all, I use the R standalone math library in my own C program, and the default R random number generator can be seeded with set_seed(const unsigned int, const unsigned int). How could I seed the RNG with an instance of .Random.seed ? I would need this or a similar workaround for debugging purposes. More precisely, I use the default R random number generator to sample from various
2000 Apr 14
1
rgamma with negative shape and scale parameters works?
Dear R people, This is a possibly silly question, but the rgamma function takes the shape and scale arguments and simulates gamma rvs corresponding to those values, right? But the shape and scale parameters have to be positive, right? However, rgamma quite happily returns to me values for negative values of shape and scale, and in some cases returns negative values eg. > rgamma(1, 1, -1) [1]
2023 Feb 16
0
User-defined RNG with the standalone Rmath library
I have two questions about using a user-defined random number generator (RNG) with the standalone Rmath library. The default RNG with the standalone Rmath library is the Marsaglia-multicarry generator, which has poor properties. The "R Installation and Administration" manual, in the section "The standalone Rmath library", states that: ``` A little care is needed to use the
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
2004 Apr 14
1
question about /nmath/standalone
Hello, I can't link a c code with Mathlib according to introduction of R manual "Writing R Extensions", page 60. It is written : "It is possible to build Mathlib, the R set of mathematical functions documented in 'Rmath.h?, as a standalone library 'libRmath? under Unix and Windows. (This includes the functions documented in Section 5.7 [Numerical analysis
2004 Mar 19
1
R_qsort_int_I() error
Hi, I want to use R_qsort_int_I() in my C function, but getting the following error. It looks like there is a conflict between Rmath.h, which I use to generate random numbers, and R_ext/Boolean.h I would appreciate any help to fix this problem. gcc -ansi -g -o Gibbs gibbs.c subroutines.o rand.o vector.o -lm -lRmath -llapack -lblas -lfrtbegin -lg2c -lm -shared-libgcc In file included from
2006 Mar 02
1
calling R's library using C
Hi, Thanks, everyone for all the help! So, here is my calling function in C (called test.c): #include<stdio.h> #include<stdlib.h> #include<Rmath.h> int main(void) { printf("%f \n",pchisq(2.,7., 1, 0)); printf("%f \n",pnchisq(2.,7.,0., 1, 0)); return EXIT_SUCCESS; } I compile using: gcc test.c -I/usr/lib/R/include
2004 Apr 14
2
again question about nmath/standalone
Hello, I forgot to tell you that I am using Linux OS. And I can?t find directory "src/nmath/standalone". I will send you the test code I am using and the whole operation process. [credsim at confsys ~/src]$ gcc test1.c -o test1 -lRmath test1.c: In function `main': test1.c:18: warning: assignment makes pointer from integer without a cast test1.c:19: warning: assignment makes
2004 Jun 22
1
R mathlib
Hello, dear R experts! I run R on Debian 'sarge' platform. There is 'r-mathlib' package in Debian distribution, which is described as: $ dpkg --status r-mathlib ... This packages provides the libRmath shared and static libraries which can be called from standalone C or C++ code. Well, I use runif() function in test_runif.c: #include <Rmath.h> main() { // ...
2005 Aug 11
1
include C functions from nmath in my own C functions
Hi: I followed the README in src/nmath/standalone/ to make the use the command "make shared" to make the libRmath.so file. I also add the directories containg libRmath.so to LD_LIBRARY_PATH by using command "export D_LIBRARY_PATH=$LD_LIBRARY_PATH:$/home/zhliu/Backup/R-2.0.1/src/nmath/standalon e " However, when I try to run the following codes by the command
2004 Apr 22
2
Urgent:again question about nmath/standalone
Hello, all, I have the same question as the last mail I sent. I have installed libRmath in my system. But I still can not link Rmath through -lRmath. The whole process is as follow.Is there anybody who is so kind to help me find out the problem? I will appreciate very much. [credsim at confsys ~]$ cd /usr/lib [credsim at confsys lib]$ ls -l libR* -rw------- 1 bcdesai bcdesai 237828 Apr
2008 Jan 02
1
setting the seed in standalone code using Rlib
Hi, Is the below -- setSeed -- an okay way to set the seed in standalone applications making use of Rlib? It seems to work as expected. Is there a better way to do it? (I'm also looking at do_setseed but am unsure what to supply as op. findFun("set.seed", R_GlobalEnv)?) Thanks much. -- David Faden, dfaden at iastate.edu AIM: pitulx -- #include <assert.h> #include
2001 Feb 27
1
using fmod in C code to be loaded into R
Dear People, I wrote the following bit of C code and (along with other bits) called it mycode.c, and compiled the file into a shared library to load into R, using R CMD SHLIB mycode.c. This was Ok, but when I tried to load this into R using dyn.load("mycode.so") I got the error > dyn.load("mycode.so") Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to
2012 Jul 14
2
rgamma function
Hi, Has anyone encountered the problem of rgamma function in C? The following simplified program always dies for me, and I wonder if anyone can tell me the reason. #include <Rmath.h> #include <time.h> #include <Rinternals.h> SEXP generateGamma () { srand(time(NULL)); return (rgamma(5000,1)); } Has anyone encountered a similar problem before? Is there another way
2013 Oct 10
1
Replacing the Random Number Generator in Stand Alone Library
Hi R-Developers, I had a question about the random number generator used in the R StandAlone Math Library. The stand-alone library depends on the unif_rand() function for most simulated values, and this function is provided in the sunif.c file in the relevant directory. At present, this program implements the "Marsaglia-Multicarry" algorithm, which is described throughout the R
2010 Jan 28
1
Problem with R math library.
Hello. I've been working on my OCaml-R binding, and I quite pleased to see that it is functional, though far from being perfect or polished. You can find the gitweb webpage and the interface documentation at http://yziquel.homelinux.org/gitweb/?p=ocaml-r.git;a=tree http://yziquel.homelinux.org/topos/api/ocaml-r/index.html I'm having unexpected trouble with the math library, though.