caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Bigarray vs. array - mixing?
@ 2003-04-23 14:56 Daniel Andor
  2003-04-23 18:47 ` Chris Hecker
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Andor @ 2003-04-23 14:56 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-24 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 14:56 [Caml-list] Bigarray vs. array - mixing? Daniel Andor
2003-04-23 18:47 ` Chris Hecker
2003-04-24 13:41 ` Xavier Leroy
2003-04-24 15:12 ` Markus Mottl

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).