view test/gsp111.ijs @ 0:e0bbaa717f41 draft default tip

lol J
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 25 Nov 2013 11:56:30 -0500
parents
children
line wrap: on
line source

NB. *. ------------------------------------------------------------------

f=: 3 : '(*.q) -: *.(2;y)$.q'

q=:     ?  2 4 5 3$5
c=: ; (i.1+r) <"1@comb&.>r=:#$q
f&> c

q=: j./ ?2 2 4 5 3$5
c=: ; (i.1+r) <"1@comb&.>r=:#$q
f&> c

(*.3ar3+i.2 3)               -: *.     3ar3+$.i.2 3

'non-unique sparse elements' -: *. etx 3ar4+$.i.2 3

f=: 4 : '(p*.q) -: ((2;x)$.p) *. (2;y)$.q'
g=: 3 : '(a*.q) -: a          *. (2;y)$.q'

p=: (?2 4 5$2) * ?2 4 5 3$2
q=: (?2 4 5$2) * ?2 4 5 3$2
a=: ?2
c=: ; (i.1+r) <"1@comb&.>r=:#$p
f&>/~c
g&>c

p=: (?7 5$2) * ?7 5 3$4e6
q=: (?7 5$2) * ?7 5 3$4e6
a=: ?1e6
c=: ; (i.1+r) <"1@comb&.>r=:#$p
f&>/~c
g&>c

p=: (?7 5$2) * o.?7 5 3$4
q=: (?7 5$2) * o.?7 5 3$4
a=: o.?16
c=: ; (i.1+r) <"1@comb&.>r=:#$p
f&>/~c
g&>c

p=: (?7 5$2) * j./?2 7 5 3$4
q=: (?7 5$2) * j./?2 7 5 3$4
a=: j./?26 26
c=: ; (i.1+r) <"1@comb&.>r=:#$p
f&>/~c
g&>c


4!:55 ;:'a c f g p q r'