octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reduction funs optimizations + min/max question


From: Jaroslav Hajek
Subject: Re: reduction funs optimizations + min/max question
Date: Tue, 17 Feb 2009 11:53:54 +0100

On Tue, Feb 17, 2009 at 11:31 AM, Søren Hauberg <address@hidden> wrote:
> tir, 17 02 2009 kl. 08:56 +0100, skrev Jaroslav Hajek:
>> Well, it would take some work, but seems relatively straightforward.
>
> I would consider this a very low-priority task. I was mainly asking
> because if it was nothing more than a few lines of code, then these
> functions would be nice to have. But I'm guessing that these functions
> would only be used rarely.
>

Well I just discovered that R has these functions, and I realized I
may have use for them myself:
I need to deal with data that are expected to be monotonic (or
unimodal) - the lift curve of an airfoil.
Right now, my software only warns like "multiple maxima detected.
Check your data"
and proceeds. It's surely better to do "multiple maxima detected.
Unimodality forced".

cummin/cummax seems an easy tool to force monotonicity to a certain vector.

>> We'd need to settle on a specification, though.
>> So, my idea:
>> y = cummax (x, dim);
>> returns cumulative maximum along dimension dim. If dim is omitted,
>> operates along the first non-singleton dimension.
>> [y, i] = cummax (x);
>> returns also cumulative maximum indices.
>> cummin is analogical.
>
> This seems like the obvious choice.
>
>> So, the question is: Is it worth doing this for 3.2?
>
> I'd consider this low priority.
>
>> It seems to me that this function cannot be reasonably simulated in
>> m-code without using a loop or sacrificing the O(N) complexity. Can
>> anyone elaborate on expected usage?
>
> I cannot remember the expected usage. I could probably see some uses of
> such functions in image analysis, where you easily work with large
> matrices, in which a loop implementation would be too slow to be of any
> use.
>
> Søren
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]