1 ! Copyright (C) 2012 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays.shaped kernel math sequences tools.test ;
23 } >shaped-array shape>>
36 { sa{ 1 } } [ { } ones ] unit-test
37 { sa{ 1 } } [ { 1 } ones ] unit-test
39 { sa{ 0 } } [ { } zeros ] unit-test
40 { sa{ 0 } } [ { 1 } zeros ] unit-test
42 ! Error on 0, negative shapes
45 sa{ { 1 3 3 } { 4 1 3 } { 4 4 1 } }
47 { 3 3 } 2 strict-lower
48 [ drop 3 ] map-strict-upper
49 [ drop 1 ] map-diagonal
50 [ sq ] map-strict-lower
54 { } [ 15 <iota> { 3 5 1 } reshape drop ] unit-test