Frame agreement: Difference between revisions
Jump to navigation
Jump to search
m (→Model) |
m (→Model: replace with a more symmetric computation of cell ranks; no need for tables) |
||
Line 132: | Line 132: | ||
assert←{0≡⍵:'no common frame prefix' ⎕SIGNAL 4 ⋄ ⍵} | assert←{0≡⍵:'no common frame prefix' ⎕SIGNAL 4 ⋄ ⍵} | ||
r←1↓⌽3⍴⌽⍵⍵ ⋄ pp←≢¨p←⍴¨⍺⍵ ⍝ dyadic ranks, array ranks | r←1↓⌽3⍴⌽⍵⍵ ⋄ pp←≢¨p←⍴¨⍺⍵ ⍝ dyadic ranks, array ranks | ||
c←r{ | c←r{⍺>0:⍺⌊⍵ ⋄ 0⌈⍺+⍵}¨pp ⍝ cell ranks | ||
fl fr←(-c)↓¨p ⍝ frames | fl fr←(-c)↓¨p ⍝ frames | ||
s←fl{⍺<⍥≢⍵:⍺ ⋄ ⍵}fr ⍝ shorter frame | s←fl{⍺<⍥≢⍵:⍺ ⋄ ⍵}fr ⍝ shorter frame | ||
Line 152: | Line 152: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Works in|[[Dyalog APL]]}} | {{Works in|[[Dyalog APL]]}} | ||
[[Category:Leading axis theory]][[Category:Function characteristics]][[Category:Conformability]]{{APL features}} | [[Category:Leading axis theory]][[Category:Function characteristics]][[Category:Conformability]]{{APL features}} |