Clojure矩阵表示 [英] Clojure Matrix Representation

查看:184
本文介绍了Clojure矩阵表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Clojure中矩阵的好表示?我有兴趣处理浮点数的密集矩阵。

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 to mind, but is there something better?

好的表现形式的一些标准包括:

Some criteria for a good representation include:


  • 效率:它们不会用于大量数据集的常量处理,但我不想花费数小时计算可以在几分钟内完成更好设计的结果

  • Java互操作性:很容易在两种语言之间来回传递数据。

  • 轻松并行化:如果我可以使用所有的核心只需简单地替换 map pmap ,这将是很好的。

  • 使用 reduce :似乎很多计算我做的很好与 reduce
  • Efficiency: They won't be used for constant processing of huge data sets, but I don't want to spend hours calculating results that could have been done in minutes with a better design.
  • Java Interoperability: It would be nice to pass the data back and forth between the two languages easily.
  • Easy Parallelization: If I can use all the cores available simply by replacing map with pmap, that would be nice.
  • Amenable to the use of reduce: It seems like lots of the calculations I'm doing work very well with reduce.
  • Ability to Represent Image Scan Lines in Matrix Rows: Not really very important, but would be nice to have.

有任何想法吗?

推荐答案

Incanter 提供了 Parallel Colt ,包括看起来是一个相当不错的实现快速,并行化的密集矩阵,与Clojure的基于seq的库接口。我没有使用它,但它应该是你要找的。

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.

示例

这篇关于Clojure矩阵表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆