Displaying 20 results from an estimated 200 matches similar to: "R binomial RNG stuck at 1 via Fortran call"
2005 Nov 30
1
RNG stuck via Fortran call
Having not much success with my previous question I try to reformulate it:
I'm simulating a Markow chain in Fortran interfaced with R.
Each loop of my Fortran calls various functions of the R RNG through
the wrapper given below.
In a run of 100 iterations of the Markov kernel,
after 20 iterations, the RNG seems like frozen.
For example, the first call to the RNG in my loop is:
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
2004 Oct 22
1
building an R package : where and how should my fortran library be loaded ?
Hi ,
I'm currently trying to make available
a few fortran subroutines and R functions
(which make interface to these subroutines),
as an R package.
I'm doing it under linux with R 1.9.0
(but hope to do it for windows too).
I have trouble for loading my fortran code.
Here are the steps involved :
1) In R:
# Create tree for package
2005 Jul 05
1
calling fortran functions CHOL and DPOTRF form Fortran
Hi all,
I'm working out some Fortran code for which
I want to compute the Choleski decomposition of a covariance matrix
in Fortran.
I tried to do it by two methods :
1) Calling the lapack function DPOTRF.
I can see the source code and check that my call is correct,
but it does not compile with:
system("R CMD SHLIB ~/main.f")
dyn.load("~/main.so")
I get:
Error in
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 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]]
2004 Oct 25
5
building a package under windows
Hi,
I have a package of my own which seems to work fine under linux.
I want to make a compiled version for windows.
(I work with windows 2000 and R 2.0)
I have followed the steps described in the file
readme.packages (in the top-level directory of the binary installation)
and I had a trouble at this step (which aim is not documented):
C:\Program Files\R\rw2000\src\gnuwin32>make libR.a
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
2005 Oct 26
1
pb with dyn.load - fortran code now attached
Hi,
here are a couple of strange things happening with R.2.2.0 compiled
under Mandrake-10.1
At the begining of the story I have segmentation fault
using package RandomFields in conjuction with some Fortran code of mine
loaded with dyn.load.
One of my fortran programs contains a subroutine named fstat
Trying to trace , I simplified the sequence as much as possible
and I end up with the the
2005 Oct 26
0
pb with dyn.load
Hi,
here are a couple of strange things happening with R.2.2.0 compiled
under Mandrake-10.1
At the begining of the story I have segmentation fault
using package RandomFields in conjuction with some Fortran code of mine
loaded with dyn.load.
One of my fortran programs contains a subroutine named fstat
Trying to trace , I simplified the sequence as much as possible
and I end up with the the
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:
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 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 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
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
2005 Nov 08
1
R build under mandriva 10.2
After upgrading from mandrake 10.1 to mandriva 10.2
I can't build shared archive with R 2.2.0
[guillot at laplace src]$ R CMD SHLIB main.f sub.f wrapper.c
gcc -shared -L/usr/local/lib -o main.so main.o sub.o wrapper.o -lg2c -lm
-lgcc_s
/usr//bin/ld: cannot find -lg2c
collect2: ld returned 1 exit status
make: *** [main.so] Erreur 1
I guess the information in
2011 Feb 08
1
Recuperate Spectrum() amplitude
Dear list,
I apologies first for my English, hope you will understand well my question.
I am working on 1/2 hour piezometric data, time unit is second. They
present daily oscillation when using the spectrum() function. What I am
really interested in, is to find the amplitude corresponding to this
oscillation.
I work with a college using Matlab, and although we apply the same
methodology, our
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,
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: