Re: [eigen] integer types - something's odd...

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


2010/6/8 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> On Tue, Jun 8, 2010 at 3:59 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>> But it's true that it's ugly, so, feel free to fix that. For example
>> by isolating the tests that would emit warnings with unsigned types
>> into separate functions...
>>
>>> and then I tried to
>>> run it in debug mode and I got an unaligned memory assertion on
>>>
>>>  m3 = m2; m3 *= s1;
>>>  VERIFY_IS_EQUAL(m3,                      s1*m2);
>>>
>>> while calling
>>>
>>>  CALL_SUBTEST_1( integer_types(Matrix<unsigned long, 3, 4>()) );
>>>
>>> I tried to reproduce this in a separate program but failed. Does
>>> anybody have an idea?
>>
>> can you paste a backtrace from that assert?
>
> I attached the back-trace.
>
>> Does the assert persist if you replace unsigned long by signed long?
>
> Yes, it does persists.
>
> Furthermore, changing lines 111-112 to
>
> m3 = m2; m3 *= s1;
> VERIFY_IS_EQUAL(m3,                      (s1*m2).eval());
>
> fixes the issue too.
>
> Also, changing lines 370-371 in the main.cpp to
>
> template<typename T, typename U>
> bool test_is_equal(const T& actual, const U& expected)
>
> solves the issue and I think that is the real fix. Passing aligned
> types by value destroys the alignment.

ooooh.... sorry! of course it does, we even have a dox page about exactly that!

Benoit

>
> - Hauke
>



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