Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imapSM unintuitive keys #74

Open
GregorySchwartz opened this issue Aug 26, 2019 · 1 comment
Open

imapSM unintuitive keys #74

GregorySchwartz opened this issue Aug 26, 2019 · 1 comment

Comments

@GregorySchwartz
Copy link
Contributor

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.

@GregorySchwartz
Copy link
Contributor Author

I would only affect mapColumnIM2, but that assumes j is a column, so imapSM looks incorrect.

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

No branches or pull requests

2 participants