MathGroup Archive 1998

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

Search the Archive

Binary Files

  • To: mathgroup at
  • Subject: [mg13904] Binary Files
  • From: Jason Gill <jgill at>
  • Date: Sun, 6 Sep 1998 02:55:41 -0400
  • Organization: IBM Microelectronics
  • Sender: owner-wri-mathgroup at

    I am using the following function to read binary files.  I would not
consider the data files very large, and yet the process is extremely
slow.  I am running Mathematica 3.0 for win95.  I have installed the
MathLink program FastReadBinary Files, which help a ton, but it is
still to slow.  The net is I use this function on multiple files to
create a three dimensional data matrix with Dimensions on the order of
[6,1000,300].  Mathematica handles the data O.K., once loaded but the
loading takes to long.  For the aforementioned matrix,  loading the
files can take upwards of 15 minutes.  Which seems excessie to me.
 Using the timming function, the largest consumer of time is the actual
binary read. Does anyone have any suggestions? I also have access to
Mathematica (3.0)  running on an RS/6000 is there a Mathlink equivalent
to Fast Read Binary available for this platform? Any suggestions would
be greatly appreciated.


directory=SetDirPath /. {opts} /. Options[ReadandConvertLMX];
  inline = OpenReadBinary[filename];
data=Take[Partition[data,4],(modules*parameters)]; Close[inline];
convert6 = Compile[{b1, b2, b3, b4},  If[b1 < 128,
    (b2*256^2+b3*256+b4)/256^3  16^(b1-64),
         -(b2*256^2+b3*256+b4)/256^3 16^(b1-192)]]; ResetDirectory[];

Jason Gill
IBM Microelectronics
Essex Junction, VT 05452
Phone   (802)769-3350
Fax     (802)769-1220
email:  jgill at

  • Prev by Date: Vectors (other problem)
  • Next by Date: RE: Structure modification and related questions
  • Previous by thread: Re: Vectors (other problem)
  • Next by thread: Re: Binary Files