-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
In R you can do:
> y = matrix(integer(0), nrow=3, ncol=0)
> y
[1,]
[2,]
[3,]
In Eidos you cannot:
> y = matrix(integer(0), nrow=3, ncol=0)
ERROR (Eidos_ExecuteFunction_matrix): dimension <= 0 requested, which is not allowed.
This is arbitrarily limiting, and should be fixed; it will get in the way of algorithms that generate a result matrix with an unknown N number of rows, where N could be 0, for example. It forces the user to check for the zero case and avoid the error, rather than simply making the matrix with 0 rows.
Unfortunately I wrote all the existing matrix code in Eidos on the assumption that dimensions are always non-zero, so I will have to vet the existing code very carefully to fix this, and add new unit tests for this case for every existing function/method/operator that takes a matrix parameter/operand. So this is a rainy-week project.