Open haBuu opened 10 years ago
To be honest, I have never considered empty matrices, nor matrices of negative size. However, I am guessing you encountered this problem by using them somehow. I admit that if they worked before was by accident. But yes, I consider this a regression. After all, applying splitBlocks
to a 1x1 matrix (which is a valid matrix) will indeed generate 3 empty matrices. The problem of going back to forM_
is that it would be a performance regression. I will contact the maintainer of the loop
package and see if numLoop
can be adapted to handle these cases. Otherwise, I will create my own version.
Change from forM to numLoop causes some problems since "forM [1..0] ..." executes zero times but "numLoop 1 0 ..." will cause an infinite loop. For example "joinBlocks (identity 1, identity 0, identity 0, identity 0)" will crash in version 0.3.4.0 but in 0.3.3.0 it returned 1x1 matrix.
Version 0.3.3.0: Prelude Data.Matrix> joinBlocks (identity 1, identity 0, identity 0, identity 0) ( 1 )
Version 0.3.4.0: Prelude Data.Matrix> joinBlocks (identity 1, identity 0, identity 0, identity 0) ( *\ Exception: ./Data/Vector/Generic/Mutable.hs:597 (write): index out of bounds (1,1)