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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.