Self organising map

Update of Sebastien Campion's pull request, as discussed in #2892