Direct partition function of the rigid diatomic rotor