Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
-
None
Description
RemoveEmtpy with selection vector always has to respect the selection vector over the actual data. If the input matrix has no non-zero entries, however, we currently produce incorrect results of an empty row/column output vector.
For example, the following script should print nrow (A) = 10, nrow (C) = 10 but prints nrow (A) = 10, nrow (C) = 1.
A = matrix (0, rows = 10, cols = 1); B = matrix (1, rows = 10, cols = 1); C = removeEmpty (target = A, margin = "rows", select = B); print ("nrow (A) = " + nrow (A) + ", nrow (C) = " + nrow (C));
Thanks to ae2015 for catching this.