<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/12/0a43e811112e9d2e886447b4a4cde60d"
  from="Oleg Trott &lt;oleg_trott@c...&gt;"
  author="Oleg Trott"
  date="2003-12-14T23:11:05"
  subject="Re: [Caml-list] Matrix libraries"
  prev="2003/12/22a7ccbbbae6a7e18cdc45f3ea6dabc4"
  next="2003/12/2d9430335faaca17eba81d2c109937ca"
  prev-in-thread="2003/12/c3b75dfeec654641ac28b231c93f7c56"
  next-in-thread="2003/12/e5b28fabb22922cf3a38685086cbffc1"
  prev-thread="2003/12/68276101f2bc192b44f47bce0bf1c103"
  next-thread="2003/12/c9409b63462d80cc0a4b0355adf1e0b0"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Matrix libraries">
<msg 
  url="2003/12/f9520b7839c36f67ec24f72b79457271"
  from="romildo@u..."
  author="romildo@u..."
  date="2003-12-13T13:51:36"
  subject="[Caml-list] Matrix libraries">
<msg 
  url="2003/12/a2033ccc51a85fa08cd9c55584643029"
  from="Markus Mottl &lt;markus@o...&gt;"
  author="Markus Mottl"
  date="2003-12-13T16:36:15"
  subject="Re: [Caml-list] Matrix libraries">
<msg 
  url="2003/12/09f10707cb7d748374f53d21860a4769"
  from="Oleg Trott &lt;oleg_trott@c...&gt;"
  author="Oleg Trott"
  date="2003-12-13T21:38:23"
  subject="Re: [Caml-list] Matrix libraries">
<msg 
  url="2003/12/c3b75dfeec654641ac28b231c93f7c56"
  from="Markus Mottl &lt;markus@o...&gt;"
  author="Markus Mottl"
  date="2003-12-14T15:02:00"
  subject="Re: [Caml-list] Matrix libraries">
<msg 
  url="2003/12/0a43e811112e9d2e886447b4a4cde60d"
  from="Oleg Trott &lt;oleg_trott@c...&gt;"
  author="Oleg Trott"
  date="2003-12-14T23:11:05"
  subject="Re: [Caml-list] Matrix libraries">
<msg 
  url="2003/12/e5b28fabb22922cf3a38685086cbffc1"
  from="Markus Mottl &lt;markus@o...&gt;"
  author="Markus Mottl"
  date="2003-12-15T10:01:30"
  subject="Re: [Caml-list] Matrix libraries">
</msg>
</msg>
</msg>
<msg 
  url="2003/12/45603114c54f97f2b300a8200967c2d8"
  from="Shivkumar Chandrasekaran &lt;shiv@e...&gt;"
  author="Shivkumar Chandrasekaran"
  date="2003-12-15T20:41:17"
  subject="[Caml-list] CamlFloat">
</msg>
<msg 
  url="2003/12/6b69eacae8908603f24d7c8496a1b944"
  from="Shivkumar Chandrasekaran &lt;shiv@e...&gt;"
  author="Shivkumar Chandrasekaran"
  date="2003-12-15T21:15:58"
  subject="Re: [Caml-list] Matrix libraries">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Sunday 14 December 2003 10:01 am, Markus Mottl wrote:
&gt; In any case, LACAML is supposed to stay a low-level interface to
&gt; BLAS/LAPACK. 

The $1e6 quesion: do you want the library to be safe from user abuse, i.e.
no function input should result in corrupted memory ?

&gt; Others are working on higher-level ones, e.g.:
&gt;
&gt;   http://www.math.ucsb.edu/~lyons/camlFloat/index.html

Thanks for the link! CamlFloat isn't even in Google yet. It must be new. Are 
there others?

&gt; I'd also like to see something like that, but I am skeptical that this
&gt; is realistically possible. Writing the C-code for the interface is very
&gt; little work. It's the OCaml-code around it that costs time to write,
&gt; especially error handling.

Some of this error-handling like checking that input matrices/vectors have 
compatible sizes seems tedious (and error-prone), and I think it can be 
auto-generated from parsing *.f files (including comments) But, yes, maybe 
it's too hard and not worth the effort.

&gt; &gt; 3.) Regarding "WORK" arguments. Why not have a shared workspace:
&gt;
&gt; Yes, that's exactly the problem: what about SMP-machines and threading
&gt; then?

Each thread oviously needs its own workspace. I think this can be done using

(int * vec ref) list ref            (* int  = id (self ()) *)

association list (or hash table).  Now, "get", "resize", etc. could check if 
the thread has its workspace and return it, allocating if necessary.

I think there is a problem with this approach though: each thread's workspace
needs to be removed once the thread terminates. OCaml has at_exit but no 
at_thread_exit that I can find (Maybe it can be defined using 
Sys.set_signal's ?)

&gt; I had indeed thought about this, but that would have made it more
&gt; inconvenient to people who want to keep accessing "a" directly using
&gt; the Bigarray-module and the .{}-notation. 

I think the inconvenience is minimal:

a.{...}  vs a.mat_data.{...}

(and it's just typing)

But it saves you from the very error-prone and boring task of having to 
remember which variables designate which dimensions ("Is it m x n or n x k, 
did I transpose that?"), etc.

OTOH submatrices/slices probably aren't the most frequently used features,
so I haven't made up my mind as to which is better.

&gt; &gt; 5) I think a function that lets one view matrices as vectors vec_of_mat
&gt; &gt; is needed. They are all just ordered sets of numbers after all.
&gt;
&gt; This would collide with 4), wouldn't it? Vector arguments in LAPACK
&gt; don't have anything like a "leading dimension" so this wouldn't help you
&gt; unless you allow copying data. 

Just a runtime error if LD does not equal the number of rows would be good.
(If your matrix type includes info about both the number of rows and LD)

-- 
Oleg Trott &lt;oleg_trott@columbia.edu&gt;

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

</contents>

</message>

