On Mon, Aug 10, 2015 at 3:57 AM, Hoang Giang Bui <[email protected]> wrote:
> Dear list
>
> What is the best way to search for complete zero rows of the matrix and
> set the diagonal to 1.0? In my thinking, the solution would be:
> + extract the max absolute values of each row by using MatGetRowMaxAbs
> + Compare the value with some tolerance and put into the zero row list
> + Extract the diagonal of the matrix by MatGetDiagonal
> + modify the vector of diagonal
> + set the diagonal back by using MatDiagonalSet
>
> THis seem to be overly complicated. Is there an all-in-one solution,
> similar to MatZeroRowsColumns?
>
I don't think there is anything better than checking the MaxAbs, and
calling MatZeroRows() on the indices with a 0.0
Thanks,
Matt
> Best regards
> Giang
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener