Nice, thank you.
----- Original Message ----- From: R.E. Boss <[email protected]> To: [email protected] Cc: Sent: Friday, August 21, 2015 2:45 PM Subject: Re: [Jprogramming] permutations without reverses ts'(#~({.<{:)"1)(i.@!A.i.)8' 0.029197332 9048960 R.E. Boss > -----Original Message----- > From: [email protected] [mailto:programming- > [email protected]] On Behalf Of 'Pascal Jasmin' via > Programming > Sent: vrijdag 21 augustus 2015 19:36 > To: [email protected] > Subject: Re: [Jprogramming] permutations without reverses > > A version that compares every element to the whole list (so far) to filter out > is innefficient even for perm 8 > > reduce =: 1 : '<"_1@[ ([: u (&.>)/(>@:) ,) <@:]' > > (}: (|.@:[ (|.@:[ , ])^:(-.@:e.) ])reduce ,:@:{:)&.|. (i.@!A.i.)4 > > ----- Original Message ----- > From: 'Pascal Jasmin' via Programming <[email protected]> > To: Programming Forum <[email protected]> > Cc: > Sent: Friday, August 21, 2015 1:10 PM > Subject: [Jprogramming] permutations without reverses > > for 3, removing the "reverse duplicates" of permutations is as easy as taking > the top half > > (i.@! A. i.) 3 > 0 1 2 > 0 2 1 > 1 0 2 > 1 2 0 > 2 0 1 > 2 1 0 > > > last (5) is reverse of 0. 4 is reverse of 2, and 3 reverse of 1 > > Is there a function for producing permutations without their reverse > included? > ---------------------------------------------------------------------- > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
