Set k to MIN(k, #non_zero_singular_values)