RE,

Previously I learned via your code a use of C. that was eye-opening.
This time, I learned via your code how a multi-x can be used in a one liner.

Very good.

On Wed, Jan 23, 2019 at 5:45 AM R.E. Boss <[email protected]> wrote:

> If your x variable denotes the columns to be sorted plus the way in which
> that should be done, like
> 0 3 2 1,:_1 1 _1 1
> Then the (explicit) toolbox verb could be
>
> foo=:4 : ('''x1 x2''=.x' ; 'x2([/: *"1)&.:(x1&C."1)~ y')
>
>    a ,.@;~&|:   (0 3 2 1,:_1 1 _1 1) foo a=.3#.^:_1 i.30
> +-----------------------------------------------------------+
> |1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|
> |0 0 0 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2|
> |0 0 0 2 2 2 1 1 1 0 0 0 2 2 2 1 1 1 0 0 0 2 2 2 1 1 1 0 0 0|
> |0 1 2 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2|
> +-----------------------------------------------------------+
> |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1|
> |0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 0 0 0|
> |0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0|
> |0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2|
> +-----------------------------------------------------------+
>
>
> R.E. Boss
>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to