Re: [eigen] Static asserts in Eigen3 beta1/beta2 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Static asserts in Eigen3 beta1/beta2
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 22 Nov 2010 08:26:25 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=ZnQCNbmwTBdNNZ0YuVLzLbb0bTn/inzRvIYVENZ4wkI=; b=jA++5PQgYnPwkVsLLZwnYAgdLLmOZLA/HCkrZAsBnj5GYXxsoWcyYbA1yMIag091SZ hRLiaVgPJVUVYqs9j2oQgTk4eWwIqlS5wy1hStOhKJ7eEpvpUdjhq9I5QSXqHvB2CG6H B8YAzEZlUlHpqQjSdnY1twzyMQXHEvG3M7KP8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PB0VZUYF5C7cFNZnxEt+9MY1y4Re756m5BAmtvesJJLSx9aepkiBf9FoBWV3hjQVPO Vc98OCOsRmj8DY2NMttgbpO8+XNFaN+jkbhAdUymFy/hDMO4EJ+A/5tbuBVimGiqhuJ4 QAg9F6w1b9fXf3oC7WJwz5q5zIo0TwqN33T7c=
Problem fixed. I had unwillingly checked in a change turning all
static asserts into runtime asserts, intended only for local
debugging.
Benoit
2010/11/22 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> [bjacob@cahouette eigen]$ hg bisect -b
> The first bad revision is:
> changeset: 3382:3b87183dd7fb
> user: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> date: Mon Sep 27 09:57:57 2010 -0400
> summary: fix compilation on ubuntu 9.04's version of gcc 4.3 (yes, wtf)
>
>
> 2010/11/19 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
>> This looks like a severe regression, I wasn't aware of it. Thanks for
>> the report.
>>
>> The best next thing to do is to bisect.
>>
>> Benoit
>>
>> 2010/11/19 hauke strasdat <strasdat@xxxxxxxxx>:
>>> HI Carlos,
>>>
>>> Thanks for your fast answer! However, I fear you got me wrong. I am
>>> aware that I pass a 6-Vector into a function which expects a 5-Vector.
>>> Using beta1, I get a compiler error/static assert, which is what I
>>> expect and I want!
>>>
>>> However, the problem is - when using beta2 - I don't get a static
>>> assert. The program only crashes during run-time.
>>> My question is: How can I tell beta2 to trigger static asserts as beta1 did?
>>>
>>> Cheers,
>>> Hauke
>>>
>>> On Fri, Nov 19, 2010 at 12:20 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:
>>>> Hi. The problem is that your function test_v5 takes as its argument a 5x1
>>>> double matrix, and you are trying to pass it a 6x1 double matrix. So the
>>>> message from Eigen makes sense. If you replace Eigen::Matrix<double,5,1>
>>>> by Eigen::Matrix<double,6,1> in the definition of test_v5 then it will work.
>>>> The problem with this approach is that test_v5 will only work with 6x1
>>>> double matrices. If you want to make it more general you can read
>>>> here http://eigen.tuxfamily.org/dox-devel/TopicFunctionTakingEigenTypes.html
>>>> cheers,
>>>> Carlos
>>>>
>>>> On Fri, Nov 19, 2010 at 9:17 PM, hauke strasdat <strasdat@xxxxxxxxx> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I fear this must be a known issue. However, I couldn't find any
>>>>> information about it.
>>>>>
>>>>> Let's look at the following minimal program.
>>>>>
>>>>> ---
>>>>> #include <Eigen/Core>
>>>>>
>>>>> void test_v5(const Eigen::Matrix<double,5,1> & v)
>>>>> {
>>>>> }
>>>>>
>>>>> int main()
>>>>> {
>>>>> Eigen::Matrix<double,6,1> v6;
>>>>> test_v5(v6);
>>>>> }
>>>>> ---
>>>>>
>>>>> Compiled against Eigen3 beta1, it leads to a compiler error/static
>>>>> assert: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES.
>>>>> This is the desired behavior, right?
>>>>>
>>>>> Compiling the same program against Eigen3 beta2, however, leads to no
>>>>> compiler error! Only at run-time it triggers a assertion.
>>>>>
>>>>> Is there any way to turn the static assertions back on in Eigen3 beta2?
>>>>>
>>>>> I am using Ubuntu 10.04 Amd64, with gcc 4.4.
>>>>>
>>>>> Thanks a lot,
>>>>> Hauke
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>