Gradient Descent in R/Rcpp/RcppArmadillo