Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cDbScan::cDbScan(list<cPoint> data, float eps, int minpts)
- {
- while(data.size() > 0)
- {
- list<cPoint> cluster_list;
- cluster_list.push_back(*data.begin());
- data.erase(data.begin());
- for(list<cPoint>::iterator it = cluster_list.begin();it != cluster_list.end();it++)
- {
- for(list<cPoint>::iterator main_it = data.begin();main_it != data.end();main_it++)
- {
- if((*it).dist2(*main_it) < eps*eps)
- {
- cluster_list.push_back(*main_it);
- data.erase(main_it);
- }
- }
- }
- if(cluster_list.size() >= minpts)
- {
- this->push_back(cCluster(cluster_list));
- }
- cluster_list.empty();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement