minor glitch in total() [message #35835] |
Fri, 01 August 2003 07:50 |
t.osborn
Messages: 6 Registered: July 1995
|
Junior Member |
|
|
Dear all,
A colleague of mine has come across a small bug with the total()
function in IDL, when using it with the /cumulative option and a
dimension specified when the array is only one-dimensional.
IDL> a=findgen(100,100)
IDL> b=total(a)
IDL> b=total(a,1)
IDL> b=total(a,/cumulative)
IDL> b=total(a,/cumulative,1)
IDL>
IDL> a=findgen(100)
IDL> b=total(a)
IDL> b=total(a,1)
IDL> b=total(a,/cumulative)
IDL> b=total(a,/cumulative,1)
Segmentation fault (core dumped)
As you will see, total() works fine without the /cumulative option, or
with a 2-dimensional array or without specifying a dimension to sum.
But when /cumulative is specified for a 1-D array and the dimension to
sum over is specified to be 1, then it core dumps. I can replicate
this fault.
We can, of course, simply remove the dimension number in this case,
since it makes no difference when the input array is only 1-D - but
making generic functions that works with a range of input
sizes/dimensions would be simpler if bugs like this weren't there -
certainly it shouldn't ever core dump!
Is this something that is specific to our platform (OSF alpha) or
version?
Cheers
Tim
|
|
|