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

Element map (emap) on matrix returns LazySeq #42

Open
mars0i opened this issue Oct 17, 2013 · 4 comments
Open

Element map (emap) on matrix returns LazySeq #42

mars0i opened this issue Oct 17, 2013 · 4 comments

Comments

@mars0i
Copy link

mars0i commented Oct 17, 2013

Applying emap to a clatrix.core.Matrix returns a LazySeq, rather than returning something that preserves the matrix's shape.

(def M (matrix [[1 2][3 4]]))
#'user/M

M
 A 2x2 matrix
 -------------
 1.00e+00  2.00e+00 
 3.00e+00  4.00e+00 

(def Mi (emap inc M))
#'user/Mi

Mi
(2.0 3.0 4.0 5.0)

(type Mi)
clojure.lang.LazySeq

Maybe this is related to issue 36?

(Feel free to let me know if I'm not doing something correctly here. First issue not for my own project.)

@mikera
Copy link
Collaborator

mikera commented Oct 17, 2013

Yep looks like a bug to me: emap should always return a amtrix of the same shape. I'll take a quick look

@mikera
Copy link
Collaborator

mikera commented Oct 20, 2013

Fixed (I think) in this PR:

#43

@mschuene
Copy link

The issue is still (again?) there:
(emap identity (matrix :clatrix [[1 2][3 4]]))
:=> (1.0 2.0 3.0 4.0)

@mikera
Copy link
Collaborator

mikera commented Apr 26, 2014

Hmmm I think my latest PR has a fix for this:
#50

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

3 participants