-----Original Message-----

Søren Hauberg <[EMAIL PROTECTED]> writes:

> tor, 30 10 2008 kl. 17:05 -0400, skrev Dave Goel:
>> There seems to be no easy way to achieve a cummax (a simple O(n)
>> operation) while avoiding loops.  There are some ways to achieve
>> it[1], but they all end up being > O(n). 
>
> Yeah, I can't come up with anything of the top of my head. But I'll make
> you a deal. If you write an m-file version using for-loops, that handle
> the N-dimensional case, then I'll re-implement it in C++.


Thanks ^_^

Why not just simply use the same logic that cumsum uses: call

MX_CUMULATIVE_OP (ComplexMatrix, Complex, +=)

With, instead of +=, an equivalent of max?  If the latter is not
possible, then, we can simply duplicate this function with the new
function written so as to permit a max entry.  

I could send you a m-version back, and maybe in the next email, will..
but doesn't it make more sense to re-use the same logic that cumsum
and cumprod use?


- Dave

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to