dot function

Compute the dot product of two vectors