Re: [eigen] Blocks and dynamic stack matrices |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Blocks and dynamic stack matrices
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 5 Oct 2011 13:34:50 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=ga3pWwRBeHfebfyhrytTVleed4bUwVp+PNHTrccc9H4=; b=df6gBLaTVQzvVE1++w9HA0XMrP7Gthg3ZaHYFdjdfWvqEgW7P8/Go3i4ggXvHVlN1u T/4+DMEwgwjBW7/IMech9kM1ehIMhdA0VnNHodzduKb6ZX0D0/0WQVKVVMVx5Q7d4oBF FEW+BBmz1/u19JuY4SVAXOMFBH+8D1zkW/5Q4=
sorry but I cannot reproduce and I don't see what is wrong in this
assert. Here is my test example:
#include <Eigen/Core>
using namespace Eigen;
int main()
{
Matrix<double, Dynamic, Dynamic, 0, 3, 3> mat(2,2);
mat.col(1);
mat.row(0);
return 0;
}
gael.
On Wed, Oct 5, 2011 at 10:09 AM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> Hi guys,
>
> I am getting a run-time assert when calling ::row on a Matrix<double,
> Dynamic, Dynamic, 1, 3, 3>.
>
> The assert is caused by the check in lines 291-293 of Block.h and the
> issue is that BlockRows!=XprType::RowsAtCompileTime but
> BlockRows==XprType::MaxRowsAtCompileTime. Changing the assert to
>
> eigen_assert( (i>=0) && (
> ((BlockRows==1) &&
> (BlockCols==XprType::ColsAtCompileTime||BlockCols==XprType::MaxColsAtCompileTime)
> && i<xpr.rows())
> ||((BlockRows==XprType::RowsAtCompileTime||BlockRows==XprType::MaxRowsAtCompileTime)
> && (BlockCols==1) && i<xpr.cols())));
>
> fixes the problem.
>
> Does anybody see an issue with doing this globally in Block.h?
>
> - Hauke
>
>
>