I think that explicit definitions are perfectly suited for managing outer product state.
Of course, you could take advantage of tacit processing
with something like:
f=: 4 :'n%~((+&(i.x) */&({&y) +&(i.-x))@[ + ])/ 0,~i.n=.1+x-~#y'
$M =: 276 f i. 4000
276 276
But I think this approach would be slower than yours.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
