Re: [eigen] Assertion in DenseStorageBase.h:487: Nonnegativity of rows and cols sufficient? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Assertion in DenseStorageBase.h:487: Nonnegativity of rows and cols sufficient?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 21 Jul 2010 10:27:56 -0400
- 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; bh=eiU+3duRAaoGxKMhXJngnbQhxJkUokD+gSJKwexv+Es=; b=HD0RfYcImKnZi81eBQz5bfj0Cw1ddee4vTEf4sys6Joe8n1YIW2zTp1CT13iW/63cn fa+6HFZUeFzhk/m/ik7fTWB5x1WsGsDV1AlTY7FKtmdE3UF5FuBwdhbmT0qavf7tNtOW 8o8xtJOSSnydY+HQ9yXVkNTua8USk/+g9vrBY=
- 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; b=UblUyTCBTkxYSPyG4srMHOoQCTmBup0b7JjdLoevlepBtgzJZDKiSxvoezdVfTD8Iy DrcLVrnqIo9Kp3G58+WF5Gs8fRCq/dbR3htmu25eth3yAkI4jhHOm2+4AYWP1OATBU6B wNbMvVurLH9wRojSOWdKpRACRLiWP9T09Xjuw=
Thanks, pushed.
Benoit
2010/7/20 Martin Senst <martin.senst@xxxxxx>:
> Am Dienstag 20 Juli 2010, 20:39:13 schrieb Benoit Jacob:
>> Yes, it's OK. Can you send us the patch?
>
> Sure, here it is.
>
> Cheers,
> Martin
>
>
>
>
>
>> http://eigen.tuxfamily.org/index.php?title=Developer%27s_Corner#Generating_
>> a_patch
>>
>> 2010/7/20 Martin Senst <martin.senst@xxxxxx>:
>> > Hi everyone,
>> >
>> > sorry to bother you again with the topic of zero-sized matrices, but as
>> > I've written in the thread about sum() of empty vectors, I need them to
>> > avoid ugly special-case-treatments.
>> >
>> >
>> > I'm wondering wheter it's okay to change the assertion in
>> > DenseStorageBase.h, lines 486 and 487, from
>> >
>> > ei_assert(rows > 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime
>> > == rows)
>> > && cols > 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime ==
>> > cols));
>> >
>> > to
>> >
>> > ei_assert(rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime
>> > == rows)
>> > && cols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime ==
>> > cols));
>> >
>> >
>> >
>> > The issue is that currently, code like
>> >
>> > MatrixXd A(0, 0);
>> > MatrixXd B(0, N);
>> > MatrixXd C(N, 0);
>> >
>> > fails due to this assertion. If compiled with NDEBUG, this code works as
>> > expected, so I guess that the current assertion is overly strict.
>> >
>> > As a workaround, something like
>> > MatrixXd C = MatrixXd(N, 1).leftCols(0);
>> > works, but of course that's pretty ugly.
>> >
>> > Cheers
>> > Martin
>
>