MatGetArrayF90 returns 2d array

Barry Smith bsmith at
Tue Jun 30 13:19:54 CDT 2009

    Good point.


On Jun 30, 2009, at 12:45 PM, Stephan Kramer wrote:

> Hello,
> Why is it that MatGetArrayF90 returns a pointer to a 2d scalar  
> array, instead of 1d as stated in the documentation? In fact it  
> seems to always return a nrows x ncolumns array. Is this to deal  
> with the MATDENSE case? Would it not be more elegant to always  
> return a 1d array, so you get what you expect for the sparse  
> matrices, and return a 1d array of length nrows*ncolumns in the case  
> Cheers
> Stephan Kramer
> -- 
> Stephan Kramer
> Applied Modelling and Computation Group,
> Department of Earth Science and Engineering,
> Imperial College London

More information about the petsc-users mailing list