Registered Member
|
Hello,
I just stumbled upon the problem that VectorXd::Zero(0) triggers an assertion. I wanted to ask if there is a good reason for disallowing such an expression. In my particular case, I have something like VectorXd::Zero(N), and if N==0, returning an empty matrix would make perfect sense. Now I had to add a check for N==0 and treat this case separately. When compiling with -DNDEBUG, everything runs fine, but it's quite inconvenient to not be able to run your stuff in debug mode. Therefore I would like to encourage you to allow such expressions, unless there is a good reason not to that I have missed. Anyway, thanks for this great library! Best regards, Martin |
Registered Member
|
|
Moderator
|
The main reason is that we were afraid to have to add checks everywhere in the code. Finally it turns out that's probably not the case, and so in the devel branch we already started the necessary changes to allow null matrices. This will be available for the 2.1 release.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]