File: lu.rb

package info (click to toggle)
libnarray-ruby 0.5.9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 564 kB
  • ctags: 564
  • sloc: ansic: 4,620; ruby: 1,513; python: 70; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 255 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'mybench'

n = 1000
m = NArray.float(n,n).indgen!
m = m % (n+1) + 1
m = NMatrix.ref(m).transpose

puts 'm ='
p m

printf "executing %ix%i LU...\n",n,n
bench_time(1){lu = m.lu}
exit

puts 'lu='
p lu
puts 'y='
p y
puts 'm*y='
p m*y

#system "ps -v"