Sum a vector (sumv)

This is the same as the R function sum when used on a vector.

double sumv(Rcpp::NumericVector A)
   {    int na= A.size();
         double b=0;
         for (int i = 0; i < na; i++)
         { b=b+A(i);
         }
         return b;
   }