Fork me on GitHub
#core-matrix
<
2015-08-27
>
mikera07:08:19

@blueberry my whole point is that Neanderthal could and probably should be the direct byte buffer backed core.matrix implementation. Do have any reason not to make it into a core.matrix implementation?

mikera07:08:04

I started in a similar position: I needed a pure-JVM matrix implementation in Clojure so I wrote vectorz-clj

mikera07:08:51

But then I realized that it would be far better for the ecosystem if we created a standard API that would support multiple different implementations. That was how core.matrix was born

mikera07:08:02

I then retro-fitted vectorz-clj to work with core.matrix. It was really easy: only took an hour or two to get it working and maybe a couple of days to add some optimised fast paths for the other protocols. You could do exactly the same with Neanderthal

mikera07:08:31

I strongly encourage you to try out the same approach.... it would be great if we can maintain compatibility across the various tools in the ecosystem

mikera07:08:23

For example, you could then just do (set-current-implementation :neanderthal) if you want to use Neanderthal as the matrix librray for Incanter

tnoda07:08:09

mikera: thank you for pointing out the core.matrix API information to support Java 2D vectors as core.matrix objects. I will go over that.

tnoda07:08:39

(set-current-implementation :neanderthal) sounds great 😇

mikera08:08:46

@tnoda no problem. Note that core.matrix already supports 2D double arrays in a sense, you can do stuff like

mikera08:08:56

=> (def da (clojure.core.matrix.impl.double-array/to-double-arrays [[1 2] [3 4]])) #'clojure.core.matrix/da => da [[1.0, 2.0], [3.0, 4.0]] => (class da) [[D => (mul da 3) [[3.0 6.0] [9.0 12.0]]

mikera08:08:50

The main reason for specialised protocol implementations for double[][] instances would be to boost performance for these cases

blueberry12:08:41

@mikera It's very fortunate that it is that easy and requires only a couple of hours since I'm sure someone will found spare time to do it ;)

blueberry12:08:13

find, that is :)