Add two rows 2 ,4, and each row has three nonzeros at column 3, 7, 9
m=2;
n=3;
idxm[] = {2, 4};
idxn[] = {3, 7, 9};
v[6] = {0.1, 0.2, ....};
MatSetValues(mat, m, idxm, n, idxn,v, INSERT_VALUES);
--Junchao Zhang
On Mon, Apr 13, 2020 at 9:59 AM Bin Liu <[email protected]> wrote:
> Hi all,
>
>
>
> I know how to insert values in one row into the matrix via routine
> “MatSetValues”. I understand I logically should be able to insert multiple
> rows into the matrix with one call of “MatSetValues”. However, I am not
> sure how to do it. I searched in the PETSc mail list and did not find a
> relevant question answered before. Could anyone help me and give me a
> simple example code?
>
>
>
> Regards
>
> B.
>