Skip to content

imapSM unintuitive keys #74

Description

@GregorySchwartz

Is imapSM intended to have its function argument as (\col row val -> ...)? I would think it should be (\row col val -> ...). For example, this to me is backwards according to the rest of the library:

Prelude Data.Sparse.Common Data.Sparse.SpMatrix> prd x                                         
                                                                                               
( 10 rows, 1 columns ) , 10 NZ ( density 100.000 % )                                           
                                                                                               
, 1.00                                                                                         
, 2.00                                                                                         
, 3.00                                                                                         
 ...                                                                                           
, 10.00                                                                                        
                                                                                               
Prelude Data.Sparse.Common Data.Sparse.SpMatrix> prd $ imapSM (\ i j v -> v + fromIntegral i) x
                                                                                               
( 10 rows, 1 columns ) , 10 NZ ( density 100.000 % )                                           
                                                                                               
, 1.00                                                                                         
, 2.00                                                                                         
, 3.00                                                                                         
 ...                                                                                           
, 10.00                                                                                        
                                                                                               
Prelude Data.Sparse.Common Data.Sparse.SpMatrix> prd $ imapSM (\ i j v -> v + fromIntegral j) x
                                                                                               
( 10 rows, 1 columns ) , 10 NZ ( density 100.000 % )                                           
                                                                                               
, 1.00                                                                                         
, 3.00                                                                                         
, 5.00                                                                                         
 ...                                                                                           
, 19.00                                                                                        
                                                                                               

If this is true, then I would recommend fixing this issue, but I don't know what else that would have an effect on downstream in the library.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions