Thanks Louis, cartesian product does the trick,
Jimmy On Sat, Nov 23, 2019 at 8:33 PM Louis de Forcrand <ol...@bluewin.ch> wrote: > I believe that as Devon said the subarray selected by m in x m} y must not > contain any fill elements, which isn't the case of your example as in its > case the first element of m specifies a length 4 vector while the other two > elements specify length 2 vectors. This leads to a 2 by 2 matrix of fills > (spaces) visible (or not) in m{y. > > Another workaround is to manually specify all locations individually > (which isn't too much work): > > n=: 5 8$'O' > i=: (<0;0 1 2 3),(<1;2 3),<2 4;5 > ]j=: ; {&.> i > +---+---+---+---+---+---+---+---+ > |0 0|0 1|0 2|0 3|1 2|1 3|2 5|4 5| > +---+---+---+---+---+---+---+---+ > '=' j} n > ====OOOO > OO==OOOO > OOOOO=OO > OOOOOOOO > OOOOO=OO > > Cheers, > Louis > > > On 23 Nov 2019, at 20:35, Devon McCormick <devon...@gmail.com> wrote: > > > > Not sure why but it seems to have to do with length compatibility of the > > indexes: > > > > '='((<0; 0 1 2 3),(<1; 2 3),< 2 4 ; 5)}n > > |domain error > > | '=' ((<0;0 1 2 3),(<1;2 3),<2 4;5)}n > > > > but > > > > '='((<0; 0 1 2 3),(<1;2 2 2 3),< 2 2 2 4 ; 5)}n > > ====OOOO > > OO==OOOO > > OOOOO=OO > > OOOOOOOO > > OOOOO=OO > > > > and > > > > (0,&.>0 1 2 3),(1,&.>2 3),2 4,&.>5 > > +---+---+---+---+---+---+---+---+ > > |0 0|0 1|0 2|0 3|1 2|1 3|2 5|4 5| > > +---+---+---+---+---+---+---+---+ > > '=' ((0,&.>0 1 2 3),(1,&.>2 3),2 4,&.>5) } n > > ====OOOO > > OO==OOOO > > OOOOO=OO > > OOOOOOOO > > OOOOO=OO > > > > > > > >> On Sat, Nov 23, 2019 at 2:19 PM Jimmy Gauvin <jimmy.gau...@gmail.com> > wrote: > >> > >> Hi, > >> > >> is there any way of making this kind of assignment ? > >> > >> '='((<0; 0 1 2 3),(<1; 2 3),< 2 4 ; 5)}n > >> |domain error > >> | '=' ((<0;0 1 2 3),(<1;2 3),<2 4;5)}n > >> > >> But this works : > >> '='((<1; 2 3),< 2 4 ; 5)}n > >> OOOOOOOO > >> OO==OOOO > >> OOOOO=OO > >> OOOOOOOO > >> OOOOO=OO > >> > >> and so does : > >> > >> ((<0; 0 1 2 3),(<1; 2 3),< 2 4 ; 5){n > >> > >> OOOO > >> > >> OO > >> > >> OO > >> > >> > >> > >> Thanks > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > >> > > > > > > -- > > > > Devon McCormick, CFA > > > > Quantitative Consultant > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm