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

Inconsistency in handling seq/map/filter, etc. #58

Open
alexott opened this issue Dec 27, 2014 · 0 comments
Open

Inconsistency in handling seq/map/filter, etc. #58

alexott opened this issue Dec 27, 2014 · 0 comments

Comments

@alexott
Copy link

alexott commented Dec 27, 2014

Right now, the Clatrix has inconsistency in how it represent rows when executing seq/map/filter & other related operations. Clatrix uses the 1x2 matrices to represent rows, while other implementations (like, vectorz-clj) use the separate types to represent them. This lead to problem when trying to create matrix from the result of the map or filter - the dimensionality returns 3 instead of correct 2, like in other implementations, and this lead to exception when trying to construct matrix (in functions clatrix & construct-clatrix).

incanter.core> (set-current-implementation :clatrix)
:clatrix
incanter.core> (def m (matrix [[1 0] [2 1]]))
#'incanter.core/m
incanter.core> (m/dimensionality (map identity m))
3
incanter.core> (map identity m)
( A 1x2 matrix
 -------------
 1.00e+00  0.00e+00 
  A 1x2 matrix
 -------------
 2.00e+00  1.00e+00 
)
incanter.core> (set-current-implementation :vectorz)
:vectorz
incanter.core> (def m (matrix [[1 0] [2 1]]))
#'incanter.core/m
incanter.core> (m/dimensionality (map identity m))
2
incanter.core> (map identity m)
(#<ArraySubVector [1.0,0.0]> #<ArraySubVector [2.0,1.0]>)

I have a small workaround for clatrix & construct-clatrix that checks if the every element is 1xN matrix, and the use the join to merge results together, but the correct solution will be the use of separate type (existing Vector type) to represent rows when calling seq.

alexott added a commit to incanter/incanter that referenced this issue Dec 28, 2014
this is really a workaround until we get the core problem fixed in the
Clatrix... (see tel/clatrix#58 for more details)
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