|
133 | 133 | J2V←9 11∘○¨ ⍝ convert new 1J2 notation to old vector notation (matrix of real-cmpx pairs) |
134 | 134 | Call←{(⍎⍺⍺ Assoc ⍵⍵)⍵} ⍝ Call external fn ⍺⍺ with arg ⍺, associate with types ⍵⍵ if necessary |
135 | 135 | Assoc←{3=⎕NC ⍺:⍺ |
136 | | - call←'lapack',(¯2↑'32',⎕D∩⍨⊃# ⎕WG'APLVersion'),'|',⍺,' ',⍵ |
| 136 | + plat←⊃# ⎕WG'APLVersion' |
| 137 | + bits←¯2↑'32',⎕D∩⍨plat |
| 138 | + ext←'.so'/⍨'Linux'≡5↑plat |
| 139 | + call←'lapack',bits,ext,'|',⍺,' ',⍵ |
137 | 140 | 0::'*** ERROR ',(⍕⎕EN),': ⎕NA''',call,'''' |
138 | 141 | ⎕NA call} |
139 | 142 |
|
|
202 | 205 | ∇ |
203 | 206 |
|
204 | 207 | Fourier←{⍺←1 ⋄ ⍵ RunFn 'idft' 'dft'⊃⍨1+0⌈⍺} |
205 | | - ∇ data←data RunFn func;rank;shape;count ⍝ n-D Discrete Fourier Transformation |
| 208 | + ∇ data←data RunFn func;rank;shape;count;plat;bits;ext ⍝ n-D Discrete Fourier Transformation |
206 | 209 | (rank count)←(⍴,×/)shape←⍴data |
207 | 210 | :If 1<count ⍝ non-scalar |
208 | 211 | :If 3≠⎕NC func ⍝ associate external function if it does not exist |
209 | | - ⎕NA'fftw',(¯2↑'32',⎕D∩⍨⊃# ⎕WG'APLVersion'),'|',func,'<I4 <I4[] =J16[]' |
| 212 | + plat←⊃# ⎕WG'APLVersion' |
| 213 | + bits←¯2↑'32',⎕D∩⍨plat |
| 214 | + ext←'.so'/⍨'Linux'≡5↑plat |
| 215 | + ⎕NA'fftw',bits,ext,'|',func,'<I4 <I4[] =J16[]' |
210 | 216 | :EndIf |
211 | 217 | data←(count*0.5)÷⍨shape⍴(⍎func)rank shape,⊂∊data ⍝ Normalized Fourier/Inverse Fourier transform |
212 | 218 | :EndIf |
|
0 commit comments