Ewald type summation method for electrostatic interactions in computer simulations of a three-dimensional system periodic in one direction