Skip to content

Commit 2a7c572

Browse files
committed
fix: forgotten the amplitude
1 parent c8a7ff8 commit 2a7c572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/treetime/src/distribution/distribution_convolution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn convolution_range_function(r: &DistributionRange<f64>, f: &DistributionFuncti
9797

9898
for (i, &ti) in shifted_function.t().iter().enumerate() {
9999
let mask = shifted_function.t().mapv(|x| (x - ti).abs() <= width / 2.0);
100-
let filtered_y = f.y() * &mask.mapv(|x| if x { 1.0 } else { 0.0 });
100+
let filtered_y = shifted_function.y() * &mask.mapv(|x| if x { 1.0 } else { 0.0 });
101101
y_out[i] = filtered_y.sum();
102102
}
103103

@@ -293,7 +293,7 @@ mod tests {
293293
let actual = distribution_convolution(&r, &f).unwrap();
294294

295295
let x = array![2.0, 3.0, 4.0, 5.0, 6.0, 7.0];
296-
let y = array![1.0, 1.0, 3.0, 3.0, 3.0, 1.0];
296+
let y = array![2.0, 2.0, 6.0, 6.0, 6.0, 2.0];
297297
let expected = Distribution::function(x, y).unwrap();
298298

299299
assert_eq!(expected, actual);

0 commit comments

Comments
 (0)