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

Home » Public Forums » archive » minor glitch in total()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
minor glitch in total() [message #35835] Fri, 01 August 2003 07:50
t.osborn is currently offline  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
[Message index]
 
Read Message
Previous Topic: Re: String Data file
Next Topic: possible bug in a_correlate()

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

Current Time: Wed Oct 08 18:43:53 PDT 2025

Total time taken to generate the page: 0.02019 seconds