[Caml-list] OCaml and Matlab

2008-07-24 Thread crueger
Hi, I am currently trying to get OCaml and Matlab to work together. I found OCamlMex on the Caml-Hump (http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=400). However when I try to compile it, I get an error: ocamlc.opt -c -pp camlp4r -I /usr/lib64/ocaml/camlp4 mex.mli File mex.mli, line 235,

Re: [Caml-list] OCaml and Matlab

2008-07-24 Thread Nicolas Pouillard
Excerpts from Till Crueger's message of Thu Jul 24 10:47:51 +0200 2008: Hi, I am currently trying to get OCaml and Matlab to work together. I found OCamlMex on the Caml-Hump (http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=400). However when I try to compile it, I get an error:

Re: [Caml-list] Memory statistics tool

2008-07-24 Thread Dr. Thomas Fischbacher
Alain Frisch wrote: Many thanks! I just had a glance at it, but it seems to be just how one would have to approach such a problem. (The issue with hash-based approaches to find previously visited substructures is that during traversal, a GC may occur. Now I just assume that this may involve

Re: [Caml-list] Memory statistics tool

2008-07-24 Thread Dr. Thomas Fischbacher
Alain Frisch wrote: As long as the data structure supports the polymorphic hash function, it should work to simply use a regular hash table with the polymorphic hash function and physical equality, as in: module S = Hashtbl.Make(struct type t = Obj.t let hash = Hashtbl.hash let equal =

Re: [Caml-list] Memory statistics tool

2008-07-24 Thread Alain Frisch
Dr. Thomas Fischbacher wrote: The OCaml manual gives no guarantee that Hashtbl.hash does not cons, so I cannot assume this. Indeed, Hashtbl.hash can cons, but this does not contradict my point: its result does not depend on the physical location of objects in memory (if it did, it would be

[Caml-list] Array copying in OCaml

2008-07-24 Thread Raj Bandyopadhyay
Hi I have an application which copies a lot of (small) OCaml arrays using the Array library (Array.sub and Array.blit) functions. This is turning out to be extremely expensive. Is there any general way/trick to reduce the cost of this kind of operation? I haven't found a way not to copy as

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Dr. Thomas Fischbacher
Raj Bandyopadhyay wrote: I have an application which copies a lot of (small) OCaml arrays using the Array library (Array.sub and Array.blit) functions. This is turning out to be extremely expensive. Is there any general way/trick to reduce the cost of this kind of operation? I haven't found a

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Christophe TROESTLER
On Thu, 24 Jul 2008 11:31:50 -0500, Raj Bandyopadhyay wrote: I have an application which copies a lot of (small) OCaml arrays using the Array library (Array.sub and Array.blit) functions. This is turning out to be extremely expensive. Is there any general way/trick to reduce the cost of

[Caml-list] equality operators in OCaml

2008-07-24 Thread Raj Bandyopadhyay
Hi OCaml folk I apologize if I've been asking too many questions on this list recently, but I'm working on a heavy OCaml application and need help sometimes. I am having a disagreement with a colleague about how the equality operators in OCaml work and am trying to resolve it conclusively.

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Adrien
You can compile with the -unsafe flag. If you're using arrays a lot, it can easily speed your program by 50%. If your program is array based, the speedup can be even more important. Don't assume it could magically make your program behave in a weird way. When you're trying to access an element

Re: [Caml-list] OCaml and Matlab

2008-07-24 Thread Till Crueger
On Thu, 24 Jul 2008 11:23:27 +0200, Nicolas Pouillard [EMAIL PROTECTED] wrote: So I am not at all surprised, that it won't work, because the 'a actually is unbound. Was this maybe possible with older versions of the compiler, or are there some workarounds, to get it working again? That's

Re: [Caml-list] equality operators in OCaml

2008-07-24 Thread Vincent Hanquez
On Thu, Jul 24, 2008 at 02:27:51PM -0500, Raj Bandyopadhyay wrote: Hi OCaml folk I apologize if I've been asking too many questions on this list recently, but I'm working on a heavy OCaml application and need help sometimes. I am having a disagreement with a colleague about how the

Re: [Caml-list] equality operators in OCaml

2008-07-24 Thread Jon Harrop
From: Raj Bandyopadhyay [EMAIL PROTECTED] Hi OCaml folk I apologize if I've been asking too many questions on this list recently, but I'm working on a heavy OCaml application and need help sometimes. I am having a disagreement with a colleague about how the equality operators in OCaml work