Antonio Coppola edited C++ Functions.tex  over 9 years ago

Commit id: 16d166faa77ef6c4ebba00ee3ea7b2749e69eebd

deletions | additions      

       

The package supports the implementation of the objective and gradient functions in C++, which may yield significant speed improvements over the respective R implementations. The optimization routine's API accepts both R function objects and external pointers to compiled C++ functions. To perform optimization on the Rosenbrock function, we begin by defining the C++ implementations of the objective and of the gradient as character strings:  \lstset{language=R}   \begin{lstlisting}  objective.include <- 'Rcpp::NumericVector rosenbrock(SEXP xs) {   Rcpp::NumericVector x(xs);