Re: Packed array and ReadList
- To: mathgroup at smc.vnet.net
- Subject: [mg41500] Re: Packed array and ReadList
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 23 May 2003 03:24:53 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <baib30$dm3$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, MathLink typical send the data to the Kernel as a packed array the the kernel won't unpack it. So you should write a MathLink program ... Regards Jens "Bruyndonckx P." wrote: > > I have a very large text file with real numbers. I would like to read this numbers and store them in a packed array. > My computer has sufficient memory to store all numbers in a packed array form. However, when I try something like > ToPackedArray[Readlist[filename,Real]], Mathematica uses much more memory during the process. Hence I assume the > numbers are first stored in a normal list and the packed. > > Is there a way to read a file of numbers directly into a packed array ? Since I am specifying that file file just > contains numbers, I expected that Mathematica (4.2) would store the result of the ReadList commando in a packed array > without me telling it to do so. But it doesn't (PackedArrayQ gives false) and I have to add the ToPackedArray > commando myself. > > Peter