[MATRIX-SIG] Possible bug in Numeric LoadArray function

Rob Managan managan@llnl.gov
Thu, 8 Jan 1998 12:51:46 -0800


Bill White wrote
>> 1.) Define a language for describing numeric representations.  This
>>     could be as simple as a bit string, with k bit fields to store
>>     the sizes of the various sized integers, a field to store a
>>     token to represent the floating point representation, and whatever
>>     else needs to be done.


Konrad Hinsen wrote
>RPC uses the XDR library, like netCDF and probably others. XDR uses
>IEEE format for floats, so it's fast on IEEE machines and slow on
>others. That sounds like a good solution to me, since non-IEEE
>machines seem to be disappearing, but I am sure this could generate
>some flame mails ;-)
>--

The PDBlib file format which is part of LLNL's PACT system has a way to
specify the numeric representation. They also have general conversion
routines. Those may be more than needed here. PDBlib defaults to storing in
the local native format so that reads and writes are fast if not changing
platforms. Conversions do occur when a file is moved to different platform.
Here is what is stored to define integers and floats

Define a primitive integral type (fixed point type) in the PDB file file.
Input: file, a pointer to a PDBfile,
       name, an ASCII string containing the name of the new data type,

       bytespitem, the number of bytes required for 1 item of the new type,

       align, the byte alignment for the type,

       flg, a flag indicating whether the byte ordering of the type is normal
            or reverse ordered (NORMAL_ORDER or REVERSE_ORDER).

Define a new floating point type to the PDB file file.
Input: file, a pointer to a PDBfile,
       name, an ASCII string containing the name of the data type in the
PDB file,

       bytespitem, the number of bytes required for an item of the new type,

       align, the byte alignment for this type,

       ordr, an array of bytespitem integers specifying the byte order,

       expb, the number of exponent bits,

       mantb, the number of mantissa bits,

       sbs, the position of the sign bit,

       sbe, the starting bit of the exponent,

       sbm, the starting bit of the mantissa,

       hmb, the value of the high order mantissa bit,

       bias, the bias of the exponent.

*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-
Rob Managan       mailto://managan@llnl.gov
LLNL                      ph:  510-423-0903
P.O. Box 808, L-183       FAX: 510-423-5804
Livermore, CA  94551-0808




_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________