[petsc-dev] VecRestoreArrayRead and const

Jed Brown jed at 59A2.org
Mon Jun 14 07:42:31 CDT 2010


On Mon, 14 Jun 2010 07:23:20 -0500, Matthew Knepley <knepley at gmail.com> wrote:
> Is this a new function? Or do you mean just VecGetArray?

This introduces VecRestoreArrayRead, but the array is still not marked
const.

  http://petsc.cs.iit.edu/petsc/petsc-dev/rev/bf752c718a45

It actually has different behavior than the usual VecRestoreArray, but I
would prefer a symmetric interface with a VecGetArrayRead that is
equivalent to VecGetArray except for a const array.  This is as much an
issue about symmetry and grepability as not littering the code with
(PetscScalar**) casts.

Jed



More information about the petsc-dev mailing list