(&mut self)
| 55 | } |
| 56 | |
| 57 | pub fn compute(&mut self) -> Vec<isize> { |
| 58 | |
| 59 | for (idx, _p) in self.data.iter().enumerate() { |
| 60 | if !self.visited(idx) { |
| 61 | self.visit(idx); |
| 62 | let neighbours = self.neighbours(idx); |
| 63 | if neighbours.len() < self.minpts { |
| 64 | self.noise(idx); |
| 65 | } else { |
| 66 | self.c += 1; |
| 67 | self.expand_cluster(idx, neighbours); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | self.cluster.clone() |
| 72 | } |
| 73 | |
| 74 | fn set_cluster(&mut self, pos: usize, c: isize) { |
| 75 | let cl = self.cluster.get_mut(pos).unwrap(); |
no test coverage detected