## ~mht/cra

bae1de7fcfbd2d5878884b2271f21df3fee32fea — Martin Hafskjold Thoresen 1 year, 3 months ago
```Remove _by_dim suffix.

This was used for almost all keys, making it very annoying
```
```1 files changed, 32 insertions(+), 32 deletions(-)

M src/log.rs
```
`M src/log.rs => src/log.rs +32 -32`
```@@ 48,21 48,21 @@ pub struct Aggregate {

/// The number of adds required to reduce a simplex, by dimension.
/// The average number of additions required to reduce a simplex, by dimension.

/// The size of a simplex when we add them to reduce the first.
/// Average of the sizes.
/// Histogram of the sizes
-    histogram_add_size_by_dim: HashMap<isize, HashMap<usize, (usize, usize)>>,
+    histogram_add_size: HashMap<isize, HashMap<usize, (usize, usize)>>,

/// The sum of sizes of simplices when we reduce

num_simplices: HashMap<isize, usize>,
}

@@ 86,7 86,7 @@ impl<'a> Reduction<'a> {
}

let mut num_simplices = HashMap::new();
-        for (&j, &dim) in simplices2dim.iter() {
+        for &dim in simplices2dim.values() {
*num_simplices.entry(dim).or_insert(0) += 1;
}

@@ 97,45 97,45 @@ impl<'a> Reduction<'a> {
}
}

-        let mut adds_required_by_dim = HashMap::new();
+        let mut adds_required = HashMap::new();
let mut count = HashMap::new();
for r in self.reductions.iter() {
*count.entry(r.dim).or_insert(0) += 1;
}

for (&k, &c) in count.iter() {
}

-        let mut add_size_by_dim = HashMap::<isize, Vec<(usize, usize)>>::new();
+        let mut add_size = HashMap::<isize, Vec<(usize, usize)>>::new();
for r in self.reductions.iter() {
continue;
}
v.push((a.this_size, a.other_size));
}
}

-        let mut avg_add_size_by_dim = HashMap::new();
+        let mut avg_add_size = HashMap::new();
continue;
}
let avg_f = adds.iter().map(|(f, _s)| *f).sum::<usize>() as f64 / adds.len() as f64;
let avg_s = adds.iter().map(|(_f, s)| *s).sum::<usize>() as f64 / adds.len() as f64;
}

-        let mut histogram_add_size_by_dim = HashMap::new();
+        let mut histogram_add_size = HashMap::new();
for r in self.reductions.iter() {
continue;
}
-            let histogram: &mut HashMap<usize, (usize, usize)> = histogram_add_size_by_dim
+            let histogram: &mut HashMap<usize, (usize, usize)> = histogram_add_size
.entry(r.dim)
.or_insert(HashMap::new());

@@ 144,32 144,32 @@ impl<'a> Reduction<'a> {
}
}

-        let mut add_cost_by_dim = HashMap::<isize, Vec<usize>>::new();
+        let mut add_cost = HashMap::<isize, Vec<usize>>::new();
for r in self.reductions.iter() {
continue;
}
v.push(a.this_size + a.other_size);
}
}

-        let mut avg_add_cost_by_dim = HashMap::new();
+        let mut avg_add_cost = HashMap::new();
continue;
}
}

-        let mut histogram_add_cost_by_dim = HashMap::new();
+        let mut histogram_add_cost = HashMap::new();
for r in self.reductions.iter() {
continue;
}
-            let histogram: &mut HashMap<usize, usize> = histogram_add_cost_by_dim
+            let histogram: &mut HashMap<usize, usize> = histogram_add_cost
.entry(r.dim)
.or_insert(HashMap::new());

@@ 179,14 179,14 @@ impl<'a> Reduction<'a> {

Aggregate {