发布于 2014-12-29 00:01:36 | 478 次阅读 | 评论: 0 | 来源: 网友投递
Apache Commons
Apache Commons项目的由三部分组成:The Commons Proper - 一个可重用的Java组件库。The Commons Sandbox - Java组件开发工作区. The Commons Dormant - 当前处于非活动状态的组件库.
Apache Commons Math 3.4 发布,此版本是个 bug 修复版本,同时也包括一些新特性。此版本对现有特性对于向后兼容方面允许嵌入替代 v3.3. JAR 文件。此版本最值得关注的是:新版本 (Gumbel, Laplace,
Logistic, Nakagami);改进百分数值算法(更好的处理常规算法的 NANs,添加了一个新的 storeless 实现)。此版本修复了两次立方和六次立方的相关问题。此版本还有大量的 bug 修复和相关的性能和健壮性方面的提升。
此版本最低要求 Java 5,强烈建议用户升级到此版本,不单单的 bug 修复,还有大量的废弃类。
完整改进列表请看发行说明:
http://www.apache.org/dist/commons/math/RELEASE-NOTES.txt
源代码和二进制下载:
http://commons.apache.org/proper/commons-math/download_math.cgi
Maven :
GroupId: org.apache.commons
ArtifactId: commons-math3
Version: 3.4
Commons Math 是 Apache 上一个轻量级自容器的数学和统计计算方法包,包含大多数常用的数值算法。
示例代码:
// Create a real matrix with two rows and three columns double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}}; RealMatrix m = new Array2DRowRealMatrix(matrixData); // One more with three rows, two columns double[][] matrixData2 = { {1d,2d}, {2d,5d}, {1d, 7d}}; RealMatrix n = new Array2DRowRealMatrix(matrixData2); // Note: The constructor copies the input double[][] array. // Now multiply m by n RealMatrix p = m.multiply(n); System.out.println(p.getRowDimension()); // 2 System.out.println(p.getColumnDimension()); // 2 // Invert p, using LU decomposition RealMatrix pInverse = new LUDecompositionImpl(p).getSolver().getInverse();