This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / interpolate / _bsplines / _reduce_packed_for_clamp

function

scipy.interpolate._bsplines:_reduce_packed_for_clamp

source: build-install/usr/lib/python3.14/site-packages/scipy/interpolate/_bsplines.py:84

Signature

def _reduce_packed_for_clamp(A_packed, offset, nc, k, y_w, ci, cf)

Summary

Drop boundary rows and the first/last dense columns from a FITPACK packed matrix, returning a smaller packed matrix ready for qr_reduce.

Extended Summary

This is the preprocessing step for the clamped LSQ problem. After the boundary coefficients are pinned (c[0] = ci, c[-1] = cf), the LSQ system reduces to solving for the (nc - 2) free coefficients with the first and last dense rows/columns removed.

The transformation in the packed format:

  • Boundary rows (row 0 and row m-1): contributed only to the pinned coefficients, so we drop them outright.

  • Dense column 0: per the packing formula A_dense[i, j] = A_packed[i, j - offset[i]], cell (i, 0) of the dense matrix sits at packed position 0 of any row where offset[i] == 0. For those rows we shift the packed entries left by one; the trailing slot becomes 0.

  • Dense column nc-1: similarly, cell (i, nc-1) sits at packed position k of any row where offset[i] + k == nc - 1. For those rows we copy only the first k packed entries; the trailing slot becomes 0.

  • Offsets: after dropping dense column 0, the column numbering shifts left by one, so all offsets decrement by 1. The exception is rows whose leftmost cell was the dropped one - their new leftmost cell is at new column 0, so their offset stays 0.

Aliases

  • scipy.interpolate._bsplines._reduce_packed_for_clamp