I'm looking for a Sparse Matrix library I can use from Ruby. I'm currently using the GNU Scientific Library bindings provided by the "gsl" gem, but my application would be better optimized if I used a dedicated sparse matrix library. I've investigated the linalg and NArray libraries. None of the these three libraries support sparse-matrix optimised storage or operations.
Is there anything out there I've missed - or an existing C library that may be possible to write bindings for? I'd prefer the former to that latter, as I haven't written C bindings in Ruby before, but I would be willing to attempt it.
NMatrix is a fast numerical linear algebra library for Ruby, with dense and sparse matrices, written mostly in C and C++ (and with experimental JRuby support). It is part of the SciRuby project. NMatrix was inspired by NArray, by Masahiro Tanaka.
Ruby is a great choice for scientific computing and data visualization. Even though other languages have more libraries - and we can not do without them - Ruby has its own place in Science and it is always a pleasure to write software in Ruby.
Even though other languages have more libraries - and we can not do without them - Ruby has its own place in Science and it is always a pleasure to write software in Ruby. But there is only one way to find out and that is by writing code!
JetBrains has kindly provided our project with an open source license for RubyMine . The Ruby Association generously awarded us with a rather large grant to fund a couple of SciRuby fellows in 2012. Thanks, Ruby Association!
Like Bill mentioned above, the a pure ruby interpretation is going to be slower than you want, but might be good for prototyping. I have been working on just such a library over at https://github.com/hmcfletch/sparse-matrix
I haven't released it as a gem yet and there is more work to be done on it, but take a look at if you stil have a need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With