HI R Gurus,
> This is my first foray into using c-code with R, so ...
> I had a look at the archives and did not find anything on this, so
> hopefully I am not doubling up.
>
I have previously used the following approach where I needed some very
small numbers/large (using Brobdingnag):
surfacewithdiff <- function(t, y, p)
{
const=p["const"]
kay =p["kay"]
psii=p["psii"]
m1=p["m1"]
m2=p["m2"]
M=p["M"]
N=p["N"]
T=p["T"]
bexp<-as.brob((const*(psii-m1*y[1]-m2*M/N))/T)
yd1<-as.numeric((kay*exp(bexp))/(kay*t*exp(bexp)+1)-
(kay^2*t*exp(2*bexp))/(kay*t*exp(bexp)+1)^2)
list(c(yd1))
}
Now I guess this could be done with gmp.
Now I use this stuff in the function that odesolve's lsoda refers to,
and
I have found that my approach using pure R code is not fast enough, so I
need to convert
my function to C code. This is all on a windows system.
Is it possible to access gmp or Brobdingnag dll's from the C code?
Or do I need to install and compile the gmp library itself?
> Advice appreciated.
>
> Kind regards,
>
> Matt Redding
********************************DISCLAIMER**************...{{dropped:15}}