Re: [eigen] Matrix assignment |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
On Monday 20 October 2008 20:36:05 Gael Guennebaud wrote:
> Now what about the automatic resizing of operator= ? Honestly I would
> not be against removing this feature and enforcing that the left-hand
> side has the correct size. This is also more consistent with
> fixed-size matrices which cannot be resized anyway. In that case we
> could add the folfowing exception: the lhs will still be automatically
> resized if its size is 0. Well, currently we cannot create such an
> empty matrix, but I think that would be nice to allow that regardless
> of the automatic resizing issue.
If we allow 0 size then I suppose that we mean that 0 size matrices don't need
to have an allocated array.
My motivation for forbidding non-allocated arrays was that it would be too
dangerous, or so I thought.
However, I understand that as long as we keep the policy that "as soon as the
number of rows and columns are >0, the array is allocated" then the checks
that we already have on the numbers of rows and columns check implicitly that
the arrays are allocated.
So, I support this idea. I don't think that it breaks any existing code as I
don't see many people relying on implicit resizing of matrices (one clear
sign that it shouldn't be allowed btw). But we have to sort this out before
2.0.
Cheers,
Benoit
---