private int SearchMinC(KMeanElement t, int n, ref float dist) { int c = 0; float d = t.Distance(mResults[0].mCenter); for (int i = 1; i < n; i++) { float tmp = t.Distance(mResults[i].mCenter); if (tmp < d) { c = i; d = tmp; } } dist = d; return(c); }
private int SearchMin(KMeanElement t) { float d = float.MaxValue; int c = -1; for (int i = 0; i < mK; i++) { float tmp = t.Distance(mResults[i].mCenter); if (tmp < d) { c = i; d = tmp; } } return(c); }