dot-clamp_weights: Validate diagonal weights

.clamp_weightsR Documentation

Validate diagonal weights

Description

Weights must be finite and non-negative. Entries in ⁠[-rtol * max(abs(w)), 0)⁠ are set to exactly zero with a message; anything below is an error. Every backend sees the same cleaned vector.

Usage

.clamp_weights(w, rtol = .metric_rtol_default(), name = "A")

genpca documentation built on Sept. 17, 2026, 1:09 a.m.