Code review comment for lp:~jobh/dolfin/fast-array

Revision history for this message
Johan Hake (johan-hake) wrote :

On Tue, Mar 6, 2012 at 10:04 PM, Joachim Haga <email address hidden> wrote:
>>
>> >> I agree. For all argments needing to be resized should use
>> >> std::vector. Not sure where the resize functionality is/was used.
>> >
>> > It is possible (of course). There are quite a few user-exposed interfaces
>> > that need changing (f.x. all the GeneralVector::set/get methods, since it
>> > would be strange to just change the get methods).
>>
>> I did not anticipate using std::vector for these methods as these
>> methods assume the user provides arrays with the correct size. It
>> would cost too much to resize std::vector for these operations. Maybe
>>
>
> Not sure if we're talking about the same thing? PETScVector::get_local for
> example uses resize() on the Array& that is passed as parameter.

You are right. We do not talk about the same thing.

Here I think we should just check that the user pass an Array of the
correct size avoiding resizing.

Johan

« Back to merge proposal