One of the tuple entries is the number by which I'd like to sort, so the
score_func is trivial. However, in the end I want not only the minimum
value, but also the additional tuple elements, which would be stripped off
by the score_func.

-erik

On Tue, Dec 1, 2015 at 12:38 PM, Josh Langsfeld <[email protected]> wrote:

> Doesn't 'min' imply/require the usage of '<' ? A whole lot of methods
> would need the extra argument added for consistency, including min,
> minimum, maximum, etc...
>
> Could a workable solution be to define a function that maps a tuple to a
> real number instead of a comparison function and do
> 'findmin(map(score_func, my_tuples))' ?
>
> On Tuesday, December 1, 2015 at 12:20:53 PM UTC-5, Júlio Hoffimann wrote:
>>
>> The issue on GitHub: https://github.com/JuliaLang/julia/issues/14216
>>
>> Thanks,
>> -Júlio
>>
>> 2015-12-01 8:57 GMT-08:00 Dan <[email protected]>:
>>
>>> suggestion: call the named argument `lt` to match the argument of `sort`.
>>>
>>>
>>> On Tuesday, December 1, 2015 at 6:23:07 PM UTC+2, Júlio Hoffimann wrote:
>>>>
>>>> Hi Erik,
>>>>
>>>> What I meant was a derived type from Julia's Tuple type. Though I agree
>>>> with you that this may be too much of an overhead for such a simple task.
>>>>
>>>> I'll open an issue on GitHub to ask if others are ok with an additional
>>>> predicate option a la C++:
>>>>
>>>> findmin(array, pred=<)
>>>>
>>>> If they are all positive, I'll add it for you.
>>>>
>>>> Best,
>>>> -Júlio
>>>>
>>>
>>


-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to