A quick question, I have a sparse matrix A and a index list b = [2, 3, 4 ...]
, I want to set A(2, 2), A(3, 3), A(4, 4)... = 0
. I tried A(b, b) = 0, the result is that A(2, 3), A(2, 4), A(3, 2), A(3, 4), A(4, 2), A(4, 3)
and some non-diagonal elements of this matrix are also set zero, how to deal with that?
Asked
Active
Viewed 737 times
2

ivory
- 243
- 4
- 16