Added a branching function for dopair_subset, to switch between naive, serial and vectorised versions.