Skip to content

Commit

Permalink
Correct spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
minshao committed Dec 4, 2024
1 parent 8aee6fa commit 9e3ccd0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/optics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct Optics<A, M> {
pub metric: M,

ordered: Vec<usize>,
reacheability: Vec<A>,
reachability: Vec<A>,
neighborhoods: Vec<Neighborhood<A>>,
}

Expand All @@ -56,7 +56,7 @@ where
min_samples: 5,
metric: Euclidean::default(),
ordered: vec![],
reacheability: vec![],
reachability: vec![],
neighborhoods: vec![],
}
}
Expand All @@ -74,7 +74,7 @@ where
min_samples,
metric,
ordered: vec![],
reacheability: vec![],
reachability: vec![],
neighborhoods: vec![],
}
}
Expand All @@ -88,7 +88,7 @@ where
let mut clusters: HashMap<usize, Vec<usize>> = HashMap::new();

for &id in &self.ordered {
if self.reacheability[id].is_normal() && self.reacheability[id] <= eps {
if self.reachability[id].is_normal() && self.reachability[id] <= eps {
if clusters.is_empty() {
outliers.push(id);
} else {
Expand Down Expand Up @@ -130,7 +130,7 @@ where
};
let mut visited = vec![false; input.nrows()];
self.ordered = Vec::with_capacity(input.nrows());
self.reacheability = vec![A::nan(); input.nrows()];
self.reachability = vec![A::nan(); input.nrows()];
for (idx, n) in self.neighborhoods.iter().enumerate() {
if visited[idx] || n.neighbors.len() < self.min_samples {
continue;
Expand All @@ -142,7 +142,7 @@ where
&self.metric,
&self.neighborhoods,
&mut self.ordered,
&mut self.reacheability,
&mut self.reachability,
&mut visited,
);
}
Expand All @@ -158,7 +158,7 @@ fn process<S, A, M>(
metric: &M,
neighborhoods: &[Neighborhood<A>],
ordered: &mut Vec<usize>,
reacheability: &mut [A],
reachability: &mut [A],
visited: &mut [bool],
) where
A: FloatCore,
Expand All @@ -183,7 +183,7 @@ fn process<S, A, M>(
visited,
metric,
&mut seeds,
reacheability,
reachability,
);
while let Some(s) = seeds.pop() {
if visited[s] {
Expand All @@ -202,7 +202,7 @@ fn process<S, A, M>(
visited,
metric,
&mut seeds,
reacheability,
reachability,
);
}
}
Expand All @@ -225,7 +225,7 @@ fn update<S, A, M>(
if visited[o] {
continue;
}
let reachdist = reacheability_distance(o, id, input, neighborhood, metric);
let reachdist = reachability_distance(o, id, input, neighborhood, metric);
if !reacheability[o].is_normal() {
reacheability[o] = reachdist;
seeds.push(o);
Expand Down Expand Up @@ -278,7 +278,7 @@ where
.collect()
}

fn reacheability_distance<S, A, M>(
fn reachability_distance<S, A, M>(
o: usize,
p: usize,
input: &ArrayBase<S, Ix2>,
Expand Down

0 comments on commit 9e3ccd0

Please sign in to comment.