mikera / vectorz-clj

Fast matrix and vector maths library for Clojure - as a core.matrix implementation
203 stars 19 forks source link

Issues and inconsistencies in making block matrices #70

Open kxygk opened 5 years ago

kxygk commented 5 years ago

I was forced to switch implementations b/c for some reason the default implementation doesn't implement the full matrix.core API (specifically the lu function)

However once I switched to vectorz my old code stopped working

> (set-current-implementation :persistent-vector)
:persistent-vector
> (block-diagonal-matrix [(identity-matrix 2) (identity-matrix 2)])
[[1.0 0.0 0.0 0.0]
 [0.0 1.0 0.0 0.0]
 [0.0 0.0 1.0 0.0]
 [0.0 0.0 0.0 1.0]]
> (set-current-implementation :vectorz)
:vectorz
> (block-diagonal-matrix [(identity-matrix 2) (identity-matrix 2)])
Execution error (ClassCastException) at clojure.core.matrix.impl.defaults/eval16737$fn$aux$iter$fn$fn (defaults.cljc:2202).
class mikera.matrixx.impl.IdentityMatrix cannot be cast to class clojure.lang.IFn (mikera.matrixx.impl.IdentityMatrix and clojure.lang.IFn are in unnamed module of loader 'app')