File: testarray.rb

package info (click to toggle)
ruby-narray 0.6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: ansic: 4,498; ruby: 1,329; python: 91; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'narray'

a = NArray.float(3,3).indgen

p NArray[a,[100,101]]

b = NArray[ [ [ 0.0, 1.0, 2.0 ], 
              [ 3.0, 4.0, 5.0 ], 
              [ 6.0, 7.0, 8.0 ] ],
            [100,101] ]
p b

a = NArray.float(2,2).indgen

b = NArray[ a,[a] ]
p b

b = NArray[ [ 0.0, 1.0 ], 
            [ [ 0.0, 1.0 ] ] ]
p b