[petsc-dev] VecGetArrayRead vs. VecGetArrayPrivate
Jed Brown
jed at 59A2.org
Tue Nov 23 08:07:50 CST 2010
On Tue, Nov 23, 2010 at 04:57, Barry Smith <bsmith at mcs.anl.gov> wrote:
> I think if we removed ALL the increase state from the outer methods (like
> VecScale) we could remove the VecGetArrayPrivate() and always use
> VecGetArray() or write ones and VecGetArrayRead() for read ones inside the
> private methods.
Why is it better for VecScale_Seq to call a private
VecScaleUpdateCachedNorms instead of letting the outer method handle it?
Seems like either unnecessarily duplicated code, or an extra function, with
less obvious semantics when you approach the code from the public interface.
Having the inner method handle the caching logic is only clearer when you
start in the depths of the implementation and work back towards the user.
Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20101123/e044beda/attachment.html>
More information about the petsc-dev
mailing list