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

Sparse matrix multiplication incorrect documentation #76

Open
GregorySchwartz opened this issue May 4, 2020 · 0 comments
Open

Sparse matrix multiplication incorrect documentation #76

GregorySchwartz opened this issue May 4, 2020 · 0 comments

Comments

@GregorySchwartz
Copy link
Contributor

(#~#^) should be A B^T and vice versa for (#~^#). The documentation and function is above anb below the wrong type signature in each one respectively. Solution is to swap type signatures.

Wrong:

-- | Sparsifying A^T B
(#~#^) :: (MatrixRing (SpMatrix a), Epsilon a) =>
     SpMatrix a -> SpMatrix a -> SpMatrix a
a #~^# b = transpose a #~# b


-- | Sparsifying A B^T
(#~^#) :: (MatrixRing (SpMatrix a), Epsilon a) =>
     SpMatrix a -> SpMatrix a -> SpMatrix a
a #~#^ b = a #~# transpose b

Right:

-- | Sparsifying A^T B
(#~^#) :: (MatrixRing (SpMatrix a), Epsilon a) =>
     SpMatrix a -> SpMatrix a -> SpMatrix a
a #~^# b = transpose a #~# b


-- | Sparsifying A B^T
(#~#^) :: (MatrixRing (SpMatrix a), Epsilon a) =>
     SpMatrix a -> SpMatrix a -> SpMatrix a
a #~#^ b = a #~# transpose b
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