Skip to main content

residuals_compiled_indexed_into

Function residuals_compiled_indexed_into 

Source
pub fn residuals_compiled_indexed_into(
    cg: &CompiledGraph,
    node_params: &[Vec<f64>],
    x: &[f64],
    y: &[f64],
    sigma: &[f64],
    out: &mut [f64],
) -> Result<(), CoreError>
Expand description

Compute weighted residuals r[i] = (ŷ[i] − y[i]) / σ[i] into out using pre-computed per-node parameter buffers. Honours per-node dataset_index scoping for simultaneous multi-dataset fits (a no-op for single-dataset / fully-global graphs).

§Errors

Returns CoreError::Eval if: x.len() is not an exact multiple of the graph’s coordinate dimensionality (GraphError::XBufferStrideMismatch); the graph’s nodes disagree on n_dims (GraphError::DimensionalityMismatch); out, y, or sigma does not have exactly one entry per point (GraphError::OutputBufferShape); or, when multi-dataset scoping is active, a node’s dataset_index is out of range (GraphError::DatasetIndexOutOfRange).