Function sum

Return the sum of elements in a vector.