I am working on another approach using oblique and
cannot quite finish it, but it looks quite promising. I look
only at a small case, and focus on the sums in the full
symmetric pairwise squares matrix.
NB. consider this simple example
3 calcAvgOP i. 6
6.5 5 3.5
10 7.5 5
13.5 10 6.5
NB. (2x2) matrices float northeasterly
NB. in the next output
;/3 (*"0 1 |.)\ i. 6
+-----+-----+-------+--------+
|0 0 0|3 2 1| 8 6 4|15 12 9|
|2 1 0|6 4 2|12 9 6|20 16 12|
|4 2 0|9 6 3|16 12 8|25 20 15|
+-----+-----+-------+--------+
NB. obliquely summing each 4 produces
NB. all the different results needed
NB. in the final output way above
<@(%&4)@(4+/\])/.(*"0 1 |.) i. 6
++++---+----+------------+----+---++++
||||6.5|5 10|3.5 7.5 13.5|5 10|6.5||||
++++---+----+------------+----+---++++
;<@(%&4)@(4+/\])/.(*"0 1 |.) i. 6
6.5 5 10 3.5 7.5 13.5 5 10 6.5
NB. can the output above be arranged
NB. in the square final output and
NB. is this approach efficient?
--
(B=) <----------my "sig"
Brian Schott
Atlanta, GA, USA
schott DOT bee are eye eh en AT gee em ae eye el DOT com
http://schott.selfip.net/~brian/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm