Fork me on GitHub
#core-matrix
<
2019-04-21
>
alexcatalina15:04:09

is there an obvious way to go from vectorz/vector to a standard clojure vector?

mars0i22:04:42

@alexcatalina

(def v (matrix :vectorz [1 2 3]))

mars0i22:04:57

user=> (matrix :persistent-vector v)
[1.0 2.0 3.0]
user=> (class (matrix :persistent-vector v))
clojure.lang.PersistentVector

mars0i22:04:49

My core.matrix knowledge is rusty. I'm pretty sure are probably other ways, but they're probably equivalent as far as speed, etc.

mars0i22:04:27

The idea is that even if one of the implementations is your current default, you can always add a keyword to matrix (and a few other functions, I think) to create a structure for a different implementation.

mars0i22:04:05

PersistentVector is the standard Clojure vector.