-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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.Vectorwhile 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]]Metadata
Metadata
Assignees
Labels
No labels