<?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/45603114c54f97f2b300a8200967c2d8"
  from="Shivkumar Chandrasekaran &lt;shiv@e...&gt;"
  author="Shivkumar Chandrasekaran"
  date="2003-12-15T20:41:17"
  subject="[Caml-list] CamlFloat"
  prev="2003/12/0652bd6b7d5bfddc432dff9fee4000eb"
  next="2003/12/6b69eacae8908603f24d7c8496a1b944"
  prev-in-thread="2003/12/e5b28fabb22922cf3a38685086cbffc1"
  next-in-thread="2003/12/6b69eacae8908603f24d7c8496a1b944"
  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>
I was hoping to hold off on announcing this until the new year..... So 
please take this as just a "pre-announcement".

We plan to release CamlFloat, a "matlab-like" (hopefully better) 
interface to Lapack+Blas "soon". Unfortunately, it is *not* (yet) built 
on top of Lacaml.  It comes with a fully documented interface, a 
tutorial, and a block-sparse matrix module. The code has been 
extensively used in our own research.

For people who cannot wait, they can find a preliminary release here:

http://www.math.ucsb.edu/~lyons/camlFloat/

CleanFloat, a similar package for Clean (http://cs.kun.nl/~clean) will 
also be made available.

--shiv--


On Dec 13, 2003, at 1:38 PM, Oleg Trott wrote:

&gt; On Saturday 13 December 2003 11:36 am, Markus Mottl wrote:
&gt;&gt; On Sat, 13 Dec 2003, romildo@uber.com.br wrote:
&gt;&gt;&gt; I am looking for a good library for numerical
&gt;&gt;&gt; matrixes manipulation in OCaml. Can anybody help me?
&gt;&gt;
&gt;&gt; Although it has already been on the web for a few weeks, I hadn't 
&gt;&gt; actually
&gt;&gt; announced it yet, waiting for comments of some co-developers:
&gt;&gt;
&gt;&gt; Lacaml is available in a new major version. This library interfaces
&gt;&gt; the Fortran libraries BLAS and LAPACK for heavy-weight linear algebra
&gt;&gt; (i.e. matrix computations). New features include support for complex
&gt;&gt; transformations (complex numbers), and a convenient way of accessing
&gt;&gt; submatrices using labels. As usual, you can choose either single or
&gt;&gt; double precision computations. The computations can run in parallel
&gt;&gt; on SMP-machines.
&gt;&gt;
&gt;&gt; You can download the library here:
&gt;&gt;
&gt;&gt;   http://www.oefai.at/~markus/home/ocaml_sources.html#LACAML
&gt;&gt;
&gt;&gt; I'd be grateful for feedback!
&gt;
&gt; All right! I was actually thinking of giving it lately. First of all, 
&gt; I think
&gt; the library is very interesting. Here are some of my assorted thoughts
&gt; regarding improving it.
&gt;
&gt; 1.) I think a matrix library has to have &gt;= 2 levels of 
&gt; user-frienliness. One
&gt; level should be easy to use and have a MATLAB feel to it, i.e. if 
&gt; someone
&gt; wants the eigenvalues of a real matrix, he should just be able to write
&gt;     e_vals = eigenvalues(A)
&gt; or
&gt;    (e_vals, e_vecs) = eigensystem(A)
&gt; without having to worry about details. This should be built on top of a
&gt; low-level interface similar to LAPACK functions themselves. E.g. DGEEV 
&gt; does
&gt; not even return the eigenvectors corresponding to complex eigenvalues, 
&gt; but
&gt; rather something from which they can be reconstructed (which is what
&gt; one might actually want sometimes)
&gt;
&gt; Right now, it appears to me that LaCaml is close to the low level, but 
&gt; not
&gt; quite there (because e.g. some LAPACK interfaces _return_ a matrix 
&gt; rather
&gt; then letting the user modify some piece of memory in place like in 
&gt; FORTRAN)
&gt;
&gt; 2.) Currently, LaCaml interfaces only a fraction of LAPACK. LAPACK is 
&gt; big, and
&gt; interfacing all of it by hand is a huge job. On the other hand, MOST 
&gt; of the
&gt; information needed for the low-level interface can be parsed from 
&gt; function
&gt; declarations in *.f files (I kept thinking about this while using 
&gt; LAPACK in
&gt; my C++ programs). Maybe the way to interface all of LAPACK is
&gt; to parse those *.f files into some intermediate form, let humans edit 
&gt; it (e.g.
&gt; add minimum workspace size expressions, etc. - obvious from docs, but 
&gt; hard to
&gt; parse/NLP), and then auto-generate the whole interface from the 
&gt; result. This
&gt; will have the addtional benefit of being consistent (If you just let a 
&gt; bunch
&gt; of developers contribute interface code directly, they will bring 
&gt; their own
&gt; "style" to their parts of the interface)
&gt;
&gt; 3.) Regarding "WORK" arguments. Why not have a shared workspace:
&gt;
&gt; (* module Workspace, untested *)
&gt;
&gt; (* private *)
&gt; let workspace = ref (Array1.create float64 100)
&gt;
&gt; (* public *)
&gt; let size () = Array1.dim !workspace
&gt;
&gt; let resize n = workspace := Array1.create float64 n
&gt;
&gt; let delete () = resize 0
&gt;
&gt; let get_float64 n = if size () &gt;= n then !workspace
&gt;                                                 else (resize n; 
&gt; !workspace)
&gt;
&gt; This way, one does not need to "hoist" workspace allocation out of 
&gt; loops
&gt; manually. OTOH performance does not suffer from allocating workspace
&gt; for each function call. I don't know how this would inter-operate with
&gt; threading or SMP though.
&gt;
&gt; 4) Submatrices. For a function f that takes a matrix argument "a" of 
&gt; size m by
&gt; n, you normally use something like
&gt;
&gt; f ar ac a m n
&gt;
&gt; where ar and ac refer to the "beginning" of the submatrix. Even though 
&gt; they
&gt; can default to 1, this is kind of inconvenient compared to
&gt;
&gt; f a
&gt;
&gt; I would propose using the latter everywhere, and letting the "mat" type
&gt; include ar, ac, m and n.
&gt;
&gt; submatrix : int -&gt; int -&gt; int -&gt; int -&gt; mat -&gt; mat
&gt; (* submatrix x1 y1 x2 y2 a *)
&gt;
&gt; would provide "views" into matrix a.
&gt;
&gt; 5) I think a function that lets one view matrices as vectors 
&gt; vec_of_mat is
&gt; needed. They are all just ordered sets of numbers after all.
&gt;
&gt; 6) License. Have you thought of adding a static linking exception to 
&gt; your LGPL
&gt; license? Even INRIA did with Caml standard library. I might even 
&gt; consider
&gt; contributing then :-)
&gt;
&gt; -- 
&gt; Oleg Trott &lt;oleg_trott@columbia.edu&gt;
&gt;
&gt; -------------------
&gt; To unsubscribe, mail caml-list-request@inria.fr Archives: 
&gt; http://caml.inria.fr
&gt; Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
&gt; http://caml.inria.fr/FAQ/
&gt; Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

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

