| 2529 | { |
| 2530 | |
| 2531 | static void generateRandomCenter(const vector<Vec2f>& box, float* center, RNG& rng) |
| 2532 | { |
| 2533 | size_t j, dims = box.size(); |
| 2534 | float margin = 1.f/dims; |
| 2535 | for( j = 0; j < dims; j++ ) |
| 2536 | center[j] = ((float)rng*(1.f+margin*2.f)-margin)*(box[j][1] - box[j][0]) + box[j][0]; |
| 2537 | } |
| 2538 | |
| 2539 | class KMeansPPDistanceComputer : public ParallelLoopBody |
| 2540 | { |