Raul, My current need was to understand Copy because I had a unique situation where the size of a was fixed size. Your comments would help more if a was variable size.
On Mon, Apr 29, 2019 at 11:51 AM Raul Miller <[email protected]> wrote: > (Just catching up on the weekend's email now...) > > I am going to ignore the =. here (in `b =. ,a`), because that makes > most of the rest of this make sense... > > It seems to me that ,(0,.~0,.0,~0,])a is going to be as concise as you > can get, unless J gets a "padding primitive". > > That said, if a is large, it might make sense to do some additional > work up front. For example: > > (,a) (,((#,a)+(i.#a)*#a)+i.$a)} 0#~*/2+$a > 0 0 0 0 0 0 10 11 12 0 0 13 14 15 0 0 0 0 0 0 > > (But I'd still want to benchmark that before I declared it "more > efficient".) > > Thanks, > > -- > Raul > > -- (B=) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
