Re: [eigen] Zero-Sized Blocks

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 14.05.2013 13:06, Gael Guennebaud wrote:
If this is already allowed for Matrix<> objects, then I don't see why
this would not be the case for blocks.  It would be nice that the
block.cpp unit test checks for 0-sized blocks.

For zero-sized matrices there is even a separate unit-test file.

Unit tests for blocks are not very extensive at the moment. If I see it correctly, only the case 2 rows and 5 cols is tested for fixed size blocks, and some methods such as topRows, etc are not tested at all (I might just have missed them).

If I find time to extend these tests, I'll also have a look at bug 579:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=579

btw:
Should fixed sized blocks which don't fit into fixed sized matrices fail at compile time? Currently they don't.
	Eigen::Matrix4d A;
// run-time assertion, which could be checked at compile-time:
	A.block<5,5>(0,0);

O.t.o.h. that might be a bit overkill, especially since there will be a lot of special cases for different dynamic/fixed combinations (and run-time assertions will still be needed anyways most of the time).


Christoph




--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/