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

Missing support for PMatrixProducts #69

Open
jlowenz opened this issue Aug 26, 2016 · 1 comment
Open

Missing support for PMatrixProducts #69

jlowenz opened this issue Aug 26, 2016 · 1 comment

Comments

@jlowenz
Copy link

jlowenz commented Aug 26, 2016

Looking at the source, I was unable to find an implementation of the PMatrixProducts protocol for inner/outer products. The results of the default implementation for outer-product are incorrect:

(def vv (m/matrix :clatrix [1 2 3 4]))
=> #'user/vv
(m/outer-product vv vv)
=> (1.0 2.0 3.0 4.0 2.0 4.0 6.0 8.0 3.0 6.0 9.0 12.0 4.0 8.0 12.0 16.0)
(type (m/outer-product vv vv))
=> clatrix.core.Vector

while for :persistent-vector it works as expected (i.e. outer-product produces a matrix):

(def vv (m/matrix :persistent-vector [1 2 3 4]))
=> #'user/vv
(m/outer-product vv vv)
=> [[1 2 3 4] [2 4 6 8] [3 6 9 12] [4 8 12 16]]
@jlowenz
Copy link
Author

jlowenz commented Aug 26, 2016

I have added a candidate pull request at #70.

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

No branches or pull requests

1 participant