caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel Andor <da209@cam.ac.uk>
To: caml-list@inria.fr
Subject: [Caml-list] Bigarray vs. array - mixing?
Date: Wed, 23 Apr 2003 15:56:20 +0100	[thread overview]
Message-ID: <200304231556.20335.da209@cam.ac.uk> (raw)

Hi All,

I've looked through the archives, but could not find any talk of this 
particular problem.

Basically I have numerical code that uses Bigarrays in some parts (for example 
in interfacing with Lacaml), but other parts that use arrays.  It doesn't 
seem to be that clean to make them co-exist.  Which should I use?

Since I was forced to use Bigarrays for Lacaml (which is a wonderful interface 
to LAPACK -- but missing some drivers. :(((  ), I decided to use Bigarrays 
for much of the rest of my program.  I made judicious use of blit and splice, 
since I assume that they only do two bounds checks. But my code still spends 
a lot of time in Bigarray.  In fact approx the *same amount of time* as it 
spends calculating! (according to gprof)

Even though Bigarrays are efficient to access from C/Fortran in LAPACK, I 
still have to set the matrices up.  And to do that I have to shuffle around 
lots if itsy bitsy matrices -- and that's what seems to be killing me.

So I don't know if I should be using arrays or Bigarrays.  They both have 
their advantages and disadvantages (arrays: fast access; Bigarrays: nice 
splicing etc, but cannot turn off bounds checking, so slow access).  

At the moment I've ended up with a mess, since my algorithm code uses arrays, 
but code that interfaces Lacaml and Gnuplot use Bigarrays.

What should I do?  It's hard to be consistent.

Daniel.
PS: I read "Array Optimizations in OCaml" by Michael Clarkson & Vaibhav Vaish, 
but it's no help to me at this time.  

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2003-04-23 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 14:56 Daniel Andor [this message]
2003-04-23 18:47 ` Chris Hecker
2003-04-24 13:41 ` Xavier Leroy
2003-04-24 15:12 ` Markus Mottl

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=200304231556.20335.da209@cam.ac.uk \
    --to=da209@cam.ac.uk \
    --cc=Daniel.Andor@physics.org \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).