Scientific Programming with Ruby
Asked Answered
N

3

8

I was doing the mathematical calculations with python or octave because of availability of really nice functions and libraries at hand. But recently I gained interest in ruby and I wonder if there is an equivalent in Ruby to the numpy, scipy in Python for scientific programming. Specifically, I'm looking something that I can draw plots as in matplotlib and do mathematical, algebraic calculations quickly as in numpy and scipy.

Normally answered 23/1, 2011 at 16:50 Comment(0)
P
6

Linear algebra is at the heart of most large-scale scientific computing. LAPACK is the gold standard for linear algebra libraries, first written in FORTRAN.

There's a port to Ruby here. Once you have that, the rest is incidental, but there are also plotting routines in Ruby.

Parliamentary answered 23/1, 2011 at 17:12 Comment(1)
I've spent a couple of hours installing it and fighting with legacy fortran dependencies, here are the instructions, hopefully it will save time to someone: quora.com/Installation-Instructions/…Teraterai
M
9

SciRuby is working on this. NMatrix and Statsample are probably the most useful SciRuby gems for linear algebra and statistics, respectively, though you might also find these useful: distribution, minimization, and integration.

As far as visualization and plotting goes, check out Rubyvis (a Ruby port of Protovis). Nyaplot is also coming along nicely.

If you need something more stable than NMatrix, there's always NArray.

I'm also surprised no one has mentioned Ruby/GSL. There's also a fork which supports NMatrix over in the SciRuby github account.

Full disclosure: I'm an admin for SciRuby, but I don't make any money off of it. =)

Mayfair answered 24/4, 2013 at 21:8 Comment(1)
Remark: @mohawkjohn (John Woods) has received pat on the shoulder from Matz himself to develop the all-important NMatrix library, using Fortran routines for speed.Supplication
P
6

Linear algebra is at the heart of most large-scale scientific computing. LAPACK is the gold standard for linear algebra libraries, first written in FORTRAN.

There's a port to Ruby here. Once you have that, the rest is incidental, but there are also plotting routines in Ruby.

Parliamentary answered 23/1, 2011 at 17:12 Comment(1)
I've spent a couple of hours installing it and fighting with legacy fortran dependencies, here are the instructions, hopefully it will save time to someone: quora.com/Installation-Instructions/…Teraterai
C
3

I compared and gave examples for a number of different plotting libraries that you can use from Ruby. I hope that helps with the second part of your question.

Confectionery answered 24/9, 2011 at 13:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.