From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA27574; Fri, 7 Jun 2002 15:54:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA27395 for ; Fri, 7 Jun 2002 15:54:20 +0200 (MET DST) Received: from postfix1-2.free.fr (postfix1-2.free.fr [213.228.0.130]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g57DsKH24191 for ; Fri, 7 Jun 2002 15:54:20 +0200 (MET DST) Received: from montchapet.dijon.fr (dijon-1-a7-62-147-68-3.dial.proxad.net [62.147.68.3]) by postfix1-2.free.fr (Postfix) with ESMTP id B1894AB1F7; Fri, 7 Jun 2002 15:54:18 +0200 (CEST) Received: from montchapet (localhost [127.0.0.1]) by montchapet.dijon.fr (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with SMTP id g57Dqo600438; Fri, 7 Jun 2002 15:52:50 +0200 Date: Fri, 7 Jun 2002 15:52:50 +0200 From: Michel Quercia To: Winfried Dreckmann Cc: caml-list@inria.fr Subject: Re: [Caml-list] look operator Message-Id: <20020607155250.7b75fdef.michel.quercia@prepas.org> In-Reply-To: References: <20020606170842.7ac394b7.michel.quercia@prepas.org> X-Mailer: Sylpheed version 0.7.2 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Le Fri, 07 Jun 2002 11:13:24 +0200 Winfried Dreckmann écrivit : > Definitely. Actually I was thinking about implementing matrices with > mutable entries where for efficiency reasons the implementation type of > entries would be t, and of course implementation details would be hidden > by the interface. To do this with Numerix one would at least need a > function > > val set : tref -> t matrix -> int -> int -> unit > > to make matrix entries accessible to in-place operations (with an > subsequent update to make sure the entries get really changed). Well, I can easily add such a function, but there remains a few problems to solve first. 1. Is it okay to have some matrix entry change of value at any time because we are reusing the tref for some other computation ? Some machinery could be used to prevent this, for instance clearing the tref once its value has been "transfered" through a "set" operation. 2. We would need a lot of different "set" functions, one for vectors, one for matrices, one for each (record type, mutable field) pair that may happen to be usefull... 3. We can restrict the spread of mutable data to vectors and provide a new datatype : tvector with its collection of associated functions : vlook, vadd_in, vmul_in, ... My preference goes to 3. Regards, -- Michel Quercia 23 rue de Montchapet, 21000 Dijon http://michel.quercia.free.fr (maths) http://pauillac.inria.fr/~quercia (informatique) mailto:michel.quercia@prepas.org ------------------- 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