Thank you. This is part of a attempt to do a cumulative product on the diagonals of the first 2 dimensions and store the result as a higher rank matrix.
Start with a 2 5 5 matrix end up with a 5 2 5 5 matrix a=:*/\(0,.2#"1 ,.i.5)}."1 3 (i.2 5 5) NB. The result must be shifted back to the lower left corner of each 5 5 matrix. b=: (-i.5)|."0 1"2 (-i.5)|."0 1&. |:"2 a But the thing looks a bit heavy-handed. There must be an easier way. Any suggestion? The first 2 dimensions are actually lower left triangular, and as in fact my array gets a bit large I was thinking of using a partitioned array until I gave up. It would probably save space and time but I am trying to keep things simple. On Mon, Mar 2, 2009 at 5:47 PM, Brian Schott <[email protected]> wrote: > Try this. > > 0 2 1 2|."0 1&. |:"2(i.2 3 4) > > > > > -- > (B=) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
