From: Admin Tensor Date: 2012-09-09T03:26:23+09:00 Subject: Re: Using ruby for scientific computing Olivier Saut wrote in post #1075138: > Hi all, > > For pedagogic purposes, I am trying to solve simple partial differential > equations (say a diffusion equation on a regular mesh in 2D) with Ruby. > Using the NArray gem, I have built a satisfactory tool from an interface > (and ease of use) point of view but the performance are suboptimal. ....... > I am wondering what is the best way to tackle this performance problem : > 1. Improve the ruby code (and how? :) Should I avoid using hashes? > 2. Write an extension to perform these operations in C. BTW is there a > way to access directly NArray data (without copy) from a C extension? > 3. Use a wrapper like Ruby-lapack > ( > https://rubyforge.org/projects/ruby-lapack/ > ). > > What do you think? > > Thanks for your help ! Hi, Because it seems that you emphasize on performance, I think the best way is to use GNU Octave for dealing with the sparse matrices. There is a Ruby gem (octave-ruby) to bridge between Ruby and Octave objects. I really like Ruby, but for scientific computing I think for now Python has better libraries. Regards, Bill -- Posted via http://www.ruby-forum.com/.