Re: [eigen] HouseholderQR bug?? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] HouseholderQR bug??
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Mon, 26 Apr 2010 15:19:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0tHiAdsCllALNsTPuyRmbzF8I4p2pI1JEFA1Ut13tHQ=; b=nv5FtTMEl4zeonsURMxjsUuLfR9ltykJiPxj9dGkKbwmKz/j+ClfZ/EOkVxQ2CD9vv SVV8AFKY05eaaYRVL2aY/15g4L+9SCJjP/rPSO+Ablh24E0mTV9YWvdB4qVLExKkR+bk 98Mlcpk1pBFpo5hZq7pQ5Z6FemcQ/05YGGtVU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FtKVe89FdmZKP4AVS6S8io6+Q0jiADmD5XpQAAOH6GcZobORgmEQIddNSOVLyhTkPR +r8sr6Y9GljbwX2ovS//rP68CppSDsOm+KmsvBFlVHKfPqMJ6n2r1nHHkOfr2wByAsDo EG42uOy2+84pHx8xXZGQPLLPjYMi2KR3sLznU=
This program
#include <Eigen/Core>
using namespace Eigen;
#include <Eigen/Core>
using namespace Eigen;
int main()
{
VectorXd v = VectorXd::Zero(50);
typedef Matrix<double,1,Dynamic,1,1,Dynamic> T;
Map<T> m0(&v.coeffRef(0), 1024);
Map<T> m1(&v.coeffRef(1), 1024);
return EXIT_FAILURE;
}
results in this assert (debug mode, 32bit)
Assertion failed: ((!(ei_traits<Derived>::Flags&AlignedBit)) || ((size_t(m_data)
&0xf)==0)) && "data is not aligned", file c:\users\hauke\documents\camp\3rdparty
\eigen\eigen\src\core\mapbase.h, line 184
which is triggered by checkSanity(). Both checks are interpreted as false.
- Hauke
On Mon, Apr 26, 2010 at 2:10 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> ei_assert( ((!(ei_traits<Derived>::Flags&AlignedBit))
> || ((size_t(m_data)&0xf)==0)) && "data is not aligned");
>
> Note the ! here
>
> By the way, we should rewrite this using EIGEN_IMPLIES...
>
> So what error exactly do you get? For me, this program works:
>
> #include <Eigen/Core>
> #include <iostream>
>
> using namespace Eigen;
> using namespace std;
>
> int main()
> {
> double *array;
> typedef Matrix<double,1,Dynamic,1,1,Dynamic> T;
> Map<T> m0(array, 1024);
> Map<T> m1(array+1, 1024);
> }
>
> Benoit
>
> 2010/4/26 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>> For me
>>
>> MapBase< Map< Matrix<double,1,Dynamic,1,1,Dynamic>,0, Stride<0,0> >
>>>::checkSanity()
>>
>> is failing and there it seems as if alignment is required.
>>
>> - Hauke
>>
>> On Mon, Apr 26, 2010 at 1:48 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>> Map does not assume aligned by default. Unless you pass the Aligned
>>> option, the pointer is not required to be aligned.
>>>
>>> Benoit
>>>
>>> 2010/4/26 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>>>> Hi,
>>>>
>>>> I am trying to trace down the std::vector issue and stumbled over the following.
>>>>
>>>> In HouseholderQR line 220, applyHouseholderOnTheLeft(...) is called
>>>> with this raw pointer
>>>>
>>>> &m_temp.coeffRef(k+1)
>>>>
>>>> which is mapped as
>>>>
>>>> Map<typename ei_plain_row_type<PlainObject>::type> tmp(workspace,cols());
>>>>
>>>> and results in unaligned data because even if m_temp is aligned,
>>>> m_temp.getData()+1 is not necessarily.
>>>>
>>>> How do we fix this? This does not help - I always thought it were
>>>> affecting the Flags property
>>>>
>>>> Map<typename ei_plain_row_type<PlainObject>::type, Unaligned>
>>>> tmp(workspace,cols());
>>>>
>>>> - Hauke
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>