search for: libargs

Displaying 3 results from an estimated 3 matches for "libargs".

Did you mean: lib_args
2011 Oct 05
2
cuhre usage ?? multidimensional integration
my=function(x){ len=1 for(i in 1:len){ y[i]=x[i] } g=1 w=NULL t=NULL for(i in 1:len)w[i]=x[i+len] for(i in 1:len)t[i]=x[i+2*len] for(i in 1:len)g=g*dnorm(y[i])*dnorm(w[i])*dnorm(z[i]) return(g) } cuhre(6,1,my,rep(-100,6),rep(100,6)) Error in crff(match.call(), integrand, "cuhre", libargs, ...) : Additional argument not expected in the integrand function function change to my=function(x,g,i,j) result is not right. it should be 1, but it turns out to be 0.039... How can I make this work? Thank you! -- View this message in context: http://r.789695.n4.nabble.com/cuhre-usage-mul...
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...funx <- cfunction(signature(s="numeric", n="numeric"), gslrng, includes="#include <gsl/gsl_rng.h>", Rcpp=TRUE, cppargs="-I/usr/include", libargs="-lgsl -lgslcblas") print(funx(0, 5)) Brief notes on this: 1) The character variable gslrng contains valid C++ code. 2) The call to cfunction converts this C++ code into a function that calls it -- and this function is compiled, linked and loaded automagically si...
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...funx <- cfunction(signature(s="numeric", n="numeric"), gslrng, includes="#include <gsl/gsl_rng.h>", Rcpp=TRUE, cppargs="-I/usr/include", libargs="-lgsl -lgslcblas") print(funx(0, 5)) Brief notes on this: 1) The character variable gslrng contains valid C++ code. 2) The call to cfunction converts this C++ code into a function that calls it -- and this function is compiled, linked and loaded automagically si...