(&mut self, ppos: usize, neighbours: Vec<usize>)
| 81 | } |
| 82 | |
| 83 | fn expand_cluster(&mut self, ppos: usize, neighbours: Vec<usize>) { |
| 84 | let c = self.c; |
| 85 | self.set_cluster(ppos, c); |
| 86 | |
| 87 | let mut q = neighbours.clone(); |
| 88 | while q.len() > 0 { |
| 89 | let pp = q.pop().unwrap(); |
| 90 | if !self.visited(pp) { |
| 91 | self.visit(pp); |
| 92 | let neighbours = self.neighbours(pp); |
| 93 | if neighbours.len() >= self.minpts { |
| 94 | for n in neighbours { |
| 95 | q.push(n); |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | if self.get_cluster(pp) == -2 { |
| 100 | self.set_cluster(pp, c); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 |
no test coverage detected