« first day (1622 days earlier)      last day (154 days later) » 

2:32 AM
img×(-a)↓a↓{+/,g×⍵}⌺s⊢(⍪⍨⍪⊢)(,⍨,⊢)img
is it possible to improve this computation? it does stencil on a torus by padding. I tried the stencell mentioned in dyalog blog but that gives a WS FULL on 64 64 array.
 
What is s?
I guess it's convolution size
But I don't expect that to give WS FULL, as (⍪⍨⍪⊢)(,⍨,⊢)img should give a (64×3)(64×3) array which is not that large
 
s is 1+2×⌊2÷⍨3 5, where img is a 2D array
 
Btw 1+2×⌊2÷⍨x y is simply x y if x and y are odd
An obvious improvement would be changing (⍪⍨⍪⊢)(,⍨,⊢) to pad just what you need
 
x y is even.
let me try if trim the padded array would improve the performance
yes, img×(-h)↓(h←a÷2)↓{+/,g×⍵}⌺s⊢(2⊖⍪⍨)(2⌽,⍨)img gives 1 third improvement on performance
thank you for the suggestion
 
3:05 AM
oh, I made a typo, s is 1+2×⌊2÷⍨⍴img
the roughly same size of img rounded to have odd edge sizes
 
 
15 hours later…
6:25 PM
Job opportunities: Do you like watching APL videos? Check out the two new listings, one for volunteer work and one paid internship!
2
 

« first day (1622 days earlier)      last day (154 days later) »