Barycentre calculator for general vector spaces.

Fix #310.