Skip to main content

RowNllProgram

Trait RowNllProgram 

Source
pub trait RowNllProgram<const K: usize>: Send + Sync {
    // Required methods
    fn n_rows(&self) -> usize;
    fn primaries(&self, row: usize) -> Result<[f64; K], String>;
    fn row_nll(
        &self,
        row: usize,
        p: &[Tower4<K>; K],
    ) -> Result<Tower4<K>, String>;
}
Expand description

A family’s row negative log-likelihood written ONCE over tower scalars.

This is the single source of truth #932 asks for: the value channel of the returned tower must BE the production row NLL (same branches, same guards, same numerics), and every derivative channel is then exact by construction. The linear Jacobian wiring (coefficients ↔ primaries) is NOT part of this trait — it is family data, not calculus, and stays on the RowKernel implementor.

Required Methods§

Source

fn n_rows(&self) -> usize

Number of observations the program covers.

Source

fn primaries(&self, row: usize) -> Result<[f64; K], String>

Current primary-scalar values for row (where to seed the tower).

Source

fn row_nll(&self, row: usize, p: &[Tower4<K>; K]) -> Result<Tower4<K>, String>

The row NLL evaluated on tower scalars. p[a] arrives pre-seeded as variable a at the current primary value; implementations combine them with Tower4 arithmetic and per-row data (response, censoring indicators, offsets) entering as constants.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§