NLA-lib Explorer

NLAlib.sumLargest

Library · def

The sum of the k largest entries of a real vector, S_k(\mathbf{x}): the maximum of \sum_{i \in s} \mathbf{x}_i over index sets s with \min(k, \lvert \iota \rvert) elements. For k at least the number of entries it is the total sum. No sorting is involved. [HornJohnson2013, §4.3.47].

NLAlib.sumLargest.{u_1} {ι : Type u_1} [Fintype ι] (x : ι → ℝ) (k : ℕ) : ℝ

Full source on GitHub

Import NLAlib.Matrix.Majorization.Basic.