| Re: What are the rules for automatic removal of singleton dimensions, and can I have a way of disabling them, please? [message #82641 is a reply to message #82553] |
Wed, 26 December 2012 15:12   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den onsdagen den 26:e december 2012 kl. 15:12:35 UTC+1 skrev Tom Grydeland:
> On Wednesday, December 26, 2012 10:25:09 AM UTC+1, Mats Löfdahl wrote:
>
>> I thought the idea with the stripping of dimensions was that it shouldn't matter whether these dimensions are there or not. I mena, you can still address a[2,2,0] when a=fltarr(5,5). So shouldn't the fix really be to make total() work for non-existing trailing dimensions?
>
> In my mind, the fix is to make things behave _less_ arbitrarily, not _more_ so.
So then we agree.
>> (Or, if just to make your code less messy, to write a mytotal() function that takes care of the exceptions.)
>
> That solution is worse than the problem, IMO. How many other functions will I have to replace?
How would I know? Total() is the only one you mentioned...
|
|
|
|