Dave Goel wrote:
> 
> 
>> 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++.
> 
> I am including here an m-version, tested, and also attaching it.  But,
> really, I stand by my last post.  Why re-implement the wheel?  We
> should simply use the exact same logic and facilities used by
> tmpcumsum.

The MX_CUMULATIVE_OP and MX_ND_CUMULATIVE_OP macros from 
liboctave/mx-inlines.cc both use a line something like

  prev_val = prev_val OP elem (iter_idx);

where as for cummax you'd need that to read

  prev_val = FN (prev_val, elem (iter_idx));

where FN is the max function for cummax or the min function for cummin. 
So yes although the modification to Octave itself is small to allow the 
use of these existing macros to do the job, there is still a change 
needed or a new macro created.

D.
-- 
David Bateman                                [EMAIL PROTECTED]
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

-------------------------------------------------------------------------
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