1

I'm trying to solve M (NxN) linear systems (Ax = B, B = [b1,b2,...bM]) using Ojalgo. What is the most efficient way to do this? I'd also like to know if A is singular (A, B are objects of type PrimitiveMatrix).

Any help would be greatly appreciated. Thank you!

apete
  • 1,250
  • 1
  • 10
  • 16
Nick Simos
  • 67
  • 4

1 Answers1

1

PrimitiveMatrix has a fixed/limited feature set, and you cannot control how things are done either. If you want options and control switch to using PrimitiveDenseStore (or any of the MatrixStore implementations). Then all you need to do is:

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

Did you look at the ojAlgo wiki?

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

apete
  • 1,250
  • 1
  • 10
  • 16