normalize.linf: L-infinity normalization (row-wise)

View source: R/linf.R

normalize.linfR Documentation

L-infinity normalization (row-wise)

Description

Scales each row of a numeric matrix by its L-infinity norm (row maximum). Rows whose maximum is zero (or below tolerance) are left unchanged and remain all-zero.

Usage

normalize.linf(X, tol = 0, backend = c("auto", "dense", "sparse"))

Arguments

X

Numeric matrix (samples x features).

tol

Numeric >= 0. Values with row max <= tol are treated as zero rows. Default: 0 (exact zero only).

backend

Character. Matrix backend to use: "auto", "dense", or "sparse". The default "auto" preserves sparse input and otherwise uses the dense path.

Details

Zero rows have undefined L-infinity direction. By convention, they are preserved as all-zero rows and will yield NA labels in downstream dominant-feature or dCST assignment.

Value

Numeric matrix of same dimensions as X, L-infinity normalized.


linf documentation built on Aug. 5, 2026, 9:08 a.m.