On the efficient evaluation of torques and forces for anisotropic potentials in computer simulation of liquids composed of linear molecules