Skip to content

Missing support for PMatrixProducts #69

@jlowenz

Description

@jlowenz

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]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions