Clojure Matrix Representation

前端 未结 8 460
-上瘾入骨i
-上瘾入骨i 2020-12-29 15:10

What is a good representation for matrices in Clojure? I\'m interested in dealing with dense matrices of floating point numbers. The \"list of lists\" representation springs

相关标签:
8条回答
  • 2020-12-29 15:26

    Incanter supplies a wrapper around some of Parallel Colt, including what looks to be a pretty decent implementation of fast, parallelized dense matrices that interface with Clojure's seq-based libraries. I haven't used it, but it should be what you're looking for.

    Example.

    0 讨论(0)
  • 2020-12-29 15:27

    Check out the core.matrix proposal + experimental implementation here:

    https://github.com/mikera/matrix-api

    Very early days at time of writing, but worth keeping an eye on.

    0 讨论(0)
  • 2020-12-29 15:27

    the answers may need to be updated as 8 years passed. A quick google search shows that if you need to be compatible with Clojure core.matrix API, you can use core.matrix itself or other implementations such as vectorz-clj.

    In addition I found Neanderthal which is optimized for GPU

    0 讨论(0)
  • 2020-12-29 15:29

    I'm writing a matrix library wrapping jblas called, tentatively, Clatrix. It's missing a lot of features I still want to add, but it's got most of what you might be looking for. Take a look, http://github.com/tel/clatrix.

    0 讨论(0)
  • 2020-12-29 15:33

    I am presently using the list of lists approach in cryptovide because its very important for this application to keep things lazy. I am also considering switching to a more efficient approach as long as it kept at least the outward representation lazy.

    0 讨论(0)
  • 2020-12-29 15:36

    I recently wrote some code that needed matrix maths, and initially I used vector-of-vectors, map & reduce, but found the resulting code hard to understand when I returned to it (I'm new to Clojure mind). Incanter made the same code very terse, easy to understand (standard matrix ops) and much much faster.

    0 讨论(0)
提交回复
热议问题