octave-maintainers
[Top][All Lists]
Advanced

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

Re: problem with sum (...)


From: David Bateman
Subject: Re: problem with sum (...)
Date: Tue, 06 Nov 2007 09:26:22 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Ben Abbott wrote:
>
> On Nov 5, 2007, at 9:28 PM, Ben Abbott wrote:
>
>>
>> On Nov 5, 2007, at 10:16 AM, David Bateman wrote:.
>>>
>>> I don't see why matlab should produce an error here.. Adding character
>>> values should be legal, though perhaps a dumb thing to do.. Equally I
>>> don't see why matlab  chose to limit this argument only to the "sum"
>>> function and not also include the "cumsum", "prod", etc functions as
>>> well. In any case consider the attached patch that adds this
>>> functionality to "sum".. Perhaps the other data reduction operators
>>> should also include this functionality?
>>
>> I'm also bewildered why Mathworks didn't include the 'native' option
>> for other functions ... even more confusing to me is why 'native'
>> isn't the default.
>>
>> I have no opinion on providing this functionality to the other
>> functions in Octave.
>>
>> I'm attempting to apply the patch and compile (I'm new to this) ...
>> I'll not have a chance to check on its success until morning.
>> However, your examples produced identical results under Matlab 7.3.0.
>
> Having thought about this further ... isn't the idea of
> prod(x,'native') equivalent to all(x)?
And prod (uint8(1:4),'native') ?


>
> Regarding cumsum/cumprod, each of these already have optional second
> arguments;  ex: cumsum(x, DIM).  So the addition of another optional
> argument is a bit problematic.
So does sum, you can do sum(x, DIM, 'native') or sum(x,'native') with
the patch I sent..

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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