I would say this is not really worth the time to make into special code rather than just using the obta conjunction. There just don't seem to be uses beyond polynomial multiplication.
Also, it seems like it would be quicker to do a convolution using Fourier series: pad each polynomial with zeros, convert to a Fourier series, add, and convert back. Marshall -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of R.E. Boss Sent: Sunday, December 26, 2010 1:09 PM To: 'Programming forum' Subject: [Jprogramming] Poposal for special code voor dyadic f/.@:(g/) In <http://www.jsoftware.com/jwiki/RE%20Boss/J-blog/Special%20code%20for%20f/.% 40:g> http://www.jsoftware.com/jwiki/RE%20Boss/J-blog/Special%20code%20for%20f/.%4 0:g I define the conjunction 'obta' - oblique at table. f obta g is equivalent to f/.@:(g/) but is much leaner and a bit faster. See the wiki-page for the detailed figures. obta=: 2 : 0 assert. 'dyad only' : assert. >{.(x *.&(1...@$) y) ; 'vectors only' if. x -: y do. (u@:(v|.)\y) , }.u@:(v|.)\.y else. 's t'=: x ,&# y z=. $0 if. s=t do. y=.|.y if. x-:y do. z=.(u@:(v@:(,:|.))\y) , }.u@:(v@:(,:|.))\.y else. NB. y=.|.y z=. i.0 1 for_j. i.&.<: s do. z=.z, ((j{.x) u@:v (-j){.y) , ((-j){.x) u@:v j{.y end. end. elseif. s<t do. y=.|.y for_j. i.&.<:s do. z=.z, (j{.x) u@:v (-j){.y end. z=.z, |.s x&(u@:v)\y for_j. |.i.&.<: s do. z=.z, ((-j){.x) u@:v j{.y end. elseif. s>t do. y=.|.y for_j. i.&.<:t do. z=.z, (j{.x) u@:v (-j){.y end. z=.z, t (u@:v)&y\x for_j. |.i.&.<: t do. z=.z, ((-j){.x) u@:v j{.y end. end. end. ) R.E. Boss ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
