- struct entries *
**randinit_codes**(struct entries **data*, int*topol*, int*neigh*, int*xdim*, int*ydim*) - Creates a random codebook.
Returns a ready to use codebook.
- struct entries *
**lininit_codes**(struct entries **data*, int*topol*, int*neigh*, int*xdim*, int*ydim*) - Creates a linearly initialized codebook. Codebook vectors lie in
the plane defined by the mean and the two largest eigenvectors
of
*data*. Returns a ready to use codebook.

- float
**hexa_dist**(int*bx*, int*by*, int*tx*, int*ty*) - Calculates distance of two map units when using hexagonal topology.
- float
**rect_dist**(int*bx*, int*by*, int*tx*, int*ty*) - Calculates distance of two map units when using rectangular topology.

- void
**bubble_adapt**(struct teach_params **teach*, struct data_entry **sample*, int*bx*, int*by*, float*radius*, float*alpha*) - Adaptation function for bubble-neighborhood.
- void
**gaussian_adapt**(struct teach_params **teach*, struct data_entry **sample*, int*bx*, int*by*, float*radius*, float*alpha*) - Adaptation function for gaussian neighborhood.

- struct entries *
**som_training**(struct teach_params **teach*) - Train a SOM. Radius of the neighborhood decreases linearly from
the initial value to one and the learning parameter decreases
linearly from its initial value to zero. All parameters are
taken from
*teach*(see**Customizing SOM/LVQ_PAK**for more information).

- float
**find_qerror**(struct teach_params **teach*) - Calculates quantization error.
- float
**find_qerror2**(struct teach_params **teach*) - Calculates quantization error in a different way. Instead of
only calculating the difference between the winning codebook
vector and the data vector also the quantization error with
other vectors in the neighborhood is calculated weighted with
the neighborhood function.
- float
**bubble_qerror**(struct teach_params **teach*, struct data_entry **sample*, int*bx*, int*by*, float*radius*) - Calculates quantization error over the neighborhood of the
winning entry.
- float
**gaussian_qerror**(struct teach_params **teach*, struct data_entry **sample*, int*bx*, int*by*, float*radius*) - Calculates quantization error over the neighborhood of the
winning entry.

- void
**normalize**(float **v*, int*n*) - Normalizes an array of floats (
*v*).*N*is the length of the array. - float
**dotprod**(float **v*, float **w*, int*n*) - Calculated the dot product of two vectors (float arrays
*v*and*w*). Length of vectors is*n*. - int
**gram_schmidt**(float **v*, int*n*, int*e*) - Has something to do with finding the eigenvectors, I guess.
- struct data_entry *
**find_eigenvectors**(struct entries **data*) - Finds eigenvectors of
*data*. Returns a pointer to a list of three*data_entry*s: first is the mean, second is the first eigenvector and third is the second eigenvector. The*next*-field in the*data_entry*-structure points to the next entry. - int
**set_som_params**(struct teach_params **params*) - Sets some SOM specific stuff in the
*params*if they aren't set already. Sets the*mapdist*and*neigh_adapt*functions according to the flags in*params*.