2

There have been a few questions inquiring about general math/stats frameworks for Scala.

I am interested in only one specific problem, that of solving a large sparse linear system. Essentially I am looking for an equivalent of scipy.sparse.linalg.spsolve.

Currently I am looking into breeze-math of ScalaNLP Breeze, which looks like it would do the job, except that the focus of this library collection is natural language processing, so it feels a bit strange to use that.

Saddle also looks promising, but not very mature yet, and looking at its dependencies, EJML doesn't seem to have sparse functionality, while Apache commons math did, but it was flaky.

Has anyone got a reasonably simple and efficient solution that is currently available?

Community
  • 1
  • 1
mitchus
  • 4,677
  • 3
  • 35
  • 70
  • Any helpful suggestions from the voters-to-close? – mitchus Aug 22 '13 at 14:46
  • 2
    [Colt](http://acs.lbl.gov/software/colt/api/cern/colt/matrix/linalg/Algebra.html) is still my go-to library for this kind of thing (but I know I should give Breeze another try one of these days). – Travis Brown Aug 22 '13 at 15:13
  • 1
    I'm sure the closers will cite the "Questions asking us to recommend or find a tool, library blah blah blah" language. Personally I think this is a perfectly reasonable question. – Travis Brown Aug 22 '13 at 15:16

1 Answers1

2

Although ScalaNLP Breeze says it's for NLP, it's linear algebra library is fairly general and not specialized to NLP. With that said, you could easily do something like this:

  val A = new CSCMatrix[Int]()
  val B = new CSCMatrix[Int]()

  val x = A \ B
Noah
  • 13,821
  • 4
  • 36
  • 45