I have a problem where I look at a row of elements, and if there are no non-zero elements in the row, I want to set one to a random value. My difficulty is the update strategy. I just attempted to get a version working that used slice from Clatrix, but that does not work with Incater matrices. So should I construct another matrix of "modifications" and perform elementwise addition? Or build some other form of matrix and perform a multiplication (not sure how to build this one yet). Or maybe I could somehow map the rows? My trouble there is that assoc
does not work Incanter matrices, which is apparently what sel
returns.
Asked
Active
Viewed 35 times
-1

user1559027
- 343
- 2
- 13
-
1A downvote with no explanation? That seems unfair. – Mars Apr 23 '14 at 04:41
1 Answers
0
It seems that there are no easy ways to do this in Incanter, so I ended up directly using set
from Clatrix and avoiding Incanter usage.

user1559027
- 343
- 2
- 13