Skip to main content

built_workspace_bytes

Function built_workspace_bytes 

Source
fn built_workspace_bytes(
    rows: usize,
    runs: usize,
    fields: usize,
) -> Result<usize>
Expand description

An upper bound of the bytes a GridSeriesBuilder allocates for a result of fields float fields whose positions are a subset of rows positions making up runs runs.

For a result of kept rows in split runs, the builder’s row indices and each field’s values grow by doubling, so each holds at most 2 * kept + 4 entries, and finishing turns each run into a span the axis copies once. Dropping one position splits at most one run in two, so split <= min(kept, runs + rows - kept), and the bound is the larger of the two ends of that region. A caller that cannot say the result’s positions are the input’s passes runs = rows.