Dot product (dot)

Multiply two vectors together using a dot product.

double dot(Rcpp::NumericVector c,Rcpp::NumericVector d)
   {     int nc= c.size();
         double e=0;
         for (int i = 0; i < nc; i++)
         {  e=e+c(i)*d(i); }
         return e;
   }