MatSetValues

Barry Smith bsmith at mcs.anl.gov
Mon Jan 8 20:51:35 CST 2007


  It is 5, also the length of GlobalColIndices is 5, not 10.
Each row you pass in has the values in the same columns.

  Barry


On Mon, 8 Jan 2007, Matt Funk wrote:

> Hi, 
> 
> i was wondering in MatSetValues, when i need to specify the number of columns, 
> whether that is the number of column entries per row?
> 
> So, if i want to insert two rows at five entries each, do i specify 5 or 10 
> for the number of columns?
> 
> So something like this:
> 
> m_ierr = MatSetValues(m_globalMatrix, //the matrix
>        			    	     2, //the number of rows 
>        			             GlobalRowIndices, //and their global indices
>        			             5, //the number of columns
>        			             GlobalColIndices, //and their global indices
>        			             Values, //the value to be inserted
>        			             INSERT_VALUES);
> 
> and where the size of GlobalRowIndices is of size 2 and the size of 
> GlobalColIndices is 10 as well as the size of Values?
> 
> 
> thanks
> mat
> 
> 




More information about the petsc-users mailing list