Changed size_t to int32 in similarity matrix computation