celestialgod

Rcpp call R optim (C++ code part)

Oct 21st, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. // [[Rcpp::depends(RcppArmadillo)]]
  2. #include <RcppArmadillo.h>
  3. #include <string>
  4.  
  5.  
  6. // [[Rcpp::export]]
  7. Rcpp::List optim_cpp(Rcpp::Function obj_f, Rcpp::Function grad,
  8.                     const arma::vec& initValue, const std::string& method) {
  9.   Rcpp::Function Roptim("optim");
  10.   return(Roptim(Rcpp::wrap(initValue), obj_f, grad, Rcpp::_["method"] = method));
  11. }
Add Comment
Please, Sign In to add comment