Aw, geez; my apologies for spamming up the list, when I could have simply read the dictionary entries for $. more carefully (it's late). Thank you for the guidance.
-Scott Jan-Pieter wrote: >I assume that this behavior is for performance reasons, as to not scan for >zero's when not needed. >The dictionary says: "8&$. removes any rows where the value equals the zero >element" , so >BID =: 8$.BID >>2014-05-21 11:18 GMT+02:00 'Scott Locklin' via Programming < <email>programming@</email>>: >> So, I have never used sparse arrays in J before, and am puzzled by some of >> the behavior. >> If I initialize an integer sparse vector BID, and set element 10 to be 90: >> >> BID=: 1 $. 100;0;3-3 >> BID=: (90) 10}BID >> BID >> 10 │ 90 > > >> Cool; but then, if I want to zero out the 10 element > >> BID=: (90-90) 10}BID >> BID >> 10 │ 0 > > >> Not cool; especially when I want to use 4&$. to find the nonzero elements: >> 4&$.BID >> 10 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
