Optimize ToroidSOMMapper (use numpy arrays instead of computing distance one by one)