MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Solved: Packed array generation and complex numbers


OK, 

as pointed out, the execution time "anomaly" can
be explained by some of the arguments being packed
arrays.

The remaining question was then why some of the
arguments became packed arrays, and some not.

In private conservation, Sseziwa Mukasa suggested
it had to do with 'I' being an infinite precision
number. This turns out to be correct:

<<Developer`
n=2^10;
PackedArrayQ[Table[Random[],{i,n}]+(I//N) 1]
PackedArrayQ[(I//N) Table[Random[],{i,n}]]
PackedArrayQ[1+ Table[(I//N)Random[],{i,n}]]

Out[2]=True
Out[3]=True
Out[4]=True

So, by first calculating a floating-point 'I',
all results become packed arrays (and I save a
lot of time).

Ciao, Martin

-- 
Martin Johansson, Ph.D.
Senior Specialist
Advanced Base Station Antennas
m.johansson at ericsson.com


  • Prev by Date: Functions with Options
  • Next by Date: Re: restrictions on parameter
  • Previous by thread: ShowProgress in NonlinearFit
  • Next by thread: Re: restrictions on parameter