Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

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


  • 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