【问题标题】:How to load a Apache Commons Math RealMatrix如何加载 Apache Commons Math RealMatrix
【发布时间】:2015-02-20 01:34:37
【问题描述】:

使用 Apache Common Math 加载矩阵过于复杂,使用该实用程序: MatrixUtils.deserializeRealMatrix(Object instance, String fieldName, ObjectInputStream ois)

由于您必须实现一个新类来存储“字段名”的结果。

你知道更好的方法吗?我想做的就是:

RealMatrix A = loadMatrix("myrealmatrix.dat");

【问题讨论】:

  • 这应该是一个标准函数。

标签: apache math matrix io


【解决方案1】:

序列化/反序列化方法用于 Java 对象序列化。从文件中加载RealMatrix 的最简单方法是使用this 之类的代码(已修改以处理用于表示源数据的任何格式)将文件数据加载到double[][]array 中,然后使用MatrixUtils中的createRealMatrix方法。

【讨论】:

    猜你喜欢
    • 2012-04-23
    • 1970-01-01
    • 2015-01-21
    • 2013-02-24
    • 1970-01-01
    • 2014-05-01
    • 2014-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多