Re: [Rd] lbfgsb from C/C++

2014-09-08 Thread axionator
Ok. Another question: I wanted to use RInternal and compile the following small test example: #include const char* hello( std::string who ) { std::string result( "hello ") ; result += who ; return result.c_str() ; } int main(int argc, char *argv[]) { RInside R(argc,

Re: [Rd] lbfgsb from C/C++

2014-09-08 Thread Prof J C Nash (U30A)
I won't comment on the C/C++ option, as I'm not expert in that. However, R users and developers should know that Nocedal et al. who developed L-BFGS-B released an update to correct a fault in 2011. It was important enough that an ACM TOMS article was used for the announcement. I recently implement

Re: [Rd] lbfgsb from C/C++

2014-09-07 Thread Dirk Eddelbuettel
1) Your question is no longer related to lbfgsb. It is common to start a new thread with a new Subject: for new questions. 2) You do not show your name or affiliation. That is generally frowned upon around here. 3) Your question was about RInside / Rcpp. We prefer those questions over on the

Re: [Rd] lbfgsb from C/C++

2014-09-07 Thread Dirk Eddelbuettel
On 7 September 2014 at 12:30, axionator wrote: | I would like to call R's lbfgsb function from my C/C++ code by including | R_ext/Applic.h and linking against libR. | Currently, I am allocating memory for x (and the other input arrays for | lbfgsb) in my C/C++ code via malloc/new. However, this gi

[Rd] lbfgsb from C/C++

2014-09-07 Thread axionator
Hi, I would like to call R's lbfgsb function from my C/C++ code by including R_ext/Applic.h and linking against libR. Currently, I am allocating memory for x (and the other input arrays for lbfgsb) in my C/C++ code via malloc/new. However, this gives a segmentation fault when executing the program