hyperassociative map with distance function parameter