From: "Li-Thiao-Té Sébastien" <sayan@crans.org>
To: Jonathan Roewen <jonathan.roewen@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Documentation request: allocation of bigarrays in C
Date: Sat, 01 Apr 2006 16:42:42 +0200 [thread overview]
Message-ID: <442E9162.1080803@crans.org> (raw)
In-Reply-To: <ad8cfe7e0604010230m5f1f4f55tff685eb9e68db762@mail.gmail.com>
Jonathan Roewen wrote:
>>In my case, I want to read a relatively big file (50MB) containing
>>arrays of floats . I use C functions for the raw speed then pass the
>>bigarrays to OCaml to do some reordering of the data, and higher-level
>>processing.
>>
>>I do not open the file in Ocaml then send a string to C for parsing, but
>>rather open the file in C and return the bigarray list to Ocaml. (cf my
>>previous mistake on creating Ocaml lists in C on this mailing-list)
>
> Does Bigarray.X.map_file not serve the purpose?
>
Not really. If I am not mistaken, map_file reads a file into a bigarray
in binary mode. The file format is not as straightforward as that, I
need to parse strings into floats and output a list of bigarrays
embedded in a record with additional info. See the following excerpt :
1796.6221 3
1797.4133 250143
1798.0955 2401147
1799.1106 483314
1799.8252 192082
SPEC#: 2 SIZE: 140 TIME: 16.300000 MSLEVEL: 2 PRECURSOR: 531.552002
156.1387 7265
158.9650 1234
161.0317 2536
162.7167 5898
164.6776 12305
165.7509 4636
166.8494 64993
168.6152 35544
169.3650 1798
FYI, this is data from mass spectrometry experiments.
Regards,
--
Li-Thiao-Té Sébastien
next prev parent reply other threads:[~2006-04-01 14:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-31 14:02 sayan
2006-03-31 17:57 ` [Caml-list] " Dmitry Bely
2006-04-01 10:16 ` Li-Thiao-Té Sébastien
2006-04-01 10:30 ` Jonathan Roewen
2006-04-01 14:42 ` Li-Thiao-Té Sébastien [this message]
2006-04-02 13:56 ` Dmitry Bely
2006-04-02 20:54 ` Li-Thiao-Té Sébastien
2006-04-03 9:24 ` Dmitry Bely
2006-04-03 23:45 ` Nathaniel Gray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=442E9162.1080803@crans.org \
--to=sayan@crans.org \
--cc=caml-list@inria.fr \
--cc=jonathan.roewen@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox