Registered Member
|
Hi, I would like to define a block matrix of size (n+m)x(n+m) as follows:
B11 B12 B21 B22 where B11 is (nxn) and B22 is (mxm). If I use the comma initializer as
This works only if n and m are both non-zero. What can I do to support the possibility that either could be zero? I can use if statements to check, but that would quickly become unmanageable as the number of blocks increases. Thanks! S |
Registered Member
|
I did not try, but I assume from your post that your code does not work if n or m are zero. I think that is a bug, so your best bet is to fix it and send a patch at http://eigen.tuxfamily.org/bz/ . If you cannot fix it yourself, a bug report at the same place would also be helpful in making sure we do not forget about it.
|
Moderator
|
should be fixed:
https://bitbucket.org/eigen/eigen/chang ... 8f8406ee7/ changeset: 6d68f8406ee7 user: ggael date: 2012-10-03 21:58:14 summary: fix comma initializer when inserting empty matrices affected #: 1 file https://bitbucket.org/eigen/eigen/chang ... d4ec16126/ changeset: 6fbd4ec16126 branch: 3.1 user: ggael date: 2012-10-03 21:58:14 summary: fix comma initializer when inserting empty matrices (transplanted from 6d68f8406ee739115a063d3524741411d5a23ab7) |
Registered Member
|
This problem seems to have creeped in again.
If I run:
I get:
|
Registered Member
|
|
Moderator
|
This has been fixed some weeks ago in both 3.2 and 3.3 branches.
|
Registered Member
|
On which minor/commit version of the 3.2 branch was this fixed again?
|
Moderator
|
There is a bunch of commits that are all in 3.2.10:
10f2cc514f6c 1e7d97fea51d 75abaeb43845 44abf0a7b16a but since the 3.2 branch does not fully handle empty matrices (irrespective to comma-init) there might be some unsupported cases (caught by assertions). |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]