Skip to content

first, map, ... don't work correctly for 1 row matrices #36

@alexott

Description

@alexott

if I have 2 matrices - row matrix & col matrix, then the seq, first, map, and other functions behaves the same for them, although this is incorrect (imho):

(def m2 (matrix [[1 2 3]]))
m2
A 1x3 matrix
-------------
1.00e+00 2.00e+00 3.00e+00

(def m3 (matrix [1 2 3]))
m3
A 3x1 matrix
-------------
1.00e+00
2.00e+00
3.00e+00

(first m2)
1.0
(first m3)
1.0
(matrix (seq m2))
A 3x1 matrix
-------------
1.00e+00
2.00e+00
3.00e+00
(matrix (seq m3))
A 3x1 matrix
-------------
1.00e+00
2.00e+00
3.00e+00

This breaks some functions in incanter that process matrices on per-row basis. I think, that this relates to issue #30

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