sumk

sumk implements an operator which returns the sum of the k largest values of a vector, or sum of k largest eigenvalues of a positive definite matrix. A weighted sum is also possible, with a non-increasing non-negative weight vector p.

Syntax

y = sumk(x,k)
y = sumk(x,k,p)

Operator implementation

The operator is implemented using a linear programming based graph model for the vector case, and a semidefinite programming based graph model for the symmetric matrix case.