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
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
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
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.