gamlss-spline 0.2.1

Spline bases, penalties, and metadata for GAMLSS modeling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Predictor blocks that can expose a sparse row basis without allocation.
///
/// Implementations call `f(index, weight)` once for each non-zero basis value
/// in the requested row. The coefficient order is the same order used by
/// `PredictorBlock::eta_row`.
pub trait SplineRowBasis {
    /// Number of observations.
    fn nrows(&self) -> usize;

    /// Number of coefficients consumed by this basis.
    fn nparams(&self) -> usize;

    /// Visits non-zero basis values for `row`.
    fn for_each_row_basis(&self, row: usize, f: impl FnMut(usize, f64));
}