I have a given SparseArray, let's call it A.
I want to construct another SparseArray, let's call it B, which has the same "shape" as A. Right now, I construct B by applying a certain defining function on the positions of the elements of A. So something like
B = SparseArray[ Map[ some_function[], A["ExplicitPositions"] ] ]
It works OK by it turns out to be quite slow for large SparseArray...
Is there another more efficient method maybe ?
Thanks in advance.
But this discussion was nevertheless very useful for me :)
– coussin Dec 19 '23 at 11:10