[R] C++ and R
Thomas Lumley
tlumley at u.washington.edu
Wed Jul 10 01:51:34 CEST 2002
On Tue, 9 Jul 2002, Francisco J Molina wrote:
> I am calling C++ from R.
> I want C++ to return a vector whose length is not known when the C++
> routine is called.
>
> Is it possible to do this without using R objects in the C++ routine?
>
> So far I have been using .C, but I do not see how I could use it in this
> case.
It might be possible to break your call into two parts, one where you work
out how large the objects are and one where you do the computation.
Otherwise you can't return objects of unknown size and would need to use
.Call and make an R object to return. It's not as bad as it sounds.
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list