Displaying 20 results from an estimated 100 matches similar to: "RNG stuck via Fortran call"
2005 Nov 30
2
R binomial RNG stuck at 1 via Fortran call
Hi,
I have some trouble with the result of a fortran function calling the R
binomial RNG:
The C function rbinom is wrapped as in the file attached.
My main fortran program starts as
call rndstart()
and ends as
call rndend()
I happen to call the binomial RNG within a loop as
b = ggrbinom(1.d0,0.5d0)
write(*,*) 'b=',b
In certain cases, after a few iterations in the loop,
b get
2005 Jun 14
3
Calling C from Fortran
I would like to call C routines from Fortran under linux as suggested in
section 5.6 of
the "Writing R extensions" documentation.
I'm familiar with Fortran but not with C.
I understand the example provided in Fortran:
subroutine testit()
double precision normrnd, x
call rndstart()
x = normrnd()
call dblepr("X was", 5, x, 1)
call rndend()
end
but I don't understand
2005 Jun 14
1
Calling C from Fortran
I would like to call C routines from Fortran as suggested in section 5.6 of
the "Writing R extensions" documentation.
I'm familiar with Fortran but not with C.
I understand the example provided in Fortran:
subroutine testit()
double precision normrnd, x
call rndstart()
x = normrnd()
call dblepr("X was", 5, x, 1)
call rndend()
end
but I don't understand the purpose
2006 Jan 20
3
Troubles with the function rmultinom.c of the R's Random Number Generator
Hi,
I'm simulating a Markov chain in Fortran interfaced with R-2.2.1 in order
to generate data according to a Markov Random Field called the Potts model.
R Version:
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 2
minor 2.1
year 2005
month 12
day 20
svn rev 36812
Each loop of my Fortran calls the function rmultinom.c
2009 Jun 30
3
Matrix with random number
Hello!
I have a program in Fortran and would like to build a matrix with random numbers, I have a function in C.
However, I have problems with the use of function in R.
Code to compile: R CMD SHLIB mat.f myrbeta.c -o func.so
Code in C.
#include <R.h>
#include <Rmath.h>
void F77_SUB(fseedi)(void){
GetRNGstate();
}
void F77_SUB(fseedo)(void){
PutRNGstate();
}
void
2017 May 09
2
registering Fortran routines in R packages
Dear list,
I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics.
Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
2017 May 10
3
registering Fortran routines in R packages
Thanks for your email.
I try to change the name in lowercase but it conflicts with a C implementation also named halton. So I rename the C function halton2() and sobol2() while the Fortran function are HALTON() and SOBOL() (I also try lower case in the Fortran code). Unfortunately, it does not help since I get
init.c:97:25: error: use of undeclared identifier 'halton_'; did you mean
2009 Dec 29
2
how can I use R functions in Fortran 90
Hi all,
Is there a way that I can import R functions into Fortran? Especially, I
want to generate random numbers from some not-so-common distributions (e.g.
inverted chi square) but did not find any routines written in Fortran that
deal with distributions other than uniform and normal.
Thanks.
Anny
[[alternative HTML version deleted]]
2000 Aug 11
2
R-devel Aug-09 1.2.0 build on hpux10.20
Hello,
I had to set CPPFLAGS and FC=fort77 but configure saw atlas and used
it instead of blas. However atlas for hp seems to missing some libs. I
had to add -lblas in Makeconf. Everything builds ok. But modreg and
tcltk doesn't load.
R : Copyright 2000, The R Development Core Team
Version 1.2.0 Under development (unstable) (2000-August-9)
R is free software and comes with ABSOLUTELY NO
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
2001 Jul 14
1
Calling rand_unif() from fortran
What is the necesary incantation to call rand_unif() from a fortran
routine?
Just inserting rand_unif() into the fortran code compiles OK, but won't
dyn.load():
> dyn.load("forest.so")
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library "/home/warnes/R/forest/forest.so":
/home/warnes/R/forest/forest.so: undefined symbol:
2017 May 10
1
registering Fortran routines in R packages
Have you tried using tools:::package_native_routine_registration_skeleton()? If you don't like its output, you can easily edit its results and still avoid most pitfalls.
Cheers, Jari Oksanen
________________________________________
From: R-devel <r-devel-bounces at r-project.org> on behalf of Berend Hasselman <bhh at xs4all.nl>
Sent: 10 May 2017 09:48
To: Christophe Dutang
Cc:
2009 Feb 13
2
Generate random numbers in Fortran
Hi!!!
It would like to know if it exists a form to use the functions to
generate variates in FORTRAN with the same easiness I use that them in
C? Or not?
If yes. They would have some example? I would like to use the functions rbeta, rlnorm and others!
Sorry my english..rsrsrs
Thanks!!!
Fábio Mathias Corrêa University Federal of the Lavras - Brazil
Veja quais são os
2017 May 09
0
registering Fortran routines in R packages
> On 9 May 2017, at 13:44, Christophe Dutang <dutangc at gmail.com> wrote:
>
> Dear list,
>
> I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics.
>
> Reading
2009 Jan 07
2
Understanding dsyrk_ in C code
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm trying to understand some C code in an R package I'm using. I'm address this question here as
it's matrix algebra...and I'm no pro at that!
the C command reads:
double alpha = 1.0, beta = 0.0;
dsyrk_("L", "N", nGenes, nGenes, & alpha, mat1, nGenes,
& beta, mat2, nGenes);
- From google,
2014 Jan 08
1
CRAN rejects package because of write statement in Fortran
I recently developed an R package to make available a very large legacy
program written in Fortran. My package has been rejected by CRAN due to
this Write statement with the message "As 'Writing R Extensions' warns you
against including Fortran I/O, this will not be allowed."
The issue is that this Write statement does not involve I/O it is inernally
writing an integer to a
2001 Jun 06
1
The old Fortran underscore problem
I have dealt with this on so many platforms in
the past that I should know the answer by now.
I looked in V&R S Programming, R manuals and FAQ
and still can't find the answer.
In the Hmisc library I used the R scripts to build
the package, which creates Hmisc.so. I have
library.dynam('Hmisc', ...) in the .First.lib.
When doing library(Hmisc) I get
Error in dyn.load ....
2008 Sep 05
1
How do I use Internet Explorer 6.0 in Wine 1.1.3
Hi I just installed Wine 1.1.3 a couple of days ago, on my Acer Aspire 3623 Laptop (256MB and 40G HD) running PuppyLinux 4.0 OS. I installed Wine because I am taking an online math course at college and it needs a Windows OS and Internet Explorer 6.0 to run.
[Image: http://farm4.static.flickr.com/3224/2831514726_408632591a_o.png ]
Then I installed Internet Exlorer using the "Add
2009 Jan 15
2
Interface to open source Reporting tools
Hi,
I am a new user of R 2.8.1. I use Tinn-R for code editing. I use a windows
2003 system with 1 GB RAM.
I am interested to generate dashboard and reports based on data from MS
Access. These reports need to be posted on a weekly basis to the web. The
reporting interface should provide facilities for "what if" scenarios.
Is it possible to interface R analysis results to good open
1999 Aug 30
1
Single precision
I am trying to port a huge Fortran routine that has been written
using type Real (single precision) instead of Real*8. R works only with
double precision and I got absurd results when calling the routine. Is
it possible to make it work properly without changing the source code?
I am running V0.64.1 of R for Unix.
Thanks
--------------------------
Carlos Corral van Damme
GNSS Unit, GMV