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

[ Thread Index | Date Index | More Archives ]

On Tue, Jun 8, 2010 at 9:50 AM, Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx> wrote:
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.

This fix makes sense to me. What does not make sense is that changing s1*m2 to (s1*m2)..eval() fix the issue while I would expect the contrary since the former is just an _expression_ which does not require alignment while the later is a Matrix which does require alignment. Maybe it is just a coincidence.


- Hauke

Mail converted by MHonArc 2.6.19+