From: Olivier Saut Date: 2002-12-01T08:17:18+09:00 Subject: Numerical Ruby Hi all, I am now using Ruby to test my numerical schemes. Using Ruby for this task was a real pleasure (I usually code in F90). The computations run just fine but I would like to have a result a little faster. My code uses lots of loops as in the following example. def faraday for y in 1..(maxY-1) for z in 1..(maxZ-1) @Bx[y,z]+=-(dt/dy)*(@Ez[y+1,z]-@Ez[y,z])+(dt/dz)*(@Ey[y,z+1]-@Ey[y,z]) @By[y,z]+= - (dt/dz)*(@Ex[y,z+1]-@Ex[y,z]) @Bz[y,z]+=(dt/dy)*(@Ex[y+1,z]-@Ex[y,z]) end end end I am using NArray from Masahiro Tanaka (http://www.ir.isas.ac.jp/~masa/ruby/index-e.html) to represent the electromagnetic field. Is there any way to speed up this type of computations? (I am not sure how a C extension could help in this case.) BTW, is there any trend to develop the use of Ruby in the field of scientific computations (as it seems to be the case with Python)? Will NArray be included in the standard library? Thanks! - Olivier