Solved: Packed array generation and complex numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg31981] Solved: Packed array generation and complex numbers
- From: Martin Johansson <martin.n.johansson at emw.ericsson.se>
- Date: Fri, 14 Dec 2001 16:53:13 -0500 (EST)
- Organization: Ericsson Microwave Systems AB
- References: <9ul29u$6lr$1@smc.vnet.net> <9uq7g6$abh$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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