<div dir="ltr">Hi,<div><br></div><div>The backend of cubature package is the cubature C library from MIT. The same author with nlopt.</div><div><br></div><div>Can you give a little more detail about the double integral?  Cubature should not be that slow from my experience.</div><div><br></div><div>Best,</div><div><br></div><div>KK</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 9, 2015 at 9:38 AM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 9 January 2015 at 15:10, Federico Andreis wrote:<br>
| Dear all,<br>
|<br>
| I was wondering what, in your opinion, would be the best way to handle the<br>
| computation of definite integrals using Rcpp.<br>
|<br>
| To be more precise, I need to evaluate a double integral that turns out to be<br>
| somewhat nasty (really slow computation and presumably inaccurate results using<br>
| the R cubature package).<br>
|<br>
| Should I write the integration algorithm from scratch, or is there any external<br>
| library you would suggest?<br>
|<br>
| I've already found the post on Stackoverflow 'using C function from other<br>
| package in Rcpp' that dealt with an integration problem as well, but it looked<br>
| too general for my problem and also, it's one year old, maybe something else<br>
| has turned up in the meanwhile..<br>
<br>
</div></div>From the top of my head, I think there are several CRAN package doing<br>
something like cubature with related names.  It is not something I use day<br>
to day so maybe somebody else will chime in...<br>
<br>
In general, though, one (easy ?) approach is to solve the problem with<br>
standalone C/C++ code [ possibly entirely outside of of R ] and then learn<br>
(here and elsewhere) how to connect that to R via Rcpp. It is<br>
straightforward.<br>
<br>
Alternatively, and starting from the other end, learn how to access C / C++<br>
code in another package and do it with C++ code from R via Rcpp.<br>
<br>
Or use the middle ground.  There are lots of ways in which Rcpp can help you here.<br>
<br>
Dirk<br>
<span class=""><br>
| Thanks in advance, and congrats for the great work with Rcpp!<br>
|<br>
| /federico<br>
</span>| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Qiang Kou<div><a href="mailto:qkou@umail.iu.edu" target="_blank">qkou@umail.iu.edu</a><br><div>School of Informatics and Computing, Indiana University</div><div><br></div></div></div></div>
</div>