Arrays and arrays

Ketil Z. Malde ketil@ii.uib.no
22 Jan 2003 07:54:12 +0100


Hal Daume III <hdaume@ISI.EDU> writes:

>> Any reason it couldn't be done in-place?  (I.e. thaw, update all, and
>> freeze again)  Am I missing something -- Could partial results be
>> used, the update list be infinite, or anything like that?

> I believe that's essentially what normal arrays are doing, 

Makes sense, I believe -- and I don't seem to be getting any better
performance by doing it explicitly, so you're probably right.

> but that's not inplace.  

But it's O(n), not O(n^2).  It's just a factor of two compared to
entirely in place, not a big deal.  In theory.

> In the process of thawing, you're copying the array.  If you're
> not copying it, then the results are unsound.

Right.  So I noticed (trying to use unsafeThaw; unsafeFreeze is okay,
of course).

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants