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

Home » Public Forums » archive » behavior of arrays
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: behavior of arrays [message #15553 is a reply to message #15435] Fri, 21 May 1999 00:00 Go to previous messageGo to previous message
Mark Fardal is currently offline  Mark Fardal
Messages: 51
Registered: October 1995
Member
Pavel wrote
> Therefore, seems to me that FLTARR(10, 1) is the same as FLTARR(10) to
> begin with (unlike FLTARR(1, 10))... In the example below, I see no
> loss of information in the transition from d to c...

"The difference between the right word and the almost right word is really
a large matter. It is the difference between the lightning-bug and the
lightning." - Twain

The difference between the right array and the almost right array is
unfortunately also a large matter. You may think that no information
is being lost by dropping the final dimension, but the dimensionality
of the array is itself information. This can mess up matrix
multiplications. Herr Bauer says it can also mess up writing to a
netCDF file. Who knows where else it could matter.

For a concrete example of the first problem, a couple months ago
I posted a way to make CURVEFIT crash. All you have to do is make
a single-parameter fit and mix the type (float/double) of the parameters
in a particular way. So this problem is biting RSI's own programmers,
not just morons like me.

This behavior occurs in part because type promotion routines sometimes
(not always) change the dimensionality of the promoted variable, and
it's awfully hard to anticipate all the situations where a type
promotion could occur. Consider what would happen if the behavior was
reversed, and REFORM sometimes decided to change the type as well as
the dimensionality of a variable. Would that be okay too? After all,
every integer can be represented as a float...

cheers,
Mark Fardal
UMass
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Image thresholding
Next Topic: Re: 3D Puzzle

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

Current Time: Fri Oct 10 22:35:17 PDT 2025

Total time taken to generate the page: 0.71935 seconds