A single-cell count matrix in 10x MatrixMarket layout: rows are genes,
columns are cells, stored as coordinate triplets. Counts are held as f64
because scanpy normalizes after promoting the integer matrix to float.
Normalize each cell to target_sum (or the median of totals) then optionally
apply ln(1+x). Mirrors scanpy: a zero-count cell’s scaling factor collapses
to 1, leaving its (empty) row untouched, and the sparsity pattern is exact
because log1p(0) = 0.
Write the matrix back in genes×cells MatrixMarket real coordinate layout,
preserving the input entry order. A big buffer plus ryu float formatting
keeps the matrix-sized write I/O-bound rather than format-bound.