ilarinieminen / SOM-Toolbox

GNU General Public License v2.0
119 stars 56 forks source link

Don't overwrite sNorm #18

Closed twocs closed 7 years ago

twocs commented 7 years ago

When argument 'method' was a char variable, the argument checking mechanism was initialising sNorm correctly, then overwriting the value of the initialised sNorm with the value of 'method'. The initialisation was correct, and should not get overwritten.

When the modification has been made, calling som_norm_variable(x, 'var', 'do') will return a normalised x as expected. Unfixed, calling som_norm_variable(x, 'var', 'do') will result in an error:

Struct contents reference from a non-struct array object.

Error in som_norm_variable (line 271) (strcmp(operation,'do') && strcmp(sNorm(i).status,'uninit')),