Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] look operator
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michel Quercia <michel.quercia@p...>
Subject: Re: [Caml-list] look operator
Le Fri, 07 Jun 2002 11:13:24 +0200
Winfried Dreckmann <wd@lidingo.mail.telia.com> é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