【问题标题】:Using Ojalgo to solve linear systems in Java在 Java 中使用 Ojalgo 求解线性系统
【发布时间】:2016-05-30 17:39:59
【问题描述】:

我正在尝试使用 Ojalgo 求解 M (NxN) 个线性系统(Ax = B,B = [b1,b2,...bM])。最有效的方法是什么?我还想知道 A 是否是单数(A、B 是 PrimitiveMatrix 类型的对象)。

任何帮助将不胜感激。谢谢!

【问题讨论】:

    标签: java linear-algebra ojalgo


    【解决方案1】:

    PrimitiveMatrix 具有固定/有限的功能集,您也无法控制事情的完成方式。如果您希望选项和控制切换到使用 PrimitiveDenseStore(或任何 MatrixStore 实现)。那么你需要做的就是:

        final LU<Double> tmpLU = LU.PRIMITIVE.make();
        tmpLU.decompose(A);
        if (tmpLU.isSquareAndNotSingular()) {
            x = tmpLU.solve(b);
        } else {
            // Do something else...
        }
    

    你看过 ojAlgo 维基吗?

    https://github.com/optimatika/ojAlgo/wiki

    【讨论】:

    • 不,我没有查看 ojAlgo wiki,但我一定会查看的!非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2020-04-03
    • 2017-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 2018-01-17
    • 2019-01-15
    相关资源
    最近更新 更多