Class to compute dot product