An efficient algorithm for the density-functional theory treatment of dispersion interactions.