nexus-stats-detection 2.0.0

Advanced change detection and signal analysis for nexus-stats
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use nexus_stats_core::math::{exp, ln};

#[inline]
pub fn ln_inplace(buf: &mut [f64]) {
    for v in buf.iter_mut() {
        *v = ln(*v);
    }
}

#[inline]
pub fn exp_sum(buf: &[f64], offset: f64) -> f64 {
    let mut sum = 0.0;
    for &v in buf {
        sum += exp(v - offset);
    }
    sum
}