Theory of vibrational energy transfer among diatomic molecules in inert matrices