core-matrix

intended for specific discussion around core.matrix (usage and development) For general data work check out #data-science
2015-08-27T07:23:19.000018Z

@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?

2015-08-27T07:31:04.000019Z

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

2015-08-27T07:31:51.000020Z

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

2015-08-27T07:33:02.000021Z

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

2015-08-27T07:34:31.000022Z

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

2015-08-27T07:38:23.000023Z

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

tnoda 2015-08-27T07:59:09.000024Z

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.

tnoda 2015-08-27T07:59:39.000025Z

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

2015-08-27T08:10:46.000026Z

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

2015-08-27T08:10:56.000027Z

=> (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]]

2015-08-27T08:11:50.000028Z

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

2015-08-27T12:40:41.000029Z

@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 ;)

2015-08-27T12:41:13.000030Z

find, that is :)