When mode="complete", the function returns a square matrix which
dimensions are equal to the product of the grid dimensions.When mode="neighbors", the function returns a list which length is equal
to the product of the grid dimensions; the length of each item is equal to the
number of neighbors. Neurons are considered to have 8 neighbors at most
(i.e., two neurons are neighbors if they have a distance of type
'maximum' which is equal to 1).
Details
When mode="complete", distances between all prototypes are computed.
When mode="neighbors", distances are computed only between the
prototypes and their neighbors. If the data were preprocessed during the SOM
training procedure, the distances are computed on the normalized values of the
prototypes.