That's not partitioning, that's indexing.
R.E. Boss > -----Oorspronkelijk bericht----- > Van: Programming <[email protected]> > Namens Skip Cave > Verzonden: dinsdag 7 april 2020 20:11 > Aan: [email protected] > Onderwerp: Re: [Jprogramming] Partitioning > > Actually, I intended the integers in m to be indices into the right arg r. > So if i scramble the indicies in m to create m1: > > ]m1=.0 1 5 3;4 2 8;7 6;9 > > ┌───────┬─────┬───┬─┐ > > │0 1 5 3│4 2 8│7 6│9│ > > └───────┴─────┴───┴─┘ > Then the integers in each row of r should be scrambled according to the > indices in m1. > > Skip Cave > Cave Consulting LLC > > > On Tue, Apr 7, 2020 at 12:32 PM Skip Cave <[email protected]> > wrote: > > > Given an array of random integers: > > > > r > > > > 9 8 6 1 2 2 2 6 8 7 > > > > 5 4 8 4 2 7 9 1 4 1 > > > > 4 3 3 7 7 0 6 7 6 6 > > > > > > And a partitioning template: > > > > ]m=.0 1 2 3;4 5 6;7 8;9 > > > > ┌───────┬─────┬───┬─┐ > > > > │0 1 2 3│4 5 6│7 8│9│ > > > > └───────┴─────┴───┴─┘ > > > > > > How to produce the following partitions of r? > > > > m par r > > > > ┌───────┬─────┬───┬─┐ > > > > │9 8 6 1│2 2 2│6 8│7│ > > > > ├───────┼─────┼───┼─┤ > > > > │5 4 8 4│2 7 9│1 4│1│ > > > > ├───────┼─────┼───┼─┤ > > > > │4 3 3 7│7 0 6│7 6│6│ > > > > └───────┴─────┴───┴─┘ > > > > How do you define the dyadic par verb in m par r? > > > > Skip Cave > > > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
