Re: [eigen] Serious conflict between Dynamic and -1 in Diagonal<>

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


For the record, here is the fix:

https://bitbucket.org/eigen/eigen/changeset/61f5fd44ae41/
changeset:   61f5fd44ae41
user:        ggael
date:        2012-07-10 23:04:17
summary:     Add a DynamicIndex constant for signed quantities and use
it to fix the conflict
between Diagonal<S,-1> (the first sub diagonal) and a runtime
super/sub diagonal which is now:
Diagonal<S,DynamicIndex>

I'm not sure to backport it because it's quite major, and apparently
the current version works fine at runtime, it only looses track of the
fixed size and fixed index information.

gael

On Tue, Jul 10, 2012 at 3:20 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> Hi,
>
> it has to be of the same type as integral constants (1, 2, 10, etc.)
> when used as a template parameter. Otherwise, we would had to do
> something like:
>
> Eigen::Matrix<double, Eigen::Size<3>, Eigen::Size<4> >
>
> to declare a 3x4 matrix.
>
> So there is no way we can detect users don't write Diagonal<MatrixXd,
> Dynamic>, but well, according to the (future) documentation, it's like
> someone write:
>
> Diagonal<MatrixXd, Eigen::Success>
>
> That's ok wrt the compiler, and we cannot detect such mistake, but it
> just does not make sens.
>
> gael
>
> On Tue, Jul 10, 2012 at 3:05 PM, Rhys Ulerich <rhys.ulerich@xxxxxxxxx> wrote:
>>> Not sure how you'd
>>> accomplish that cleanly since DynamicSize is signed and DynamicIndex
>>> has to be signed.
>>
>> I take that back if you'd intended to use a tag type and not an enum
>> for DynamicIndex.  Curiosity, why was Dynamic made an integer instead
>> of a tag type?
>>
>> - Rhys
>>
>>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/