backshift 0.2.1

ARIMA models fitted by exact maximum likelihood, with a streaming filter that runs without a heap
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Carving caller-owned scratch into named buffers, so heap-free code can take its
//! working memory from one slice.

/// Splits the first `len` values off `buffer` and leaves the rest in it.
///
/// # Panics
///
/// Panics if `buffer` holds fewer than `len` values.
pub(crate) fn take<'a>(buffer: &mut &'a mut [f64], len: usize) -> &'a mut [f64] {
    let (head, tail) = core::mem::take(buffer).split_at_mut(len);
    *buffer = tail;
    head
}