-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure and put everything under LINK
This also removes the need for a BUILD or ROOT variable. Should be more agnostic to platform.
- Loading branch information
Showing
101 changed files
with
370 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
)RESET | ||
BUILD ROOT | ||
)SAVE | ||
codfns.AF∆LIB←'cpu' | ||
TEST'ALL' |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
DISPLAY←{⎕IO ⎕ML←0 ⍝ Boxed display of array. | ||
|
||
⍺←1 ⋄ chars←⍺⊃'..''''|-' '┌┐└┘│─' ⍝ ⍺: 0-clunky, 1-smooth. | ||
|
||
tl tr bl br vt hz←chars ⍝ Top left, top right, ... | ||
|
||
box←{ ⍝ Box with type and axes. | ||
vrt hrz←(¯1+⍴⍵)⍴¨vt hz ⍝ Vert. and horiz. lines. | ||
top←(hz,'⊖→')[¯1↑⍺],hrz ⍝ Upper border with axis. | ||
bot←(⊃⍺),hrz ⍝ Lower border with type. | ||
rgt←tr,vt,vrt,br ⍝ Right side with corners. | ||
lax←(vt,'⌽↓')[¯1↓1↓⍺],¨⊂vrt ⍝ Left side(s) with axes, | ||
lft←⍉tl,(↑lax),bl ⍝ ... and corners. | ||
lft,(top⍪⍵⍪bot),rgt ⍝ Fully boxed array. | ||
} | ||
|
||
deco←{⍺←type open ⍵ ⋄ ⍺,axes ⍵} ⍝ Type and axes vector. | ||
axes←{(-2⌈⍴⍴⍵)↑1+×⍴⍵} ⍝ Array axis types. | ||
open←{(1⌈⍴⍵)⍴⍵} ⍝ Expose null axes. | ||
trim←{(~1 1⍷∧⌿⍵=' ')/⍵} ⍝ Remove extra blank cols. | ||
type←{{(1=⍴⍵)⊃'+'⍵}∪,char¨⍵} ⍝ Simple array type. | ||
char←{⍬≡⍴⍵:hz ⋄ (⊃⍵∊'¯',⎕D)⊃'#~'}∘⍕ ⍝ Simple scalar type. | ||
line←{(6≠10|⎕DR' '⍵)⊃' -'} ⍝ underline for atom. | ||
|
||
{ ⍝ Recursively box arrays: | ||
0=≡⍵:' '⍪(open ⎕FMT ⍵)⍪line ⍵ ⍝ Simple scalar. | ||
1 ⍬≡(≡⍵)(⍴⍵):'∇' 0 0 box ⎕FMT ⍵ ⍝ Object rep: ⎕OR. | ||
1=≡⍵:(deco ⍵)box open ⎕FMT open ⍵ ⍝ Simple array. | ||
('∊'deco ⍵)box trim ⎕FMT ∇¨open ⍵ ⍝ Nested array. | ||
}⍵ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INIT | ||
LINK | ||
UT.sac←1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
LINK;opts;root | ||
root←(⊃⎕NPARTS ⎕WSID),'src' | ||
'#' root ⎕SE.Link.Create⍨opts⊣opts.(source watch)←⊂'dir'⊣opts←⎕NS ⍬ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MK∆UCMD | ||
UNLINK | ||
⎕SE.SALT.Save'codfns ',(⊃⎕NPARTS ⎕WSID),'\codfns.dyalog' | ||
LINK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PP←{⍵⊣⎕←#.DISPLAY ⍵} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TEST N | ||
util.TEST N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
UNLINK | ||
⎕SE.Link.Break'#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:Namespace FNS | ||
|
||
##.P2D←{z←⍪⍳≢⍵ ⋄ d←⍵≠,z ⋄ _←{p⊣d+←⍵≠p←⍺[z,←⍵]}⍣≡⍨⍵ ⋄ d(⍋(-1+d)↑⍤0 1⊢⌽z)} | ||
|
||
Xml←{⍺←0 ⋄ ast←⍺{d i←P2D⊃⍵ ⋄ i∘{⍵[⍺]}¨(⊂d),1↓⍺↓⍵}⍣(0≠⍺)⊢⍵ ⋄ d t k n←4↑ast | ||
cls←N∆[t],¨('-..'[1+×k]),¨⍕¨|k ⋄ fld←{((≢⍵)↑3↓f∆),⍪⍵}¨↓⍉↑3↓ast | ||
⎕XML⍉↑d cls(⊂'')fld} | ||
##.Xml←Xml | ||
|
||
##.dct←{⍺[(2×2≠/n,0)+(1↑⍨≢m)+m+n←⌽∨\⌽m←' '≠⍺⍺ ⍵]⍵⍵ ⍵} | ||
##.dlk←{((x⌷⍴⍵)↑[x←2|1+⍵⍵]⍺),[⍵⍵]⍺⍺@(⊂0 0)⍣('┌'=⊃⍵)⊢⍵} | ||
##.dwh←{⍵('┬'dlk 1)' │├┌└─'(0⌷⍉)dct,⊃⍪/((≢¨⍺),¨⊂⌈/≢∘⍉¨⍺)↑¨⍺} | ||
##.dwv←{⍵('├'dlk 0)' ─┬┌┐│'(0⌷⊢)dct(⊣⍪1↓⊢)⊃{⍺,' ',⍵}/(1+⌈/≢¨⍺){⍺↑⍵⍪⍨'│'↑⍨≢⍉⍵}¨⍺} | ||
|
||
pp3←{⍺←'○' ⋄ d←(⍳≢⍵)≠⍵ ⋄ _←{z⊣d+←⍵≠z←⍺[⍵]}⍣≡⍨⍵ ⋄ lbl←⍺⍴⍨≢⍵ | ||
lyr←{i←⍸⍺=d ⋄ k v←↓⍉⍵⍵[i],∘⊂⌸i ⋄ (⍵∘{⍺[⍵]}¨v)⍺⍺¨@k⊢⍵}⍵ | ||
(⍵=⍳≢⍵)⌿⊃⍺⍺ lyr⌿(1+⍳⌈/d),⊂⍉∘⍪∘⍕¨lbl} | ||
##.pp3←pp3 | ||
|
||
lb3←{⍺←⍳≢⊃⍵ | ||
'(',¨')',¨⍨{⍺,';',⍵}⌿⍕¨(N∆{⍺[⍵]}@2⊢(2⊃⍵){⍺[|⍵]}@{0>⍵}@4↑⊃⍵)[⍺;]} | ||
##.lb3←lb3 | ||
|
||
:EndNamespace |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:Namespace GLOBAL | ||
|
||
##.(⎕IO ⎕ML ⎕WX VERSION AF∆PREFIX AF∆LIB)←0 1 3 (3 1 0) '/opt/arrayfire' 'cuda' | ||
|
||
:EndNamespace |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.