Boost logo

Boost Users :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2007-01-25 09:59:18


On Jan 25, 2007, at 10:15 AM, Markus Werle wrote:

> Mark Ruzon <mark34 <at> cs.stanford.edu> writes:
>
>
>> To Ron's credit, the documentation does not say that multi_array
>> models
>> Assignable.
>
> I disagree and this is why I started the thread, since I was
> really, really
> surprised it did not:
>
> <cite from="http://boost.org/libs/multi_array/doc/user.html">
> The interface design is in line with the precedent
> set by the C++ Standard Library containers.
> </cite>
>
> So either we remove that sentence, mention the exceptions or change
> the code.

I would strongly encourage to make multi_array Assignable.

>
>> If it did, it would have to obey the semantics listed above for any
>> two multi_arrays that have the same template parameters.
>> I am curious to know the source of Ron's loathing, though.
>
> I think this is a performance issue (numerical simulation people tend
> to erase any extra overhead, because their code must compete with
> braind dead f77 nerd code that had too much time to evolve),

I doubt that for any reasonable size the check for equal sizes and
optional resize will hurt performance

>
> So please, Mr. Garcia, reconsider my proposal.
>
> You write in another post:
>
>> multi_array's operator=() was designed to behave in a manner
>> consistent with the other array objects provided by the library
>> (subarrays, views, multi_array_ref).
>
> but since multi_array is special in that it is not a view on data,
> but a container it is really OK to have different assignment
> semantics, too.

I agree.

Matthias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net