File: testmatrix.rb

package info (click to toggle)
libnarray-ruby 0.5.9p7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 432 kB
  • ctags: 517
  • sloc: ansic: 4,412; ruby: 1,281; python: 91; makefile: 5
file content (13 lines) | stat: -rw-r--r-- 245 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
require "narray"

m = NMatrix.float(3,3,3).indgen!

puts
puts 'm  #=>'
p m			#=> NMatrix.float(3,3,3):
puts
puts 'm[1,1,true]  #=>'
p m[1,1,true]		#=> NArray.float(3): 
puts
puts 'm[0..1,2,true]  #=>'
p m[0..1,2,true]	#=> NMatrix.float(2,1,3):