Feng  Shi <[email protected]> writes:

> Hi all,
>
> When setting the Mat indices, like the example: 
> src/ts/examples/tutorials/ex10, I noticed that on line
>
> 508:     col[0] = i-1;
> 509:     col[1] = i;
> 510:     col[2] = i+1<info.mx ? i+1 : -1;
> 511:     
> MatSetValuesBlocked<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValuesBlocked.html#MatSetValuesBlocked>(B,1,&i,3,col,&K[0][0],INSERT_VALUES<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/INSERT_VALUES.html#INSERT_VALUES>);
>
> How about the case that when i=0, then col[0]=-1 and i=info.mx then col[2]=-1?
> My question is, is the Mat default indices starting from -1?

No, matrix insertion ignores negative indices.

Attachment: pgpKryC6PO4TJ.pgp
Description: PGP signature

Reply via email to