[petsc-dev] VecRestoreArrayRead and const

Barry Smith bsmith at mcs.anl.gov
Mon Jun 14 11:21:32 CDT 2010


   I added it quickly as a bit of a hack. Eventually it needs a lot of cleaning up.

   It is not actually readonly so shouldn't be listed as a const; it is not a good name. 

   Can we worry about it later, not now?

   Barry

On Jun 14, 2010, at 5:56 AM, Jed Brown wrote:

> It seems to me that every correct use of this function should mark the
> array const, so perhaps it would make sense to have
> 
>  PetscErrorCode VecGetArrayRead(Vec,const PetscScalar**);
>  PetscErrorCode VecRestoreArrayRead(Vec,const PetscScalar**);
> 
> rather than always casting away const at the call site.
> 
> Jed




More information about the petsc-dev mailing list