On Fri, 16 Sep 2011 22:16:59 +0200, Timon Gehr <timon.g...@gmx.ch> wrote:

I suggest:

* Introduce the algorithm "extremum" with a required predicate.

What would that do? The range has more than one extremum if it is non-constant.

extremum!"a<b"([1,2,3,1,2,3]) would be equal to [1,1].


* Introduce extremumCount and extremumPos, both with required predicate.

And those will be minCount+maxCount and merge(minPos,maxPos) ?

Nope.
    extremumCount!"a<b"([1,2,3,1,2,3]) == 2.
    extremumPos!"a>b"([1,2,3,1,2,3]) == [3,1,2,3].


* Keep minCount and minPos without a predicate. They'd in all likelihood
use extremum.

How?

alias extremumCount!"a<b" minCount;
alias extremumPos!"a<b" minPos;

--
  Simen

Reply via email to