Numerical ruby?

does anybody know of any good, high-speed numerical ruby libraries, kind
of
like numpy for python? any help is appreciated.

justin

ruby and ‘high speed’ are sort of antithetical terms. However, you can
always do your number crunching in C/C++ and call those functions from
ruby–if you can figure out the scratchings on the cave wall(i.e. an
“extending ruby” tutorial).

In message “Re: numerical ruby?”
on Thu, 31 Mar 2011 09:39:12 +0900, serialhex [email protected]
writes:

|does anybody know of any good, high-speed numerical ruby libraries, kind of
|like numpy for python? any help is appreciated.
|
|justin

Google NArray.

No they’re not, and what serialhex was asking about is completely
reasonable. Numpy is a
C-based Python library that provides high-speed math operations of all
sorts. Since Python and
Ruby 1.9 are quite comparable in terms of performance, it’s not at all
unreasonable
to ask if a counterpart to numpy exists for Ruby. Your dismissal is
unwarranted.

http://narray.rubyforge.org/ is an old library that handles matrix and
vector operations.
It doesn’t offer all of numpy’s options. Unfortunately, there are few
alternatives for Ruby.

Michael E.
[email protected]
http://carboni.ca/

Michael E. wrote in post #990103:

No they’re not, and what serialhex was asking about is completely
reasonable. Numpy is a
C-based Python library that provides high-speed math operations of all
sorts.

I know a little python, myself.

Your dismissal is
unwarranted.

What? Where?

Here’s the shootout results for:

1.9 vs. Python 2.x:
http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=yarv&lang2=python

1.9 vs. Python 3:
http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=yarv&lang2=python3

PyPy does a bit better, but the shootout doesn’t support Rubinius. A
1-3x difference
is quite comparable when both languages are currently up to 2 orders of
magnitude
slower than others. Plus Ruby even wins some benchmarks by smaller
margins.

Michael E.
[email protected]
http://carboni.ca/

narray is great. and if you need more capabilities, there are several
GSL bindings (I still use rb-gsl.rubyforge.org).

I’ve been using ruby for “fast” numerics and regular calculations for
a number of years, and been quite happy with them.

Cameron

On Thu, Mar 31, 2011 at 1:39 AM, serialhex [email protected] wrote:

does anybody know of any good, high-speed numerical ruby libraries, kind of
like numpy for python? any help is appreciated.

Apart from the possibilities others have mentioned, there is also
JRuby, which makes it easy to include Java code in a Ruby program.
I’ve used JRuby writing my own Java code for the numerical processing
which needs to be fast. I haven’t tried using “standard” Java
libraries, but I assume that if one can include one’s own Java
“libraries” in a Ruby program, it shouldn’t be too hard to do that
with standard Java libraries.

SWEET!! thank you both Matz & Michael, NArray looks like it might work
for
what i’m looking at.

Justin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs