comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » What are the rules for automatic removal of singleton dimensions, and can I have a way of disabling them, please?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: What are the rules for automatic removal of singleton dimensions, and can I have a way of disabling them, please? [message #82644 is a reply to message #82553] Wed, 26 December 2012 06:12 Go to previous messageGo to previous message
tom.grydeland is currently offline  tom.grydeland
Messages: 51
Registered: September 2012
Member
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. I would happily accept indexing that raised exceptions on nonexistent dimensions, if I could rely on the dimensions not disappearing when I didn't ask for it.

A related and tangential question for the IDL internals wizards: Can the evaluator distinguish between single-valued indexes and a single-element range index? I.e. can it tell the difference between a[*,0] and a[*,0:ii] when ii eq 0?

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

--T
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Undocumented behavior of TRANSPOSE
Next Topic: Putting an overbar on text in a plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 05:56:01 PST 2025

Total time taken to generate the page: 2.72339 seconds