comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: minor glitch in total()

minor glitch in total()
type: item
description: 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
creator: t.osborn
date: 2003-08-01T14:50:29-00:00