The description pertains to the standard form of the
cycle representation.  <3 1 is not in standard form.
A given cycle representation can be put into the
standard form by two applications of C. . For example:

   C.C. <3 1
+-+-+---+
|0|2|3 1|
+-+-+---+



----- Original Message -----
From: "metaperl.j" <[EMAIL PROTECTED]>
Date: Friday, November 16, 2007 12:42
Subject: [Jgeneral] C. < 3 1    NB. the cycles are not exhaustive
To: [email protected]

> 
> Re: http://www.jsoftware.com/help/dictionary/dccapdot.htm
> 
> states: "the cycles are disjoint and exhaustive (i.e., the atoms 
> of the
> boxed elements together form a permutation vector); "
> 
> However we have:
> 
>    C. < 3 1
> 0 3 2 1
> 
> but the atoms of the boxes elements are 3 and 1, which together 
> do not form
> the permutation vector 
> 0 3 2 1
> 
> I was expecting this to be required:
>    C. ( < 0; 2 ; 3 1 )
> |domain error
> |       C.(<0;2;3 1)
> 
> It seems like this must be the proper algorithm for unrolling a 
> box of
> cycle(s):
> 
> - cycle_rep =: < 3 1
> - r =: monadic_raze cycle_rep
> - perm_vector =: ( ( max r ) - 1 ) $ _1   NB. fill 
> with -1 for starters
> - any holes in the razed cycle_rep are "cycles of length 1" and 
> can simply
> fill in the value at the index as the value. In this case 0 goes 
> to position
> 0 and 2 goes to position 2
> - any remaining holes are filled in by unrolling the boxed 
> cycles. In this
> case, we just have 3 1, so we put 1 at index 3 and 3 and index 1
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to