用于代数、数学的 Java/Scala 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5193781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java/Scala library for algebra, mathematics
提问by Robert Zaremba
Can you advise me some flexible and powerful, yet fast library which could cover SciPy (both in performance and functionality). I found SciPy very expressive - but I want to try something in Scala.
你能告诉我一些灵活、强大但快速的库,它可以涵盖 SciPy(在性能和功能方面)。我发现 SciPy 非常有表现力——但我想在 Scala 中尝试一些东西。
I read a little about Scala - but is not as featured as SciPy. Any alternatives? Maybe Java library?
我读了一些关于 Scala 的书——但不像 SciPy 那样有特色。任何替代方案?也许Java库?
采纳答案by Rex Kerr
The functionality in Scipy is rather Matlab-like. So the question is whether you just want the core linear algebra / vector-matrix mathematics operations, or all sorts of things like clustering.
Scipy 中的功能类似于 Matlab。所以问题是你是否只想要核心线性代数/向量矩阵数学运算,或者像聚类这样的各种东西。
If you are not aware of both Scalala(now called Breeze) and ScalaLab, you should check them out--maybe they'll suit your needs.
如果您不知道Scalala(现在称为Breeze)和ScalaLab,您应该检查它们——也许它们会满足您的需求。
If you need a more diverse library, there are a couple of Java libraries that might be suitable: CERN Coltand Apache Commons Math; these are intended to be used in Java style, however, and you're pretty much limited to using them that way from within Scala. (Though of course you can wrap the bits that you use particularly heavily in something prettier.)
如果您需要更多样化的库,有几个 Java 库可能是合适的:CERN Colt和Apache Commons Math;然而,这些旨在以 Java 风格使用,并且您几乎只能在 Scala 中以这种方式使用它们。(当然,您可以将特别频繁使用的部分包装在更漂亮的东西中。)
回答by oxbow_lakes
回答by Vladimir Kostyukov
There is a la4j(Linear Algebra for Java) library that can be used from Scala environment but it doesn't contain any Scala features like hi-order functions since Java doesn't support it. la4j was designed to be used in imperative environment (not functional). So if you want to use it in functional way - Scalalais the best chose.
有一个la4j(Java 线性代数)库可以在 Scala 环境中使用,但它不包含任何 Scala 功能,如高阶函数,因为 Java 不支持它。la4j 旨在用于命令式环境(非功能性)。因此,如果您想以功能方式使用它 - Scalala是最佳选择。

