On Nov 14, 2006, at 5:06 AM, Arkadiusz.Majka at gmail.com wrote:
> Hi,
>
> How can I apply a replacement rule to sparse array, e.g
>
> SparseArray[{1,2,3}]/.{2->222}
>
> and obtain the same result as for {1,2,3}/.{2->222} (what is
> {1,222,3}.
>
> I DON'T want to call Normal before.
Just replace the rule and make a new array:
a=SparseArray[{1->1,2->2,3->3}];
b=SparseArray[ArrayRules[a]/.({2}->_)->({2}->222)]
Regards,
Ssezi