Re: [Jprogramming] Amend large sparse array

2021-04-14 Thread Ben Gorte
Ah, yes, indeed it matters "where" the array is amended. Somehow I was expecting sparse arrays to use hashing, rather than sorting, but then again 4$. is always sorted (and it's above my league). I will try to understand what's going on in the "farewell for now" discussion and see what comes out o

Re: [Jprogramming] Amend large sparse array

2021-04-14 Thread Henry Rich
Interesting problem.  Sparse amend sorts the indices; they are mostly in order but with some small values at the end.  I previously implemented a quicksort for integer lists, usually fast but this hit a worst-case.  Since I think the case is not unusual I have changed the choice of pivot.  Fixe

Re: [Jprogramming] Amend large sparse array

2021-04-13 Thread Henry Rich
I'll look into it. Henry Rich On 4/13/2021 7:52 PM, Ben Gorte wrote: Perhaps in a bit of a clumsy way I tried to report last Thursday that inserting a value in a large sparse array (changing an element from "zero" into something else) had become quite slow. SIZE=:1000 A =: 1 $. SI

[Jprogramming] Amend large sparse array

2021-04-13 Thread Ben Gorte
Perhaps in a bit of a clumsy way I tried to report last Thursday that inserting a value in a large sparse array (changing an element from "zero" into something else) had become quite slow. SIZE=:1000 A =: 1 $. SIZE i =: ?100 $ SIZE v =: 1+?100 $ 1000 6!:2 'A =: v i } A' NB.